libgoatvr

view src/opengl.c @ 8:3d9ec6fe97d7

- added distortion mesh generation for the OpenHMD module (unfinished) - changed internal implementation function naming to use the vrimp_ prefix - added an opengl helper function to load extension entry points
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 20 Sep 2014 13:22:53 +0300
parents e63cb28fc644
children d12592558809
line source
1 #include "opengl.h"
3 #ifdef __unix__
4 void vrimp_swap_buffers(void)
5 {
6 Display *dpy = glXGetCurrentDisplay();
7 Drawable win = glXGetCurrentDrawable();
8 glXSwapBuffers(dpy, win);
9 }
11 void (*vrimp_glfunc(const char *name))()
12 {
13 return glXGetProcAddress((const unsigned char*)name);
14 }
15 #endif
17 #ifdef WIN32
18 void vrimp_swap_buffers(void)
19 {
20 HDC dc = wglGetCurrentDC();
21 SwapBuffers(dc);
22 }
24 void (*vrimp_glfunc(const char *name))()
25 {
26 return wglGetProcAddress(name);
27 }
28 #endif