|
|
|
@ -2,38 +2,23 @@ |
|
|
|
|
|
|
|
|
|
using namespace olc; |
|
|
|
|
|
|
|
|
|
#define WIDTH 640 |
|
|
|
|
#define HEIGHT 480 |
|
|
|
|
|
|
|
|
|
class Example : public olc::PixelGameEngine |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
|
Example() |
|
|
|
|
{ |
|
|
|
|
sAppName = "Example"; |
|
|
|
|
sAppName = "PGEIDE"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public: |
|
|
|
|
olc::Key last; |
|
|
|
|
bool OnUserCreate() override |
|
|
|
|
{ |
|
|
|
|
std::cout<<"Test"<<std::endl; |
|
|
|
|
ConsoleShow(olc::Key::A); |
|
|
|
|
std::cout<<"Created: "<<ScreenWidth()<<"x"<<ScreenHeight()<<std::endl; |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -42,49 +27,21 @@ public: |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void GetAnyKeyPress(olc::Key pressed)override{ |
|
|
|
|
last=pressed; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
enum Direction{ |
|
|
|
|
RIGHT, |
|
|
|
|
DOWN, |
|
|
|
|
LEFT, |
|
|
|
|
UP |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
struct Data{ |
|
|
|
|
int x,y; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main() |
|
|
|
|
int main(int argc, char** argv) |
|
|
|
|
{
|
|
|
|
|
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; |
|
|
|
|
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(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|