SDLU/SDLU_Example/main.cpp

33 lines
733 B
C++
Raw Normal View History

2020-05-16 10:34:20 +00:00
#include "header.hpp"
int main(int argc, char** argv)
{
2020-05-16 18:49:04 +00:00
SDL_Init(SDL_INIT_VIDEO);
2020-05-16 12:00:03 +00:00
sdlu::Vector2f vecA(.4f, -2.3f);
sdlu::Vector2f vecB(-8.9f, 0.003f);
sdlu::Vector2f vec = vecA + vecB;
2020-05-16 11:17:31 +00:00
std::cout << "Vector2f: " << vec.x << ", " << vec.y << std::endl;
2020-05-16 12:10:03 +00:00
vec *= 1.8f;
std::cout << "Vector2f: " << vec.x << ", " << vec.y << std::endl;
2020-05-16 14:03:55 +00:00
2020-05-16 18:09:21 +00:00
MyWindow window(800, 800, "Test");
SDL_SetWindowTitle(window.GetWindow(), "New Title");
2020-05-16 18:09:21 +00:00
SDL_Event event;
while (window.WaitEvent(&event))
{
2020-05-16 18:09:21 +00:00
std::cout << event.type << std::endl;
2020-05-16 18:49:04 +00:00
if (event.window.event == SDL_WINDOWEVENT_CLOSE)
{
window.Close();
break;
}
}
2020-05-16 18:09:21 +00:00
2020-05-16 18:49:04 +00:00
SDL_Quit();
2020-05-16 10:34:20 +00:00
return 0;
}