Make it run on motsugo
[ipdf/code.git] / src / screen.cpp
index a32b1e2..e7d5d4b 100644 (file)
@@ -24,12 +24,16 @@ static void opengl_debug_callback(GLenum source, GLenum type, GLuint id, GLenum
 }
 
 
-Screen::Screen()
+Screen::Screen(bool visible)
 {
 
        SDL_Init(SDL_INIT_VIDEO);
+       uint32_t flags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE;
+       if (!visible)
+               flags |= SDL_WINDOW_HIDDEN;
+       
        m_window = SDL_CreateWindow("IPDF", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
-                       800, 600, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
+                       800, 600, flags);
 
        if (!m_window)
        {
@@ -48,17 +52,17 @@ Screen::Screen()
        // Why is this so horribly broken?
        if (ogl_IsVersionGEQ(3,0))
        {
-               Fatal("We require OpenGL 3.1, but you have version %d.%d!",ogl_GetMajorVersion(), ogl_GetMinorVersion());
+               Error("We require OpenGL 3.1, but you have version %d.%d!",ogl_GetMajorVersion(), ogl_GetMinorVersion());
        }
 
        if (!SDL_GL_ExtensionSupported("GL_ARB_shading_language_420pack"))
        {
-               Fatal("Your system does not support the ARB_shading_language_420pack extension, which is required.");
+               Error("Your system does not support the ARB_shading_language_420pack extension, which is required.");
        }
 
        if (!SDL_GL_ExtensionSupported("GL_ARB_explicit_attrib_location"))
        {
-               Fatal("Your system does not support the ARB_explicit_attrib_location extension, which is required.");
+               Error("Your system does not support the ARB_explicit_attrib_location extension, which is required.");
        }
 
        m_frame_begin_time = SDL_GetPerformanceCounter();

UCC git Repository :: git.ucc.asn.au