2020-05-16 12:34:20 +02:00
|
|
|
#include "header.hpp"
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
2020-05-16 20:49:04 +02:00
|
|
|
SDL_Init(SDL_INIT_VIDEO);
|
|
|
|
|
2020-05-16 20:09:21 +02:00
|
|
|
MyWindow window(800, 800, "Test");
|
2020-05-16 21:30:21 +02:00
|
|
|
SDL_SetWindowTitle(window.GetWindow(), "New Title");
|
2020-05-17 00:16:56 +02:00
|
|
|
window.SetMouseCursorGrabbed(true);
|
2020-05-16 20:09:21 +02:00
|
|
|
|
|
|
|
SDL_Event event;
|
2020-05-16 23:36:21 +02:00
|
|
|
while (window.IsOpen())
|
2020-05-16 19:38:57 +02:00
|
|
|
{
|
2020-05-16 23:36:21 +02:00
|
|
|
while (window.PollEvent(&event))
|
2020-05-16 20:49:04 +02:00
|
|
|
{
|
2020-05-16 23:36:21 +02:00
|
|
|
switch (event.window.event)
|
|
|
|
{
|
|
|
|
case SDL_WINDOWEVENT_CLOSE:
|
|
|
|
window.Close();
|
|
|
|
break;
|
|
|
|
}
|
2020-05-16 20:49:04 +02:00
|
|
|
}
|
2020-05-16 23:36:21 +02:00
|
|
|
|
|
|
|
window.Clear(sdlu::Color::Magenta);
|
|
|
|
|
|
|
|
window.Display();
|
2020-05-16 19:38:57 +02:00
|
|
|
}
|
2020-05-16 20:09:21 +02:00
|
|
|
|
2020-05-16 20:49:04 +02:00
|
|
|
SDL_Quit();
|
|
|
|
|
2020-05-16 12:34:20 +02:00
|
|
|
return 0;
|
|
|
|
}
|