X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fcgl%2Fglcontext.cpp;h=4d51052175902d85db9805ee34a2c0c81aaae135;hb=171f2b47008522ad7e950dc67447a08406f4888d;hp=94b9b2f465652a36a215696ebfccfbf1fa6dbac0;hpb=029a2e8ab09d5ba7fd17100c5ed15a7deb0934f8;p=libs%2Fgui.git diff --git a/source/graphics/cgl/glcontext.cpp b/source/graphics/cgl/glcontext.cpp index 94b9b2f..4d51052 100644 --- a/source/graphics/cgl/glcontext.cpp +++ b/source/graphics/cgl/glcontext.cpp @@ -19,28 +19,26 @@ struct GLContext::Private void GLContext::platform_init(const GLOptions &opts) { - priv = new Private; - vector attribs; - + attribs.push_back(CPF_DEPTH_SIZE); attribs.push_back(1); - + if(opts.alpha) { attribs.push_back(CPF_ALPHA_SIZE); attribs.push_back(1); } - + if(opts.stencil) { attribs.push_back(CPF_STENCIL_SIZE); attribs.push_back(1); } - + if(opts.doublebuffer) attribs.push_back(CPF_DOUBLEBUFFER); - + if(opts.multisample>0) { attribs.push_back(CPF_SAMPLE_BUFFERS); @@ -55,6 +53,7 @@ void GLContext::platform_init(const GLOptions &opts) if(!pixfmt) throw unsupported_gl_mode(opts); + priv = new Private; priv->context = create_gl_context(pixfmt); destroy_pixel_format(pixfmt); @@ -73,10 +72,9 @@ void GLContext::swap_buffers() flush_gl_buffer(priv->context); } -void GLContext::window_resized(unsigned w, unsigned h) +void GLContext::window_resized(unsigned, unsigned) { // XXX Call [context update] here? - glViewport(0, 0, w, h); } } // namespace Graphics