| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | #define OSMESA_RGBA 0x1908 |
| 29 | #define OSMESA_FORMAT 0x22 |
| 30 | #define OSMESA_DEPTH_BITS 0x30 |
| 31 | #define OSMESA_STENCIL_BITS 0x31 |
| 32 | #define OSMESA_ACCUM_BITS 0x32 |
| 33 | #define OSMESA_PROFILE 0x33 |
| 34 | #define OSMESA_CORE_PROFILE 0x34 |
| 35 | #define OSMESA_COMPAT_PROFILE 0x35 |
| 36 | #define OSMESA_CONTEXT_MAJOR_VERSION 0x36 |
| 37 | #define OSMESA_CONTEXT_MINOR_VERSION 0x37 |
| 38 | |
| 39 | typedef void* OSMesaContext; |
| 40 | typedef void (*OSMESAproc)(void); |
| 41 | |
| 42 | typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextExt)(GLenum,GLint,GLint,GLint,OSMesaContext); |
| 43 | typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextAttribs)(const int*,OSMesaContext); |
| 44 | typedef void (GLAPIENTRY * PFN_OSMesaDestroyContext)(OSMesaContext); |
| 45 | typedef int (GLAPIENTRY * PFN_OSMesaMakeCurrent)(OSMesaContext,void*,int,int,int); |
| 46 | typedef int (GLAPIENTRY * PFN_OSMesaGetColorBuffer)(OSMesaContext,int*,int*,int*,void**); |
| 47 | typedef int (GLAPIENTRY * PFN_OSMesaGetDepthBuffer)(OSMesaContext,int*,int*,int*,void**); |
| 48 | typedef GLFWglproc (GLAPIENTRY * PFN_OSMesaGetProcAddress)(const char*); |
| 49 | #define OSMesaCreateContextExt _glfw.osmesa.CreateContextExt |
| 50 | #define OSMesaCreateContextAttribs _glfw.osmesa.CreateContextAttribs |
| 51 | #define OSMesaDestroyContext _glfw.osmesa.DestroyContext |
| 52 | #define OSMesaMakeCurrent _glfw.osmesa.MakeCurrent |
| 53 | #define OSMesaGetColorBuffer _glfw.osmesa.GetColorBuffer |
| 54 | #define OSMesaGetDepthBuffer _glfw.osmesa.GetDepthBuffer |
| 55 | #define OSMesaGetProcAddress _glfw.osmesa.GetProcAddress |
| 56 | |
| 57 | #define _GLFW_OSMESA_CONTEXT_STATE _GLFWcontextOSMesa osmesa |
| 58 | #define _GLFW_OSMESA_LIBRARY_CONTEXT_STATE _GLFWlibraryOSMesa osmesa |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | typedef struct _GLFWcontextOSMesa |
| 64 | { |
| 65 | OSMesaContext handle; |
| 66 | int width; |
| 67 | int height; |
| 68 | void* buffer; |
| 69 | |
| 70 | } _GLFWcontextOSMesa; |
| 71 | |
| 72 | |
| 73 | |
| 74 | typedef struct _GLFWlibraryOSMesa |
| 75 | { |
| 76 | void* handle; |
| 77 | |
| 78 | PFN_OSMesaCreateContextExt CreateContextExt; |
| 79 | PFN_OSMesaCreateContextAttribs CreateContextAttribs; |
| 80 | PFN_OSMesaDestroyContext DestroyContext; |
| 81 | PFN_OSMesaMakeCurrent MakeCurrent; |
| 82 | PFN_OSMesaGetColorBuffer GetColorBuffer; |
| 83 | PFN_OSMesaGetDepthBuffer GetDepthBuffer; |
| 84 | PFN_OSMesaGetProcAddress GetProcAddress; |
| 85 | |
| 86 | } _GLFWlibraryOSMesa; |
| 87 | |
| 88 | |
| 89 | GLFWbool _glfwInitOSMesa(void); |
| 90 | void _glfwTerminateOSMesa(void); |
| 91 | GLFWbool _glfwCreateContextOSMesa(_GLFWwindow* window, |
| 92 | const _GLFWctxconfig* ctxconfig, |
| 93 | const _GLFWfbconfig* fbconfig); |
| 94 | |