void* (*my_glXGetProcAddress) (char *);
void (*my_glClear) (GLbitfield);
void (*my_glClearColor) (GLclampf, GLclampf, GLclampf, GLclampf);
-void (*my_glLoadIdentity) (void);
-void (*my_glMatrixMode) (GLenum);
-void (*my_glOrtho) (GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
void (*my_glViewport) (GLint, GLint, GLsizei, GLsizei);
XVisualInfo * (*my_glXChooseVisual) (Display *, int, int *);
GLXContext (*my_glXCreateContext) (Display *, XVisualInfo *, GLXContext, Bool);
exit (1);
}
- my_glLoadIdentity = my_glXGetProcAddress ("glLoadIdentity");
- if (my_glLoadIdentity == NULL) {
- fprintf (stderr, "Failed to glXGetProcAddress glLoadIdentity\n");
- exit (1);
- }
-
- my_glMatrixMode = my_glXGetProcAddress ("glMatrixMode");
- if (my_glMatrixMode == NULL) {
- fprintf (stderr, "Failed to glXGetProcAddress glMatrixMode\n");
- exit (1);
- }
-
- my_glOrtho = my_glXGetProcAddress ("glOrtho");
- if (my_glOrtho == NULL) {
- fprintf (stderr, "Failed to glXGetProcAddress glOrtho\n");
- exit (1);
- }
-
my_glViewport = my_glXGetProcAddress ("glViewport");
if (my_glViewport == NULL) {
fprintf (stderr, "Failed to glXGetProcAddress glViewport\n");
dpy = util_x11_init_display ();
- common_create_context (dpy, &ctx, &visual_info);
+ common_create_glx_context (dpy, &ctx, &visual_info);
window = util_x11_init_window (dpy, visual_info);
- common_handle_events (dpy, ctx, window);
+ common_make_current (dpy, ctx, window);
+
+ common_handle_events (dpy, dpy, window);
util_x11_fini_window (dpy, window);