2016-10-13 11:24:51 -04:00
|
|
|
//========================================================================
|
|
|
|
// GLFW 3.3 OSMesa - www.glfw.org
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Copyright (c) 2016 Google Inc.
|
|
|
|
// Copyright (c) 2006-2016 Camilla Berglund <elmindreda@glfw.org>
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
//========================================================================
|
2016-08-30 18:53:19 -04:00
|
|
|
|
|
|
|
#ifndef _glfw3_osmesa_context_h_
|
|
|
|
#define _glfw3_osmesa_context_h_
|
|
|
|
|
2016-10-13 11:24:51 -04:00
|
|
|
#define OSMESA_RGBA 0x1908
|
|
|
|
#define OSMESA_FORMAT 0x22
|
|
|
|
#define OSMESA_DEPTH_BITS 0x30
|
|
|
|
#define OSMESA_STENCIL_BITS 0x31
|
|
|
|
#define OSMESA_ACCUM_BITS 0x32
|
|
|
|
#define OSMESA_PROFILE 0x33
|
|
|
|
#define OSMESA_CORE_PROFILE 0x34
|
|
|
|
#define OSMESA_COMPAT_PROFILE 0x35
|
|
|
|
#define OSMESA_CONTEXT_MAJOR_VERSION 0x36
|
|
|
|
#define OSMESA_CONTEXT_MINOR_VERSION 0x37
|
2016-08-30 18:53:19 -04:00
|
|
|
|
|
|
|
typedef void* OSMesaContext;
|
|
|
|
typedef void (*OSMESAproc)();
|
|
|
|
|
2016-10-13 11:24:51 -04:00
|
|
|
typedef OSMesaContext (* PFNOSMESACREATECONTEXTATTRIBSPROC)(const int*,OSMesaContext);
|
2016-08-30 18:53:19 -04:00
|
|
|
typedef void (* PFNOSMESADESTROYCONTEXTPROC)(OSMesaContext);
|
2016-10-13 11:24:51 -04:00
|
|
|
typedef int (* PFNOSMESAMAKECURRENTPROC)(OSMesaContext,void*,int,int,int);
|
|
|
|
typedef int (* PFNOSMESAGETCOLORBUFFERPROC)(OSMesaContext,int*,int*,int*,void**);
|
|
|
|
typedef int (* PFNOSMESAGETDEPTHBUFFERPROC)(OSMesaContext,int*,int*,int*,void**);
|
2016-08-30 18:53:19 -04:00
|
|
|
typedef GLFWglproc (* PFNOSMESAGETPROCADDRESSPROC)(const char*);
|
2016-10-13 11:24:51 -04:00
|
|
|
#define OSMesaCreateContextAttribs _glfw.osmesa.CreateContextAttribs
|
2016-08-30 18:53:19 -04:00
|
|
|
#define OSMesaDestroyContext _glfw.osmesa.DestroyContext
|
|
|
|
#define OSMesaMakeCurrent _glfw.osmesa.MakeCurrent
|
|
|
|
#define OSMesaGetColorBuffer _glfw.osmesa.GetColorBuffer
|
|
|
|
#define OSMesaGetDepthBuffer _glfw.osmesa.GetDepthBuffer
|
|
|
|
#define OSMesaGetProcAddress _glfw.osmesa.GetProcAddress
|
|
|
|
|
2016-10-13 11:24:51 -04:00
|
|
|
#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextOSMesa osmesa
|
|
|
|
#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryOSMesa osmesa
|
2016-08-30 18:53:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
// OSMesa-specific per-context data
|
|
|
|
//
|
|
|
|
typedef struct _GLFWcontextOSMesa
|
|
|
|
{
|
|
|
|
OSMesaContext handle;
|
|
|
|
int width;
|
|
|
|
int height;
|
2016-10-13 11:24:51 -04:00
|
|
|
void* buffer;
|
2016-08-30 18:53:19 -04:00
|
|
|
|
|
|
|
} _GLFWcontextOSMesa;
|
|
|
|
|
|
|
|
// OSMesa-specific global data
|
|
|
|
//
|
2016-10-13 11:24:51 -04:00
|
|
|
typedef struct _GLFWlibraryOSMesa
|
2016-08-30 18:53:19 -04:00
|
|
|
{
|
|
|
|
void* handle;
|
|
|
|
|
2016-10-13 11:24:51 -04:00
|
|
|
PFNOSMESACREATECONTEXTATTRIBSPROC CreateContextAttribs;
|
|
|
|
PFNOSMESADESTROYCONTEXTPROC DestroyContext;
|
|
|
|
PFNOSMESAMAKECURRENTPROC MakeCurrent;
|
|
|
|
PFNOSMESAGETCOLORBUFFERPROC GetColorBuffer;
|
|
|
|
PFNOSMESAGETDEPTHBUFFERPROC GetDepthBuffer;
|
|
|
|
PFNOSMESAGETPROCADDRESSPROC GetProcAddress;
|
2016-08-30 18:53:19 -04:00
|
|
|
|
2016-10-13 11:24:51 -04:00
|
|
|
} _GLFWlibraryOSMesa;
|
2016-08-30 18:53:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
GLFWbool _glfwInitOSMesa(void);
|
|
|
|
void _glfwTerminateOSMesa(void);
|
|
|
|
GLFWbool _glfwCreateContextOSMesa(_GLFWwindow* window,
|
|
|
|
const _GLFWctxconfig* ctxconfig,
|
|
|
|
const _GLFWfbconfig* fbconfig);
|
|
|
|
|
|
|
|
#endif // _glfw3_osmesa_context_h_
|