MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / Example

Class Example

olcExampleProgram.cpp:4–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include "olcPixelGameEngine.h"
3
4class Example : public olc::PixelGameEngine
5{
6public:
7 Example()
8 {
9 sAppName = "Example";
10 }
11
12public:
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
30int main()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected