static SDL_Window *window = NULL;
static SDL_Renderer *renderer = NULL;
-static const Vec2di windowSize = { 1920, 1080 };
+static Vec2di windowSize;// = { 1920, 1080 };
static bool quit = false;
static const float speed = 20.f;
static const Colour bgClr = { 0x1c, 0x1c, 0x1c, 0xff };
return false;
}
+ // getting window size
+ SDL_DisplayMode dm;
+ SDL_GetCurrentDisplayMode(0, &dm);
+ windowSize.x = dm.w;
+ windowSize.y = dm.h;
+
window = SDL_CreateWindow("pong",
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
windowSize.x, windowSize.y,
return false;
}
+
ts_init(60.f);
paddle_init();
ball_init();
//TODO: run on primary display
if(!init()) { return 1; }
- int w, h;
- SDL_DisplayMode dm;
- SDL_GetCurrentDisplayMode(0, &dm);
- SDL_GetRendererOutputSize(renderer, &w, &h);
- COUT("renderer output size: (%d, %d)", w, h);
- COUT("dm output size: (%d, %d)", dm.w, dm.h);
- return 0;
while(!quit) {
update();
render();