#include <msp/core/except.h>
#include "display.h"
#include "glcontext.h"
-#include "types.h"
#include "window.h"
+#include "display_priv.h"
namespace Msp {
namespace Graphics {
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));
priv->context=wglCreateContext(dc);
wglMakeCurrent(dc, priv->context);
- ReleaseDC(window.get_handle(), dc);
+ ReleaseDC(window.get_private().window, dc);
#else
std::vector<int> attribs;
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)
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);
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);
{
#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
}
{
#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