SDL_x11opengl.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #include "../../SDL_internal.h"
  19. #ifndef _SDL_x11opengl_h
  20. #define _SDL_x11opengl_h
  21. #if SDL_VIDEO_OPENGL_GLX
  22. #include "SDL_opengl.h"
  23. #include <GL/glx.h>
  24. struct SDL_GLDriverData
  25. {
  26. int errorBase, eventBase;
  27. SDL_bool HAS_GLX_EXT_visual_rating;
  28. SDL_bool HAS_GLX_EXT_visual_info;
  29. SDL_bool HAS_GLX_EXT_swap_control_tear;
  30. SDL_bool HAS_GLX_EXT_create_context_es2_profile;
  31. Bool (*glXQueryExtension) (Display*,int*,int*);
  32. void *(*glXGetProcAddress) (const GLubyte*);
  33. XVisualInfo *(*glXChooseVisual) (Display*,int,int*);
  34. GLXContext (*glXCreateContext) (Display*,XVisualInfo*,GLXContext,Bool);
  35. void (*glXDestroyContext) (Display*, GLXContext);
  36. Bool(*glXMakeCurrent) (Display*,GLXDrawable,GLXContext);
  37. void (*glXSwapBuffers) (Display*, GLXDrawable);
  38. void (*glXQueryDrawable) (Display*,GLXDrawable,int,unsigned int*);
  39. void (*glXSwapIntervalEXT) (Display*,GLXDrawable,int);
  40. int (*glXSwapIntervalSGI) (int);
  41. int (*glXSwapIntervalMESA) (int);
  42. int (*glXGetSwapIntervalMESA) (void);
  43. };
  44. /* OpenGL functions */
  45. extern int X11_GL_LoadLibrary(_THIS, const char *path);
  46. extern void *X11_GL_GetProcAddress(_THIS, const char *proc);
  47. extern void X11_GL_UnloadLibrary(_THIS);
  48. extern XVisualInfo *X11_GL_GetVisual(_THIS, Display * display, int screen);
  49. extern SDL_GLContext X11_GL_CreateContext(_THIS, SDL_Window * window);
  50. extern int X11_GL_MakeCurrent(_THIS, SDL_Window * window,
  51. SDL_GLContext context);
  52. extern int X11_GL_SetSwapInterval(_THIS, int interval);
  53. extern int X11_GL_GetSwapInterval(_THIS);
  54. extern void X11_GL_SwapWindow(_THIS, SDL_Window * window);
  55. extern void X11_GL_DeleteContext(_THIS, SDL_GLContext context);
  56. #endif /* SDL_VIDEO_OPENGL_GLX */
  57. #endif /* _SDL_x11opengl_h */
  58. /* vi: set ts=4 sw=4 expandtab: */