bool GLWindow::DisplayWindow(int _width, int _height) { GetWindowSize(); if ( !CreateContextGL() ) return false; PrintProtocolVersion(); return true; }
bool GLWindow::CreateContextGL() { bool ret; #if defined(OGL4_LOG) || defined(GLSL4_API) // We need to define a debug context. So we need at a 3.0 context (if not 3.2 actually) ret = CreateContextGL(3, 3); #else // FIXME there was some issue with previous context creation on Geforce7. Code was rewritten // for GSdx unfortunately it was not tested on Geforce7 so keep the 2.0 context for now. // Note: Geforce 6&7 was dropped from nvidia driver (2012) #if 0 ret = CreateContextGL(3, 0) if (! ret ) ret = CreateContextGL(2, 0); #else ret = CreateContextGL(2, 0); #endif #endif return ret; }
bool GLWindow::DisplayWindow(int _width, int _height) { GetWindowSize(); if (!CreateVisual()) return false; // connect the glx-context to the window CreateContextGL(); glXMakeCurrent(glDisplay, glWindow, context); GetGLXVersion(); return true; }
bool GLWindow::DisplayWindow(int _width, int _height) { backbuffer.w = _width; backbuffer.h = _height; if (!CreateVisual()) return false; /* create a color map */ attr.colormap = XCreateColormap(glDisplay, RootWindow(glDisplay, vi->screen), vi->visual, AllocNone); attr.border_pixel = 0; attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | StructureNotifyMask | SubstructureRedirectMask | SubstructureNotifyMask | EnterWindowMask | LeaveWindowMask | FocusChangeMask ; // Create a window at the last position/size glWindow = XCreateWindow(glDisplay, RootWindow(glDisplay, vi->screen), conf.x , conf.y , _width, _height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap | CWEventMask, &attr); /* Allow to kill properly the window */ Atom wmDelete = XInternAtom(glDisplay, "WM_DELETE_WINDOW", True); XSetWMProtocols(glDisplay, glWindow, &wmDelete, 1); // Set icon name XSetIconName(glDisplay, glWindow, "ZZogl-pg"); // Draw the window XMapRaised(glDisplay, glWindow); XSync(glDisplay, false); // connect the glx-context to the window CreateContextGL(); glXMakeCurrent(glDisplay, glWindow, context); GetGLXVersion(); // Always start in window mode fullScreen = 0; GetWindowSize(); return true; }
bool GLWindow::DisplayWindow(int _width, int _height) { backbuffer.w = _width; backbuffer.h = _height; NativeWindow = XCreateSimpleWindow(NativeDisplay, DefaultRootWindow(NativeDisplay), conf.x, conf.y, backbuffer.w, backbuffer.h, 0, 0, 0); // Draw the window XMapRaised(NativeDisplay, NativeWindow); XSync(NativeDisplay, false); if ( !CreateContextGL() ) return false; PrintProtocolVersion(); GetWindowSize(); return true; }