codestash/example.cpp
2023-08-23 09:46:34 -05:00

43 lines
622 B
C++

#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;
}