X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fgraphics%2Fglx%2Fglcontext.cpp;h=e4662f37627ceb18685c660692704f065b45e5f1;hb=35d4d400521d30d84c20cd1434626e131cbf9304;hp=09a4ef8b6ee0216ab8bdc1573cee9111da19a4d4;hpb=1aca77b93853ee127ac3bbf6886f7f04920542ef;p=libs%2Fgui.git diff --git a/source/graphics/glx/glcontext.cpp b/source/graphics/glx/glcontext.cpp index 09a4ef8..e4662f3 100644 --- a/source/graphics/glx/glcontext.cpp +++ b/source/graphics/glx/glcontext.cpp @@ -22,35 +22,35 @@ struct GLContext::Private void GLContext::platform_init(const GLOptions &opts) { - priv = new Private; - vector attribs; - + attribs.push_back(GLX_RGBA); attribs.push_back(GLX_DEPTH_SIZE); attribs.push_back(1); - + if(opts.alpha) { attribs.push_back(GLX_ALPHA_SIZE); attribs.push_back(1); } - + if(opts.stencil) { attribs.push_back(GLX_STENCIL_SIZE); attribs.push_back(1); } - + if(opts.doublebuffer) attribs.push_back(GLX_DOUBLEBUFFER); - + if(opts.multisample>0) { attribs.push_back(GLX_SAMPLE_BUFFERS_ARB); + attribs.push_back(1); + attribs.push_back(GLX_SAMPLES_ARB); attribs.push_back(opts.multisample); } - + attribs.push_back(0); DisplayHandle dpy = display.get_private().display; @@ -58,6 +58,8 @@ void GLContext::platform_init(const GLOptions &opts) XVisualInfo *vi = glXChooseVisual(dpy, DefaultScreen(dpy), &attribs.front()); if(!vi) throw unsupported_gl_mode(opts); + + priv = new Private; priv->context = glXCreateContext(dpy, vi, 0, true); XSetWindowAttributes attr; @@ -90,7 +92,6 @@ void GLContext::swap_buffers() void GLContext::window_resized(unsigned w, unsigned h) { XMoveResizeWindow(display.get_private().display, priv->subwnd, 0, 0, w, h); - glViewport(0, 0, w, h); } } // namespace Graphics