X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgbase%2Fglcontext.cpp;h=6e02018b897ca013ee71079fc0f915a9869e938b;hb=fcd5f24311fcfe772825a75678e038749401a9be;hp=4783e0cbc995c0eee85908e4e63f7ab76a0333fc;hpb=fbefc4904d290205658209bbe2392b4b7f9e2711;p=libs%2Fgui.git diff --git a/source/gbase/glcontext.cpp b/source/gbase/glcontext.cpp index 4783e0c..6e02018 100644 --- a/source/gbase/glcontext.cpp +++ b/source/gbase/glcontext.cpp @@ -19,8 +19,8 @@ Distributed under the LGPL #include #include "display.h" #include "glcontext.h" -#include "types.h" #include "window.h" +#include "display_priv.h" namespace Msp { namespace Graphics { @@ -59,7 +59,7 @@ GLContext::GLContext(Window &wnd, const GLOptions &opts): priv=new Private; #ifdef WIN32 - HDC dc=GetDC(window.get_handle()); + HDC dc=GetDC(window.get_private().window); PIXELFORMATDESCRIPTOR pfd; memset(&pfd, 0, sizeof(pfd)); @@ -84,7 +84,7 @@ GLContext::GLContext(Window &wnd, const GLOptions &opts): priv->context=wglCreateContext(dc); wglMakeCurrent(dc, priv->context); - ReleaseDC(window.get_handle(), dc); + ReleaseDC(window.get_private().window, dc); #else std::vector attribs; @@ -115,7 +115,7 @@ GLContext::GLContext(Window &wnd, const GLOptions &opts): attribs.push_back(0); - ::Display *dpy=display.get_display(); + ::Display *dpy=display.get_private().display; XVisualInfo *vi=glXChooseVisual(dpy, DefaultScreen(dpy), &attribs.front()); if(!vi) @@ -125,8 +125,8 @@ GLContext::GLContext(Window &wnd, const GLOptions &opts): XSetWindowAttributes attr; attr.colormap=XCreateColormap(dpy, DefaultRootWindow(dpy), vi->visual, AllocNone); - priv->subwnd=XCreateWindow(dpy, window.get_handle(), 0, 0, window.get_width(), window.get_height(), 0, vi->depth, InputOutput, vi->visual, CWColormap, &attr); - XMapWindow(display.get_display(), priv->subwnd); + priv->subwnd=XCreateWindow(dpy, window.get_private().window, 0, 0, window.get_width(), window.get_height(), 0, vi->depth, InputOutput, vi->visual, CWColormap, &attr); + XMapWindow(dpy, priv->subwnd); XFree(vi); @@ -148,7 +148,7 @@ GLContext::~GLContext() wglMakeCurrent(0, 0); wglDeleteContext(priv->context); #else - ::Display *dpy=display.get_display(); + ::Display *dpy=display.get_private().display; glXMakeCurrent(dpy, 0, 0); glXDestroyContext(dpy, priv->context); @@ -162,11 +162,11 @@ void GLContext::swap_buffers() { #ifdef WITH_OPENGL #ifdef WIN32 - HDC dc=GetDC(window.get_handle()); + HDC dc=GetDC(window.get_private().window); SwapBuffers(dc); - ReleaseDC(window.get_handle(), dc); + ReleaseDC(window.get_private().window, dc); #else - glXSwapBuffers(display.get_display(), priv->subwnd); + glXSwapBuffers(display.get_private().display, priv->subwnd); #endif #endif } @@ -175,7 +175,7 @@ void GLContext::window_resized(unsigned w, unsigned h) { #ifdef WITH_OPENGL #ifndef WIN32 - XMoveResizeWindow(display.get_display(), priv->subwnd, 0, 0, w, h); + XMoveResizeWindow(display.get_private().display, priv->subwnd, 0, 0, w, h); #endif glViewport(0, 0, w, h); #else