*/
+#define GLX_GLXEXT_PROTOTYPES
+
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "pbutil.h"
-/* I had to the the SGIX versions of these because for some reason glxext.h
+/* I had to use the SGIX versions of these because for some reason glxext.h
* doesn't define the core versions if GLX_VERSION_1_3 is defined, and glx.h
* doesn't define them at all. One or both header files is clearly broken.
*/
if ( glx_1_3_supported ) {
choose_fbconfig = (PFNGLXCHOOSEFBCONFIGSGIXPROC) glXGetProcAddressARB(
- (GLbyte *) "glXChooseFBConfig");
+ (GLubyte *) "glXChooseFBConfig");
get_visual_from_fbconfig = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) glXGetProcAddressARB(
- (GLbyte *) "glXGetVisualFromFBConfig");
+ (GLubyte *) "glXGetVisualFromFBConfig");
create_new_context = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) glXGetProcAddressARB(
- (GLbyte *) "glXCreateNewContext");
+ (GLubyte *) "glXCreateNewContext");
}
else if ( ext_version_supported ) {
choose_fbconfig = (PFNGLXCHOOSEFBCONFIGSGIXPROC) glXGetProcAddressARB(
- (GLbyte *) "glXChooseFBConfigSGIX");
+ (GLubyte *) "glXChooseFBConfigSGIX");
get_visual_from_fbconfig = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) glXGetProcAddressARB(
- (GLbyte *) "glXGetVisualFromFBConfigSGIX");
+ (GLubyte *) "glXGetVisualFromFBConfigSGIX");
create_new_context = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) glXGetProcAddressARB(
- (GLbyte *) "glXCreateContextWithConfigSGIX");
+ (GLubyte *) "glXCreateContextWithConfigSGIX");
}
else {
printf( "This demo requires either GLX 1.3 or %s be supported.\n",
printf("\nThe following fbconfigs meet the requirements. The first one "
"will be used.\n\n");
for ( i = 0 ; i < num_configs ; i++ ) {
- PrintFBConfigInfo(dpy, fbconfig[i], GL_TRUE);
+ PrintFBConfigInfo(dpy, scrnum, fbconfig[i], GL_TRUE);
}
/* window attributes */
None, (char **)NULL, 0, &sizehints);
}
- ctx = (*create_new_context)(dpy, fbconfig[0], GLX_RGBA_BIT, NULL, GL_TRUE);
+ ctx = (*create_new_context)(dpy, fbconfig[0], GLX_RGBA_TYPE, NULL, GL_TRUE);
if (!ctx) {
printf("Error: glXCreateNewContext failed\n");
exit(1);
Display *dpy;
Window win;
GLXContext ctx;
- char *dpyName = ":0";
+ const char *dpyName = NULL;
GLboolean printInfo = GL_FALSE;
int i;
dpy = XOpenDisplay(dpyName);
if (!dpy) {
- printf("Error: couldn't open display %s\n", dpyName);
+ printf("Error: couldn't open display %s\n", XDisplayName(dpyName));
return -1;
}