version 1.9 | | version 1.10 |
---|
| | |
XVisualInfo *visinfo; | | XVisualInfo *visinfo; |
GLXContext glxcontext; | | GLXContext glxcontext; |
static int fullscreen=0; | | static int fullscreen=0; |
Pixmap blankpixmap; | | Pixmap blankpixmap=None; |
Cursor blankcursor; | | Cursor blankcursor=None; |
| | |
int gr_check_fullscreen(void){ | | int gr_check_fullscreen(void){ |
return fullscreen; | | return fullscreen; |
| | |
OGL_VIEWPORT(0,0,x,y); | | OGL_VIEWPORT(0,0,x,y); |
}else { | | }else { |
glxcontext=glXCreateContext(dpy,visinfo,0,GL_TRUE); | | glxcontext=glXCreateContext(dpy,visinfo,0,GL_TRUE); |
// ogl_destroy_window();//destroy current window before making a new one | | |
| | |
//create colormap | | //create colormap |
swa.colormap=XCreateColormap(dpy,RootWindow(dpy,visinfo->screen),visinfo->visual,AllocNone); | | swa.colormap=XCreateColormap(dpy,RootWindow(dpy,visinfo->screen),visinfo->visual,AllocNone); |
//create window | | //create window |
swa.border_pixel=0; | | swa.border_pixel=0; |
swa.event_mask=ExposureMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask| ButtonPressMask | ButtonReleaseMask | PointerMotionMask; | | swa.event_mask=ExposureMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask| ButtonPressMask | ButtonReleaseMask | PointerMotionMask; |
// swa.event_mask=ExposureMask | StructureNotifyMask; | | |
win = XCreateWindow(dpy,RootWindow(dpy,visinfo->screen),0,0,x,y,0,visinfo->depth,InputOutput,visinfo->visual,CWBorderPixel|CWColormap|CWEventMask,&swa); | | win = XCreateWindow(dpy,RootWindow(dpy,visinfo->screen),0,0,x,y,0,visinfo->depth,InputOutput,visinfo->visual,CWBorderPixel|CWColormap|CWEventMask,&swa); |
XStoreName(dpy,win,DESCENT_VERSION " " D1X_DATE); | | XStoreName(dpy,win,DESCENT_VERSION " " D1X_DATE); |
// XStoreName(dpy,win,"agry"); | | // XStoreName(dpy,win,"agry"); |
| | |
void ogl_close(void){ | | void ogl_close(void){ |
gr_do_fullscreen(0); | | gr_do_fullscreen(0); |
ogl_destroy_window(); | | ogl_destroy_window(); |
| | if (blankcursor!=None){ |
XFreeCursor(dpy,blankcursor); | | XFreeCursor(dpy,blankcursor); |
XFreePixmap(dpy,blankpixmap); | | XFreePixmap(dpy,blankpixmap); |
| | } |
XCloseDisplay(dpy); | | XCloseDisplay(dpy); |
} | | } |