From 4d7c527756f0410f31915e86815732ba912c1bee Mon Sep 17 00:00:00 2001 From: Martin Hegedus Date: Sun, 14 Apr 2013 23:34:37 +0200 Subject: Bug 705: This is the version of displayMultiple02 which uses glXCreateNewContext instead of glXCreateContext. X11 Error w/ Mesa 7.0 --- src/test-native/displayMultiple02_mch.c | 130 ++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 src/test-native/displayMultiple02_mch.c (limited to 'src/test-native/displayMultiple02_mch.c') diff --git a/src/test-native/displayMultiple02_mch.c b/src/test-native/displayMultiple02_mch.c new file mode 100644 index 000000000..c2ab25fbb --- /dev/null +++ b/src/test-native/displayMultiple02_mch.c @@ -0,0 +1,130 @@ +/** + * compile with: gcc -o displayMultiple02 displayMultiple02.c -lX11 -lGL + */ + +#include +#include +#include +#include +#include +#include + +static void testOrder(int reverseDestroyOrder, const char * msg); + +static int useXLockDisplay = 0; + +int main(int nargs, char **vargs) { + int arg=1; + while(argscreen), vi->visual, AllocNone); + attr.colormap = cmap; + attr.border_pixel = 0; + + /* create a window in window mode*/ + attr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask | + StructureNotifyMask; + *rWin = XCreateWindow(dpy, RootWindow(dpy, vi->screen), + 0, 0, width, height, 0, vi->depth, InputOutput, vi->visual, + CWBorderPixel | CWColormap | CWEventMask, &attr); + + XMapRaised(dpy, *rWin); +} + +void useGL(Display *dpy, Window win, GLXContext ctx, int width, int height) +{ + glXMakeCurrent(dpy, win, ctx); + glShadeModel(GL_SMOOTH); + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glClearDepth(1.0f); + glViewport(0, 0, width, height); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glXSwapBuffers(dpy, win); + glXMakeCurrent(dpy, 0, 0); +} + -- cgit v1.2.3