parent
d3090aa583
commit
f4b3b253be
20
api/epplet.c
20
api/epplet.c
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue