Fix PGE header segfaults (for some reason?)

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2, Sig, Sigo 2 years ago
parent 41d5fb85c5
commit f0658f3588
  1. BIN
      C++ProjectTemplate
  2. 2
      C++ProjectTemplate.js
  3. BIN
      C++ProjectTemplate.wasm
  4. 67
      main.cpp
  5. 890
      pixelGameEngine.h
  6. BIN
      pixelGameEngine.o

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

@ -2,38 +2,23 @@
using namespace olc; using namespace olc;
#define WIDTH 640
#define HEIGHT 480
class Example : public olc::PixelGameEngine class Example : public olc::PixelGameEngine
{ {
public: public:
Example() Example()
{ {
sAppName = "Example"; sAppName = "PGEIDE";
} }
public: public:
olc::Key last;
bool OnUserCreate() override bool OnUserCreate() override
{ {
std::cout<<"Test"<<std::endl; std::cout<<"Created: "<<ScreenWidth()<<"x"<<ScreenHeight()<<std::endl;
ConsoleShow(olc::Key::A);
return true; return true;
} }
bool OnUserUpdate(float fElapsedTime) override bool OnUserUpdate(float fElapsedTime) override
{ {
std::cout<<"Test 4"<<std::endl;
ConsoleCaptureStdOut(true);
std::cout<<"Test 2"<<std::endl;
ConsoleCaptureStdOut(false);
std::cout<<"Test 3"<<std::endl;
std::cout<<"A"<<std::endl;
Clear(BLACK);
DrawString({0,0},std::to_string(last));
return true; return true;
} }
@ -42,49 +27,21 @@ public:
} }
void GetAnyKeyPress(olc::Key pressed)override{ void GetAnyKeyPress(olc::Key pressed)override{
last=pressed;
} }
}; };
enum Direction{ int main(int argc, char** argv)
RIGHT,
DOWN,
LEFT,
UP
};
struct Data{
int x,y;
};
int main()
{ {
std::vector<int> testList;
std::cout<<"Test"<<std::endl;
testList.push_back(1);
testList.push_back(1);
testList.push_back(1);
testList.push_back(1);
testList.erase(testList.begin());
std::cout<<testList.size()<<std::endl;
testList.erase(testList.begin());
std::cout<<testList.size()<<std::endl;
testList.erase(testList.begin());
std::cout<<testList.size()<<std::endl;
testList.erase(testList.begin());
std::cout<<testList.size()<<std::endl;
testList.erase(testList.begin());
std::cout<<testList.size()<<std::endl;
testList.erase(testList.begin());
std::cout<<testList.size()<<std::endl;
testList.erase(testList.begin());
std::cout<<testList.size()<<std::endl;
testList.erase(testList.begin());
std::cout<<testList.size()<<std::endl;
Example demo; Example demo;
if (demo.Construct(640, 480, 4, 4)) rcode code;
if (argc==3){
code=demo.Construct(std::stoi(argv[1]), std::stoi(argv[2]), 1, 1);
} else {
code=demo.Construct(1920, 1080, 1, 1);
}
if (code!=FAIL){
std::cout<<"Run"<<std::endl;
demo.Start(); demo.Start();
}
return 0; return 0;
} }

File diff suppressed because it is too large Load Diff

Binary file not shown.
Loading…
Cancel
Save