You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#define OLC_PGE_APPLICATION
|
|
|
|
#include "pixelGameEngine.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class Example : public olc::PixelGameEngine
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Example()
|
|
|
|
{
|
|
|
|
sAppName = "Example";
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
Example demo;
|
|
|
|
if (demo.Construct(256, 240, 4, 4))
|
|
|
|
demo.Start();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|