| version 1.2 | | version 1.3 |
|---|
| | |
| GLXContext glxcontext; | | GLXContext glxcontext; |
| | | |
| void ogl_swap_buffers(void){ | | void ogl_swap_buffers(void){ |
| | | ogl_do_palfx(); |
| glXSwapBuffers(dpy,win); | | glXSwapBuffers(dpy,win); |
| | | glClear(GL_COLOR_BUFFER_BIT); |
| } | | } |
| int ogl_init_window(int x, int y){ | | int ogl_init_window(int x, int y){ |
| ogl_destroy_window();//destroy current window before making a new one | | ogl_destroy_window();//destroy current window before making a new one |
| | | |
| glxcontext=glXCreateContext(dpy,visinfo,0,GL_TRUE); | | glxcontext=glXCreateContext(dpy,visinfo,0,GL_TRUE); |
| | | |
| //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.event_mask=ExposureMask | StructureNotifyMask | KeyPressMask; | | swa.event_mask=ExposureMask | StructureNotifyMask | KeyPressMask; |
| // swa.event_mask=ExposureMask | StructureNotifyMask; | | // 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"); |
| XMapWindow(dpy,win); | | XMapWindow(dpy,win); |
| | | |
| glXMakeCurrent(dpy,win,glxcontext); | | glXMakeCurrent(dpy,win,glxcontext); |