X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=src%2Fscreen.cpp;h=0dbc4bc4209899b6a3e0288560db5d6c49df56ab;hb=b716ae547424e4e4bbda86781a151c31e3a64e67;hp=5c11fe1b229a1dcc594910401707b5b3375b5afb;hpb=f3452f32fba45b1f317e4a6a1906d16068ce3bdf;p=ipdf%2Fcode.git diff --git a/src/screen.cpp b/src/screen.cpp index 5c11fe1..0dbc4bc 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -45,18 +45,19 @@ 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); - + //SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); m_gl_context = SDL_GL_CreateContext(m_window); + //SDL_GL_SetSwapInterval(1); 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 +228,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 +241,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