#include "SDL20.h" #include #define IMAGECLASS TestImg #define IMAGEFILE #include #define IMAGECLASS TestImg #define IMAGEFILE #include int main(int argc, char** argv){ SDL_Init(SDL_INIT_EVERYTHING); SDLWindow win; win.Create(RectC(100, 100, 1024, 768), "First test"); { SystemDraw w; w.Set(win); Size sz = Size(1024, 768); w.Init(sz); w.DrawRect(sz, White); w.DrawText(10, 10, "Hello world!", Arial(40)); } bool quit = false; int i = 0; while(!quit) { SystemDraw w; w.Set(win); Size sz = Size(1024, 768); w.Init(sz); w.DrawText(i++, i, "Hello world!", Arial(40)); /* // w.DrawImage(300, 300, TestImg::pinkie()); RichText txt = ParseQTF(LoadFile(GetDataFile("text.qtf"))); if(1) { RTIMING("SystemDraw"); txt.Paint(Zoom(2, 10), w, 0, 0, sz.cx); } */ win.Present(); SDL_Event e; while (SDL_PollEvent(&e)){ //If user closes he window if (e.type == SDL_QUIT) quit = true; //If user presses any key if (e.type == SDL_KEYDOWN) quit = true; //If user clicks the mouse if (e.type == SDL_MOUSEBUTTONDOWN) quit = true; } SDL_Delay(20); } SDL_Quit(); return 0; }