This repository has been archived on 2021-11-25. You can view files and clone it, but cannot push or open issues/pull-requests.
CodeWorld/CodeWorld.cpp

44 lines
1.5 KiB
C++
Raw Permalink Normal View History

2018-03-23 10:52:53 +08:00
<EFBFBD><EFBFBD>#include "MiniEngine.h"
2018-03-23 11:19:20 +08:00
#include "MiniEngine_Event.h"
#include "lua.hpp"
#include <iostream>
2018-03-23 10:52:53 +08:00
using namespace MiniEngine;
2018-03-23 11:19:20 +08:00
using namespace std;
int cc = 0;
char buff[1024];
2018-03-23 10:37:21 +08:00
int main()
{
2018-03-23 11:19:20 +08:00
try {
SDLSystem sys({ SDLInitFlag::All }, { IMGInitFlag::PNG }, {}, true);
Window wnd("Code World", 1024, 768);
Renderer rnd(wnd);
Font font("asserts/msyh.ttf", 18);
rnd.clear();
rnd.update();
Event e;
while (WaitEvent(e))
{
switch (e.type)
{
case SDL_EventType::SDL_KEYDOWN:
buff[cc++] = e.key.keysym.sym;
rnd.clear();
rnd.copyTo(font.renderText(rnd, buff, RGBA(255, 255, 255, 0)), Point(0, 0));
rnd.update();
break;
}
}
2018-03-23 10:52:53 +08:00
2018-03-23 11:19:20 +08:00
}
catch (ErrorViewer& e) {
cout << e.getError() << endl;
}
2018-03-23 10:52:53 +08:00
2018-03-23 10:37:21 +08:00
return 0;
}