X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fscreen.cpp;h=16a3ab8aec29c55f9f059364d9d40faf5bbb4537;hp=0df64a28721da558ea277c71778fb0d53501ebb0;hb=f28146cf72fc68c8d3690814b1f89d47b8c4e7b9;hpb=a54254dcb23c8db9b78d5bd42e1ca54efda4c8e8 diff --git a/src/screen.cpp b/src/screen.cpp index 0df64a2..16a3ab8 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -8,6 +8,8 @@ #include "bufferbuilder.h" #include "shaderprogram.h" + + #define BASICTEX_VERT "shaders/basictex_vert.glsl" #define BASICTEX_FRAG "shaders/basictex_frag.glsl" @@ -52,27 +54,27 @@ Screen::Screen(bool visible) ogl_LoadFunctions(); // Why is this so horribly broken? - if (ogl_IsVersionGEQ(3,0)) + if (ogl_IsVersionGEQ(3,2)) { - Error("We require OpenGL 3.1, but you have version %d.%d!",ogl_GetMajorVersion(), ogl_GetMinorVersion()); + Fatal("We require OpenGL 3.3, but you have version %d.%d!",ogl_GetMajorVersion(), ogl_GetMinorVersion()); } if (!SDL_GL_ExtensionSupported("GL_ARB_shading_language_420pack")) { - Error("Your system does not support the ARB_shading_language_420pack extension, which is required."); + Fatal("Your system does not support the ARB_shading_language_420pack extension, which is required."); } if (!SDL_GL_ExtensionSupported("GL_ARB_explicit_attrib_location")) { - Error("Your system does not support the ARB_explicit_attrib_location extension, which is required."); + Fatal("Your system does not support the ARB_explicit_attrib_location extension, which is required."); } m_frame_begin_time = SDL_GetPerformanceCounter(); m_last_frame_time = 0; m_last_frame_gpu_timer = 0; + glGenQueries(1, &m_frame_gpu_timer); glBeginQuery(GL_TIME_ELAPSED, m_frame_gpu_timer); - #ifndef __MINGW32__ glDebugMessageCallback(opengl_debug_callback, 0); #endif