Add 'example.cpp'

main
sigonasr2 1 year ago
parent 33720fdd76
commit cc75ef73b6
  1. 42
      example.cpp

@ -0,0 +1,42 @@
#include "olcPixelGameEngine.h"
using namespace olc;
class Example : public olc::PixelGameEngine
{
public:
Example()
{
sAppName = "Example";
}
bool OnUserCreate() override
{
return true;
}
void OnTextEntryComplete(const std::string& sText)override{
std::cout<<"Called."<<std::endl;
};
bool OnUserUpdate(float fElapsedTime) override
{
Clear(BLACK);
if(GetKey(F1).bPressed){
TextEntryEnable(true);
}
if(IsTextEntryEnabled()){
DrawString({0,0},TextEntryGetString());
}
return true;
}
};
int main()
{
Example demo;
if (demo.Construct(640, 480, 4, 4))
demo.Start();
return 0;
}
Loading…
Cancel
Save