2016-10-13 15:24:51 +00:00
|
|
|
//========================================================================
|
2019-04-16 12:43:29 +00:00
|
|
|
// GLFW 3.4 OSMesa - www.glfw.org
|
2016-10-13 15:24:51 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Copyright (c) 2016 Google Inc.
|
2019-04-15 18:50:00 +00:00
|
|
|
// Copyright (c) 2016-2017 Camilla Löwy <elmindreda@glfw.org>
|
2016-10-13 15:24:51 +00:00
|
|
|
//
|
|
|
|
// This software is provided 'as-is', without any express or implied
|
|
|
|
// warranty. In no event will the authors be held liable for any damages
|
|
|
|
// arising from the use of this software.
|
|
|
|
//
|
|
|
|
// Permission is granted to anyone to use this software for any purpose,
|
|
|
|
// including commercial applications, and to alter it and redistribute it
|
|
|
|
// freely, subject to the following restrictions:
|
|
|
|
//
|
|
|
|
// 1. The origin of this software must not be misrepresented; you must not
|
|
|
|
// claim that you wrote the original software. If you use this software
|
|
|
|
// in a product, an acknowledgment in the product documentation would
|
|
|
|
// be appreciated but is not required.
|
|
|
|
//
|
|
|
|
// 2. Altered source versions must be plainly marked as such, and must not
|
|
|
|
// be misrepresented as being the original software.
|
|
|
|
//
|
|
|
|
// 3. This notice may not be removed or altered from any source
|
|
|
|
// distribution.
|
|
|
|
//
|
|
|
|
//========================================================================
|
2019-05-20 13:24:14 +00:00
|
|
|
// Please use C89 style variable declarations in this file because VS 2010
|
|
|
|
//========================================================================
|
2016-08-30 22:53:19 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2016-10-13 15:24:51 +00:00
|
|
|
#include <assert.h>
|
2016-08-30 22:53:19 +00:00
|
|
|
|
|
|
|
#include "internal.h"
|
2016-10-13 15:24:51 +00:00
|
|
|
|
2016-08-30 22:53:19 +00:00
|
|
|
|
|
|
|
static void makeContextCurrentOSMesa(_GLFWwindow* window)
|
|
|
|
{
|
|
|
|
if (window)
|
|
|
|
{
|
2017-02-28 18:23:25 +00:00
|
|
|
int width, height;
|
2021-07-13 19:50:09 +00:00
|
|
|
_glfw.platform.getFramebufferSize(window, &width, &height);
|
2017-02-28 18:23:25 +00:00
|
|
|
|
2016-10-13 15:24:51 +00:00
|
|
|
// Check to see if we need to allocate a new buffer
|
2016-08-30 22:53:19 +00:00
|
|
|
if ((window->context.osmesa.buffer == NULL) ||
|
2017-02-28 18:23:25 +00:00
|
|
|
(width != window->context.osmesa.width) ||
|
|
|
|
(height != window->context.osmesa.height))
|
2016-08-30 22:53:19 +00:00
|
|
|
{
|
2021-08-03 18:53:48 +00:00
|
|
|
_glfw_free(window->context.osmesa.buffer);
|
2016-10-13 15:24:51 +00:00
|
|
|
|
|
|
|
// Allocate the new buffer (width * height * 8-bit RGBA)
|
2021-08-03 18:53:48 +00:00
|
|
|
window->context.osmesa.buffer = _glfw_calloc(4, (size_t) width * height);
|
2017-02-28 18:23:25 +00:00
|
|
|
window->context.osmesa.width = width;
|
|
|
|
window->context.osmesa.height = height;
|
2016-08-30 22:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!OSMesaMakeCurrent(window->context.osmesa.handle,
|
2017-02-28 18:23:25 +00:00
|
|
|
window->context.osmesa.buffer,
|
|
|
|
GL_UNSIGNED_BYTE,
|
|
|
|
width, height))
|
2016-08-30 22:53:19 +00:00
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
2016-10-13 15:24:51 +00:00
|
|
|
"OSMesa: Failed to make context current");
|
2016-08-30 22:53:19 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-25 16:23:09 +00:00
|
|
|
_glfwPlatformSetTls(&_glfw.contextSlot, window);
|
2016-08-30 22:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GLFWglproc getProcAddressOSMesa(const char* procname)
|
|
|
|
{
|
2016-10-13 15:24:51 +00:00
|
|
|
return (GLFWglproc) OSMesaGetProcAddress(procname);
|
2016-08-30 22:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void destroyContextOSMesa(_GLFWwindow* window)
|
|
|
|
{
|
2016-10-13 15:24:51 +00:00
|
|
|
if (window->context.osmesa.handle)
|
2016-08-30 22:53:19 +00:00
|
|
|
{
|
|
|
|
OSMesaDestroyContext(window->context.osmesa.handle);
|
|
|
|
window->context.osmesa.handle = NULL;
|
|
|
|
}
|
|
|
|
|
2016-10-13 15:24:51 +00:00
|
|
|
if (window->context.osmesa.buffer)
|
2016-08-30 22:53:19 +00:00
|
|
|
{
|
2021-08-03 18:53:48 +00:00
|
|
|
_glfw_free(window->context.osmesa.buffer);
|
2016-08-30 22:53:19 +00:00
|
|
|
window->context.osmesa.width = 0;
|
|
|
|
window->context.osmesa.height = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-13 15:24:51 +00:00
|
|
|
static void swapBuffersOSMesa(_GLFWwindow* window)
|
|
|
|
{
|
|
|
|
// No double buffering on OSMesa
|
|
|
|
}
|
2016-08-30 22:53:19 +00:00
|
|
|
|
2016-10-13 15:24:51 +00:00
|
|
|
static void swapIntervalOSMesa(int interval)
|
|
|
|
{
|
|
|
|
// No swap interval on OSMesa
|
|
|
|
}
|
2016-08-30 22:53:19 +00:00
|
|
|
|
2016-10-13 15:24:51 +00:00
|
|
|
static int extensionSupportedOSMesa(const char* extension)
|
2016-08-30 22:53:19 +00:00
|
|
|
{
|
2016-10-13 15:24:51 +00:00
|
|
|
// OSMesa does not have extensions
|
2016-08-30 22:53:19 +00:00
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-10-13 15:24:51 +00:00
|
|
|
|
2016-08-30 22:53:19 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
////// GLFW internal API //////
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
GLFWbool _glfwInitOSMesa(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
const char* sonames[] =
|
|
|
|
{
|
2017-09-10 19:02:26 +00:00
|
|
|
#if defined(_GLFW_OSMESA_LIBRARY)
|
|
|
|
_GLFW_OSMESA_LIBRARY,
|
|
|
|
#elif defined(_WIN32)
|
2016-08-30 22:53:19 +00:00
|
|
|
"libOSMesa.dll",
|
|
|
|
"OSMesa.dll",
|
2016-10-13 15:24:51 +00:00
|
|
|
#elif defined(__APPLE__)
|
|
|
|
"libOSMesa.8.dylib",
|
|
|
|
#elif defined(__CYGWIN__)
|
|
|
|
"libOSMesa-8.so",
|
2022-02-23 17:47:30 +00:00
|
|
|
#elif defined(__OpenBSD__) || defined(__NetBSD__)
|
2021-12-22 21:19:25 +00:00
|
|
|
"libOSMesa.so",
|
2016-08-30 22:53:19 +00:00
|
|
|
#else
|
2016-11-08 21:44:59 +00:00
|
|
|
"libOSMesa.so.8",
|
2016-08-30 22:53:19 +00:00
|
|
|
"libOSMesa.so.6",
|
|
|
|
#endif
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
if (_glfw.osmesa.handle)
|
|
|
|
return GLFW_TRUE;
|
|
|
|
|
|
|
|
for (i = 0; sonames[i]; i++)
|
|
|
|
{
|
2021-07-16 12:57:22 +00:00
|
|
|
_glfw.osmesa.handle = _glfwPlatformLoadModule(sonames[i]);
|
2016-08-30 22:53:19 +00:00
|
|
|
if (_glfw.osmesa.handle)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!_glfw.osmesa.handle)
|
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_API_UNAVAILABLE, "OSMesa: Library not found");
|
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-12-06 19:10:51 +00:00
|
|
|
_glfw.osmesa.CreateContextExt = (PFN_OSMesaCreateContextExt)
|
2021-07-16 12:57:22 +00:00
|
|
|
_glfwPlatformGetModuleSymbol(_glfw.osmesa.handle, "OSMesaCreateContextExt");
|
2016-12-06 19:10:51 +00:00
|
|
|
_glfw.osmesa.CreateContextAttribs = (PFN_OSMesaCreateContextAttribs)
|
2021-07-16 12:57:22 +00:00
|
|
|
_glfwPlatformGetModuleSymbol(_glfw.osmesa.handle, "OSMesaCreateContextAttribs");
|
2016-12-06 19:10:51 +00:00
|
|
|
_glfw.osmesa.DestroyContext = (PFN_OSMesaDestroyContext)
|
2021-07-16 12:57:22 +00:00
|
|
|
_glfwPlatformGetModuleSymbol(_glfw.osmesa.handle, "OSMesaDestroyContext");
|
2016-12-06 19:10:51 +00:00
|
|
|
_glfw.osmesa.MakeCurrent = (PFN_OSMesaMakeCurrent)
|
2021-07-16 12:57:22 +00:00
|
|
|
_glfwPlatformGetModuleSymbol(_glfw.osmesa.handle, "OSMesaMakeCurrent");
|
2016-12-06 19:10:51 +00:00
|
|
|
_glfw.osmesa.GetColorBuffer = (PFN_OSMesaGetColorBuffer)
|
2021-07-16 12:57:22 +00:00
|
|
|
_glfwPlatformGetModuleSymbol(_glfw.osmesa.handle, "OSMesaGetColorBuffer");
|
2016-12-06 19:10:51 +00:00
|
|
|
_glfw.osmesa.GetDepthBuffer = (PFN_OSMesaGetDepthBuffer)
|
2021-07-16 12:57:22 +00:00
|
|
|
_glfwPlatformGetModuleSymbol(_glfw.osmesa.handle, "OSMesaGetDepthBuffer");
|
2016-12-06 19:10:51 +00:00
|
|
|
_glfw.osmesa.GetProcAddress = (PFN_OSMesaGetProcAddress)
|
2021-07-16 12:57:22 +00:00
|
|
|
_glfwPlatformGetModuleSymbol(_glfw.osmesa.handle, "OSMesaGetProcAddress");
|
2016-08-30 22:53:19 +00:00
|
|
|
|
2016-11-08 21:44:59 +00:00
|
|
|
if (!_glfw.osmesa.CreateContextExt ||
|
2016-08-30 22:53:19 +00:00
|
|
|
!_glfw.osmesa.DestroyContext ||
|
|
|
|
!_glfw.osmesa.MakeCurrent ||
|
|
|
|
!_glfw.osmesa.GetColorBuffer ||
|
|
|
|
!_glfw.osmesa.GetDepthBuffer ||
|
|
|
|
!_glfw.osmesa.GetProcAddress)
|
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
|
|
|
"OSMesa: Failed to load required entry points");
|
|
|
|
|
|
|
|
_glfwTerminateOSMesa();
|
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return GLFW_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void _glfwTerminateOSMesa(void)
|
|
|
|
{
|
|
|
|
if (_glfw.osmesa.handle)
|
|
|
|
{
|
2021-07-16 12:57:22 +00:00
|
|
|
_glfwPlatformFreeModule(_glfw.osmesa.handle);
|
2016-08-30 22:53:19 +00:00
|
|
|
_glfw.osmesa.handle = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-07 10:51:12 +00:00
|
|
|
#define SET_ATTRIB(a, v) \
|
2016-10-13 15:24:51 +00:00
|
|
|
{ \
|
2019-04-15 13:35:38 +00:00
|
|
|
assert(((size_t) index + 1) < sizeof(attribs) / sizeof(attribs[0])); \
|
2017-06-08 13:52:55 +00:00
|
|
|
attribs[index++] = a; \
|
|
|
|
attribs[index++] = v; \
|
2016-10-13 15:24:51 +00:00
|
|
|
}
|
|
|
|
|
2016-08-30 22:53:19 +00:00
|
|
|
GLFWbool _glfwCreateContextOSMesa(_GLFWwindow* window,
|
|
|
|
const _GLFWctxconfig* ctxconfig,
|
|
|
|
const _GLFWfbconfig* fbconfig)
|
|
|
|
{
|
2016-10-13 15:24:51 +00:00
|
|
|
OSMesaContext share = NULL;
|
2016-11-08 21:44:59 +00:00
|
|
|
const int accumBits = fbconfig->accumRedBits +
|
|
|
|
fbconfig->accumGreenBits +
|
|
|
|
fbconfig->accumBlueBits +
|
|
|
|
fbconfig->accumAlphaBits;
|
2016-08-30 22:53:19 +00:00
|
|
|
|
2016-11-08 22:43:45 +00:00
|
|
|
if (ctxconfig->client == GLFW_OPENGL_ES_API)
|
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_API_UNAVAILABLE,
|
|
|
|
"OSMesa: OpenGL ES is not available on OSMesa");
|
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-08-30 22:53:19 +00:00
|
|
|
if (ctxconfig->share)
|
|
|
|
share = ctxconfig->share->context.osmesa.handle;
|
|
|
|
|
2016-11-08 21:44:59 +00:00
|
|
|
if (OSMesaCreateContextAttribs)
|
2016-10-13 15:24:51 +00:00
|
|
|
{
|
2016-11-08 21:44:59 +00:00
|
|
|
int index = 0, attribs[40];
|
|
|
|
|
2022-01-07 10:51:12 +00:00
|
|
|
SET_ATTRIB(OSMESA_FORMAT, OSMESA_RGBA);
|
|
|
|
SET_ATTRIB(OSMESA_DEPTH_BITS, fbconfig->depthBits);
|
|
|
|
SET_ATTRIB(OSMESA_STENCIL_BITS, fbconfig->stencilBits);
|
|
|
|
SET_ATTRIB(OSMESA_ACCUM_BITS, accumBits);
|
2016-11-08 21:44:59 +00:00
|
|
|
|
|
|
|
if (ctxconfig->profile == GLFW_OPENGL_CORE_PROFILE)
|
|
|
|
{
|
2022-01-07 10:51:12 +00:00
|
|
|
SET_ATTRIB(OSMESA_PROFILE, OSMESA_CORE_PROFILE);
|
2016-11-08 21:44:59 +00:00
|
|
|
}
|
|
|
|
else if (ctxconfig->profile == GLFW_OPENGL_COMPAT_PROFILE)
|
|
|
|
{
|
2022-01-07 10:51:12 +00:00
|
|
|
SET_ATTRIB(OSMESA_PROFILE, OSMESA_COMPAT_PROFILE);
|
2016-11-08 21:44:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ctxconfig->major != 1 || ctxconfig->minor != 0)
|
|
|
|
{
|
2022-01-07 10:51:12 +00:00
|
|
|
SET_ATTRIB(OSMESA_CONTEXT_MAJOR_VERSION, ctxconfig->major);
|
|
|
|
SET_ATTRIB(OSMESA_CONTEXT_MINOR_VERSION, ctxconfig->minor);
|
2016-11-08 21:44:59 +00:00
|
|
|
}
|
|
|
|
|
2016-11-08 22:43:45 +00:00
|
|
|
if (ctxconfig->forward)
|
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
2018-12-14 18:26:42 +00:00
|
|
|
"OSMesa: Forward-compatible contexts not supported");
|
2016-11-08 22:43:45 +00:00
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
|
|
|
|
2022-01-07 10:51:12 +00:00
|
|
|
SET_ATTRIB(0, 0);
|
2016-11-08 21:44:59 +00:00
|
|
|
|
|
|
|
window->context.osmesa.handle =
|
|
|
|
OSMesaCreateContextAttribs(attribs, share);
|
2016-10-13 15:24:51 +00:00
|
|
|
}
|
2016-11-08 21:44:59 +00:00
|
|
|
else
|
2016-10-13 15:24:51 +00:00
|
|
|
{
|
2016-11-08 21:44:59 +00:00
|
|
|
if (ctxconfig->profile)
|
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
|
|
|
"OSMesa: OpenGL profiles unavailable");
|
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
2016-10-13 15:24:51 +00:00
|
|
|
|
2016-11-08 21:44:59 +00:00
|
|
|
window->context.osmesa.handle =
|
|
|
|
OSMesaCreateContextExt(OSMESA_RGBA,
|
|
|
|
fbconfig->depthBits,
|
|
|
|
fbconfig->stencilBits,
|
|
|
|
accumBits,
|
|
|
|
share);
|
2016-10-13 15:24:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (window->context.osmesa.handle == NULL)
|
2016-08-30 22:53:19 +00:00
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
2016-10-13 15:24:51 +00:00
|
|
|
"OSMesa: Failed to create context");
|
2016-08-30 22:53:19 +00:00
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
window->context.makeCurrent = makeContextCurrentOSMesa;
|
|
|
|
window->context.swapBuffers = swapBuffersOSMesa;
|
|
|
|
window->context.swapInterval = swapIntervalOSMesa;
|
|
|
|
window->context.extensionSupported = extensionSupportedOSMesa;
|
|
|
|
window->context.getProcAddress = getProcAddressOSMesa;
|
|
|
|
window->context.destroy = destroyContextOSMesa;
|
|
|
|
|
|
|
|
return GLFW_TRUE;
|
|
|
|
}
|
|
|
|
|
2022-01-07 10:51:12 +00:00
|
|
|
#undef SET_ATTRIB
|
2016-10-13 15:24:51 +00:00
|
|
|
|
|
|
|
|
2016-08-30 22:53:19 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
////// GLFW native API //////
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-10-13 15:24:51 +00:00
|
|
|
GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* handle, int* width,
|
|
|
|
int* height, int* format, void** buffer)
|
|
|
|
{
|
|
|
|
void* mesaBuffer;
|
|
|
|
GLint mesaWidth, mesaHeight, mesaFormat;
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle;
|
|
|
|
assert(window != NULL);
|
|
|
|
|
|
|
|
_GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE);
|
|
|
|
|
2021-10-23 13:17:33 +00:00
|
|
|
if (window->context.source != GLFW_OSMESA_CONTEXT_API)
|
2021-10-04 18:32:32 +00:00
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL);
|
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-10-13 15:24:51 +00:00
|
|
|
if (!OSMesaGetColorBuffer(window->context.osmesa.handle,
|
|
|
|
&mesaWidth, &mesaHeight,
|
|
|
|
&mesaFormat, &mesaBuffer))
|
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
|
|
|
"OSMesa: Failed to retrieve color buffer");
|
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (width)
|
|
|
|
*width = mesaWidth;
|
|
|
|
if (height)
|
|
|
|
*height = mesaHeight;
|
|
|
|
if (format)
|
|
|
|
*format = mesaFormat;
|
|
|
|
if (buffer)
|
|
|
|
*buffer = mesaBuffer;
|
|
|
|
|
|
|
|
return GLFW_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* handle,
|
|
|
|
int* width, int* height,
|
|
|
|
int* bytesPerValue,
|
|
|
|
void** buffer)
|
|
|
|
{
|
|
|
|
void* mesaBuffer;
|
|
|
|
GLint mesaWidth, mesaHeight, mesaBytes;
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle;
|
|
|
|
assert(window != NULL);
|
|
|
|
|
|
|
|
_GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE);
|
|
|
|
|
2021-10-23 13:17:33 +00:00
|
|
|
if (window->context.source != GLFW_OSMESA_CONTEXT_API)
|
2021-10-04 18:32:32 +00:00
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL);
|
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-10-13 15:24:51 +00:00
|
|
|
if (!OSMesaGetDepthBuffer(window->context.osmesa.handle,
|
|
|
|
&mesaWidth, &mesaHeight,
|
|
|
|
&mesaBytes, &mesaBuffer))
|
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
|
|
|
"OSMesa: Failed to retrieve depth buffer");
|
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (width)
|
|
|
|
*width = mesaWidth;
|
|
|
|
if (height)
|
|
|
|
*height = mesaHeight;
|
|
|
|
if (bytesPerValue)
|
|
|
|
*bytesPerValue = mesaBytes;
|
|
|
|
if (buffer)
|
|
|
|
*buffer = mesaBuffer;
|
|
|
|
|
|
|
|
return GLFW_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow* handle)
|
|
|
|
{
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle;
|
|
|
|
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
|
|
|
|
2021-10-23 13:17:33 +00:00
|
|
|
if (window->context.source != GLFW_OSMESA_CONTEXT_API)
|
2016-10-13 15:24:51 +00:00
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return window->context.osmesa.handle;
|
|
|
|
}
|
|
|
|
|