Added double bufering binding.

SVN revision: 1924
This commit is contained in:
Wayde Milas 2000-01-15 01:12:46 +00:00
parent d3090aa583
commit f4b3b253be
2 changed files with 19 additions and 3 deletions

View File

@ -4959,11 +4959,11 @@ Epplet_free_rgb_buf(RGB_buf buf)
#ifdef HAVE_LIBGL
GLXContext
Epplet_bind_GL(Window win, Display *dpy)
Epplet_bind_double_GL(Window win, Display *dpy)
{
XVisualInfo *vi;
GLXContext cx;
static int attributeListDbl[]={GLX_RGBA, GLX_RED_SIZE, 1,
static int attributeListDbl[]={GLX_RGBA, GLX_DOUBLEBUFFER, GLX_RED_SIZE, 1,
/*get the deepest buffer with 1 red bit*/ GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1, None };
@ -4974,6 +4974,22 @@ Epplet_bind_GL(Window win, Display *dpy)
return cx;
}
GLXContext
Epplet_bind_single_GL(Window win, Display *dpy)
{
XVisualInfo *vi;
GLXContext cx;
static int attributeListSgl[]={GLX_RGBA, GLX_RED_SIZE, 1,
/*get the deepest buffer with 1 red bit*/ GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1, None };
vi = glXChooseVisual(dpy, DefaultScreen(dpy), attributeListSgl);
cx = glXCreateContext(dpy, vi, 0, GL_TRUE);
glXMakeCurrent(dpy, win, cx);
return cx;
}
void
Epplet_unbind_GL(Display *dpy, GLXContext cx)
{

View File

@ -79,7 +79,7 @@ main(int argc, char **argv)
dpy=Epplet_get_display();
cx = Epplet_bind_GL(win, dpy);
cx = Epplet_bind_double_GL(win, dpy);
glViewport (0, 0, (GLsizei) 60, (GLsizei) 65);
glMatrixMode(GL_PROJECTION);