diff --git a/C++ProjectTemplate b/C++ProjectTemplate new file mode 100755 index 0000000..dc59e7a Binary files /dev/null and b/C++ProjectTemplate differ diff --git a/main.cpp b/main.cpp index e53f82e..05849a6 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,8 @@ #define OLC_PGE_APPLICATION #include "pixelGameEngine.h" +using namespace std; + class Example : public olc::PixelGameEngine { public: @@ -12,16 +14,23 @@ public: public: bool OnUserCreate() override { + SetPixelMode(olc::Pixel::ALPHA); + ConsoleCaptureStdOut(true); // Called once at the start, so create things here + for (int x = 0; x < ScreenWidth(); x++) + for (int y = 0; y < ScreenHeight(); y++) + Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255)); + for (int x=0;x<50;x++) { + for (int y=0;y<50;y++) { + Draw(x, y, olc::Pixel(255, 0, 0, 128)); + } + } return true; } bool OnUserUpdate(float fElapsedTime) override { // called once per frame - for (int x = 0; x < ScreenWidth(); x++) - for (int y = 0; y < ScreenHeight(); y++) - Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255)); return true; } };