37static void makeContextCurrentOSMesa(
_GLFWwindow* window)
63 "OSMesa: Failed to make context current");
71static GLFWglproc getProcAddressOSMesa(
const char* procname)
76static void destroyContextOSMesa(
_GLFWwindow* window)
97static void swapIntervalOSMesa(
int interval)
102static int extensionSupportedOSMesa(
const char* extension)
116 const char* sonames[] =
118#if defined(_GLFW_OSMESA_LIBRARY)
119 _GLFW_OSMESA_LIBRARY,
123#elif defined(__APPLE__)
125#elif defined(__CYGWIN__)
137 for (i = 0; sonames[i]; i++)
173 "OSMesa: Failed to load required entry points");
191#define setAttrib(a, v) \
193 assert(((size_t) index + 1) < sizeof(attribs) / sizeof(attribs[0])); \
194 attribs[index++] = a; \
195 attribs[index++] = v; \
211 "OSMesa: OpenGL ES is not available on OSMesa");
215 if (ctxconfig->
share)
220 int index = 0, attribs[40];
236 if (ctxconfig->
major != 1 || ctxconfig->
minor != 0)
245 "OSMesa: Forward-compatible contexts not supported");
259 "OSMesa: OpenGL profiles unavailable");
274 "OSMesa: Failed to create context");
296 int* height,
int* format,
void** buffer)
299 GLint mesaWidth, mesaHeight, mesaFormat;
301 assert(window !=
NULL);
306 &mesaWidth, &mesaHeight,
307 &mesaFormat, &mesaBuffer))
310 "OSMesa: Failed to retrieve color buffer");
317 *height = mesaHeight;
319 *format = mesaFormat;
321 *buffer = mesaBuffer;
327 int* width,
int* height,
332 GLint mesaWidth, mesaHeight, mesaBytes;
334 assert(window !=
NULL);
339 &mesaWidth, &mesaHeight,
340 &mesaBytes, &mesaBuffer))
343 "OSMesa: Failed to retrieve depth buffer");
350 *height = mesaHeight;
352 *bytesPerValue = mesaBytes;
354 *buffer = mesaBuffer;
void _glfwPlatformGetFramebufferSize(_GLFWwindow *window, int *width, int *height)
#define GLFW_OPENGL_ES_API
#define GLFW_OPENGL_COMPAT_PROFILE
#define GLFW_OPENGL_CORE_PROFILE
void(* GLFWglproc)(void)
GLFW API types.
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
#define GLFW_NO_WINDOW_CONTEXT
The specified window does not have an OpenGL or OpenGL ES context.
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
struct GLFWwindow GLFWwindow
Opaque window object.
void _glfwInputError(int code, const char *format,...)
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
GLFWbool _glfwCreateContextOSMesa(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
void _glfwTerminateOSMesa(void)
GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow *handle, int *width, int *height, int *bytesPerValue, void **buffer)
GLFWbool _glfwInitOSMesa(void)
GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow *handle, int *width, int *height, int *format, void **buffer)
GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow *handle)
GLFWglproc(GLAPIENTRY * PFN_OSMesaGetProcAddress)(const char *)
int(GLAPIENTRY * PFN_OSMesaGetDepthBuffer)(OSMesaContext, int *, int *, int *, void **)
#define OSMESA_ACCUM_BITS
OSMesaContext(GLAPIENTRY * PFN_OSMesaCreateContextAttribs)(const int *, OSMesaContext)
OSMesaContext(GLAPIENTRY * PFN_OSMesaCreateContextExt)(GLenum, GLint, GLint, GLint, OSMesaContext)
#define OSMesaGetDepthBuffer
#define OSMESA_STENCIL_BITS
#define OSMESA_CORE_PROFILE
#define OSMesaGetProcAddress
#define OSMesaGetColorBuffer
int(GLAPIENTRY * PFN_OSMesaGetColorBuffer)(OSMesaContext, int *, int *, int *, void **)
#define OSMesaDestroyContext
#define OSMesaMakeCurrent
#define OSMesaCreateContextExt
#define OSMESA_DEPTH_BITS
#define OSMESA_CONTEXT_MINOR_VERSION
#define OSMESA_CONTEXT_MAJOR_VERSION
#define OSMesaCreateContextAttribs
void(GLAPIENTRY * PFN_OSMesaDestroyContext)(OSMesaContext)
int(GLAPIENTRY * PFN_OSMesaMakeCurrent)(OSMesaContext, void *, int, int, int)
#define OSMESA_COMPAT_PROFILE
_GLFWswapintervalfun swapInterval
_GLFWswapbuffersfun swapBuffers
_GLFWdestroycontextfun destroy
_GLFWcontextOSMesa osmesa
_GLFWmakecontextcurrentfun makeCurrent
_GLFWextensionsupportedfun extensionSupported
_GLFWgetprocaddressfun getProcAddress
_GLFWlibraryOSMesa osmesa
PFN_OSMesaGetProcAddress GetProcAddress
PFN_OSMesaGetDepthBuffer GetDepthBuffer
PFN_OSMesaDestroyContext DestroyContext
PFN_OSMesaMakeCurrent MakeCurrent
PFN_OSMesaGetColorBuffer GetColorBuffer
PFN_OSMesaCreateContextAttribs CreateContextAttribs
PFN_OSMesaCreateContextExt CreateContextExt