Add headless OSMesa backend

Allows creation and drawing to in-memory OpenGL contexts.

This backend does not provide input.

Related to #850.
This commit is contained in:
Jason Daly
2016-08-30 15:53:19 -07:00
committed by Camilla Berglund
parent a90ee65f7b
commit 368fa9475d
12 changed files with 766 additions and 0 deletions

View File

@@ -448,6 +448,30 @@ GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
/*! @brief Returns the color buffer associated with the specified window.
*
* @param[out] width The width of the color buffer.
* @param[out] height The height of the color buffer.
* @param[out] format The pixel format of the color buffer (OSMESA_FORMAT_*).
* @param[out] buffer The buffer data.
* @return 1 if successful, or 0 if not.
*/
GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* window, int* width,
int* height, int* format, void** buffer);
/*! @brief Returns the depth buffer associated with the specified window.
*
* @param[out] width The width of the depth buffer.
* @param[out] height The height of the depth buffer.
* @param[out] bytesPerValue The number of bytes per depth buffer element.
* @param[out] buffer The buffer data.
* @return 1 if successful, or 0 if not.
*/
GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* window, int* width,
int* height, int* bytesPerValue, void** buffer);
#endif
#ifdef __cplusplus
}
#endif