medfall

A super great game engine
Log | Files | Refs

commit ac8cd19bc6421d87f81c6891bfc42e6487d5a569
parent af66c86f87f1373e25a2abe06d38225035955209
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Tue Jul  4 21:57:57 +0300

Only run fullscreen in release builds

Diffstat:
gl.cc | 25++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/gl.cc b/gl.cc @@ -115,8 +115,13 @@ GLFWwindow * gl_init( WindowType window_type ) { const GLFWvidmode * mode = glfwGetVideoMode( monitor ); if( window_type == WINDOW_GAME ) { +#if RELEASE_BUILD width = mode->width; height = mode->height; +#else + width = mode->width * 3 / 4; + height = mode->height * 3 / 4; +#endif } glfwWindowHint( GLFW_CLIENT_API, GLFW_OPENGL_API ); @@ -131,20 +136,18 @@ GLFWwindow * gl_init( WindowType window_type ) { FATAL( "glfwCreateWindow" ); } - if( window_type == WINDOW_LAUNCHER ) { - int frame_top, frame_bottom, frame_left, frame_right; - glfwGetWindowFrameSize( window, &frame_left, &frame_top, &frame_right, &frame_bottom ); + int frame_top, frame_bottom, frame_left, frame_right; + glfwGetWindowFrameSize( window, &frame_left, &frame_top, &frame_right, &frame_bottom ); - int monitor_top, monitor_left; - glfwGetMonitorPos( monitor, &monitor_left, &monitor_top ); + int monitor_top, monitor_left; + glfwGetMonitorPos( monitor, &monitor_left, &monitor_top ); - int total_width = width + frame_left + frame_right; - int total_height = height + frame_top + frame_bottom; + int total_width = width + frame_left + frame_right; + int total_height = height + frame_top + frame_bottom; - glfwSetWindowPos( window, - monitor_left + mode->width / 2 - total_width / 2, - monitor_top + mode->height / 2 - total_height / 2 ); - } + glfwSetWindowPos( window, + monitor_left + mode->width / 2 - total_width / 2, + monitor_top + mode->height / 2 - total_height / 2 ); window_size = v2u32( checked_cast< u32 >( width ), checked_cast< u32 >( height ) );