X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fscreen.cpp;h=628a11adbe6add14b4d97dbad770b8f809c83c0b;hp=5c11fe1b229a1dcc594910401707b5b3375b5afb;hb=6c0dfe752994312ee58d307b383948bfeb2d6e2e;hpb=c4f8f7c6c7e43fc9fd5358197ca866b4186f636c;ds=sidebyside diff --git a/src/screen.cpp b/src/screen.cpp index 5c11fe1..628a11a 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -45,7 +45,7 @@ Screen::Screen(bool visible) } SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); @@ -54,9 +54,9 @@ 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()); + Error("We require OpenGL 3.3, but you have version %d.%d!",ogl_GetMajorVersion(), ogl_GetMinorVersion()); } if (!SDL_GL_ExtensionSupported("GL_ARB_shading_language_420pack")) @@ -227,8 +227,10 @@ void Screen::Present() { if (!Valid()) return; + if (m_debug_font_atlas) DebugFontFlush(); + m_last_frame_time = SDL_GetPerformanceCounter() - m_frame_begin_time; glEndQuery(GL_TIME_ELAPSED); SDL_GL_SwapWindow(m_window); @@ -238,6 +240,8 @@ void Screen::Present() m_last_frame_gpu_timer = m_frame_gpu_timer; glGenQueries(1, &m_frame_gpu_timer); glBeginQuery(GL_TIME_ELAPSED, m_frame_gpu_timer); + + } double Screen::GetLastFrameTimeGPU() const