| 2 | #include "olcPixelGameEngine.h" |
| 3 | |
| 4 | class Example : public olc::PixelGameEngine |
| 5 | { |
| 6 | public: |
| 7 | Example() |
| 8 | { |
| 9 | sAppName = "Example"; |
| 10 | } |
| 11 | |
| 12 | public: |
| 13 | bool OnUserCreate() override |
| 14 | { |
| 15 | // Called once at the start, so create things here |
| 16 | return true; |
| 17 | } |
| 18 | |
| 19 | bool OnUserUpdate(float fElapsedTime) override |
| 20 | { |
| 21 | // called once per frame |
| 22 | for (int x = 0; x < ScreenWidth(); x++) |
| 23 | for (int y = 0; y < ScreenHeight(); y++) |
| 24 | Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255)); |
| 25 | return true; |
| 26 | } |
| 27 | }; |
| 28 | |
| 29 | |
| 30 | int main() |
nothing calls this directly
no outgoing calls
no test coverage detected