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 Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

#include "MiniEngine.h"
#include "MiniEngine_Event.h"
#include "lua.hpp"
#include <iostream>
using namespace MiniEngine;
using namespace std;
int cc = 0;
char buff[1024];
int main()
{
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;
}
}
}
catch (ErrorViewer& e) {
cout << e.getError() << endl;
}
return 0;
}