X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fglx%2Fglcontext.cpp;h=26275a4b6b7ee5cf6626b23f00abe6ddee92f4a2;hb=d163b3628fee61ea4acad0e9429aab904b03bf70;hp=09a4ef8b6ee0216ab8bdc1573cee9111da19a4d4;hpb=1aca77b93853ee127ac3bbf6886f7f04920542ef;p=libs%2Fgui.git diff --git a/source/graphics/glx/glcontext.cpp b/source/graphics/glx/glcontext.cpp index 09a4ef8..26275a4 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;