mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 22:14:34 +00:00
Removed glfwGetGLVersion, added GLFW_OPENGL_REVISION.
This commit is contained in:
parent
44035f5ef1
commit
d25f9db752
@ -409,10 +409,11 @@ extern "C" {
|
||||
#define GLFW_FSAA_SAMPLES 0x00020012
|
||||
#define GLFW_OPENGL_VERSION_MAJOR 0x00020013
|
||||
#define GLFW_OPENGL_VERSION_MINOR 0x00020014
|
||||
#define GLFW_OPENGL_FORWARD_COMPAT 0x00020015
|
||||
#define GLFW_OPENGL_DEBUG_CONTEXT 0x00020016
|
||||
#define GLFW_OPENGL_PROFILE 0x00020017
|
||||
#define GLFW_OPENGL_ROBUSTNESS 0x00020018
|
||||
#define GLFW_OPENGL_REVISION 0x00020015
|
||||
#define GLFW_OPENGL_FORWARD_COMPAT 0x00020016
|
||||
#define GLFW_OPENGL_DEBUG_CONTEXT 0x00020017
|
||||
#define GLFW_OPENGL_PROFILE 0x00020018
|
||||
#define GLFW_OPENGL_ROBUSTNESS 0x00020019
|
||||
|
||||
/* GLFW_OPENGL_ROBUSTNESS mode tokens */
|
||||
#define GLFW_OPENGL_NO_ROBUSTNESS 0x00000000
|
||||
@ -582,7 +583,6 @@ GLFWAPI void glfwSwapBuffers(void);
|
||||
GLFWAPI void glfwSwapInterval(int interval);
|
||||
GLFWAPI int glfwExtensionSupported(const char* extension);
|
||||
GLFWAPI void* glfwGetProcAddress(const char* procname);
|
||||
GLFWAPI void glfwGetGLVersion(int* major, int* minor, int* rev);
|
||||
GLFWAPI void glfwCopyGLState(GLFWwindow src, GLFWwindow dst, unsigned long mask);
|
||||
|
||||
/* Enable/disable functions */
|
||||
|
@ -276,6 +276,7 @@ version of GLFW.</p>
|
||||
<li>Added <code>glfwCopyGLState</code> function for copying OpenGL state categories between contexts</li>
|
||||
<li>Added <code>GLFW_OPENGL_ES2_PROFILE</code> profile for creating OpenGL ES 2.0 contexts using the <code>GLX_EXT_create_context_es2_profile</code> and <code>WGL_EXT_create_context_es2_profile</code> extensions</li>
|
||||
<li>Added <code>GLFW_OPENGL_ROBUSTNESS</code> window hint and associated strategy tokens for <code>GL_ARB_robustness</code> support</li>
|
||||
<li>Added <code>GLFW_OPENGL_REVISION</code> window parameter to make up for removal of <code>glfwGetGLVersion</code></li>
|
||||
<li>Added <code>windows</code> simple multi-window test program</li>
|
||||
<li>Added <code>sharing</code> simple OpenGL object sharing test program</li>
|
||||
<li>Added a parameter to <code>glfwOpenWindow</code> for specifying a context the new window's context will share objects with</li>
|
||||
@ -295,6 +296,7 @@ version of GLFW.</p>
|
||||
<li>Removed deprecated Carbon port</li>
|
||||
<li>Removed <code>glfwSleep</code> function</li>
|
||||
<li>Removed <code>glfwGetNumberOfProcessors</code> function</li>
|
||||
<li>Removed <code>glfwGetGLVersion</code> function</li>
|
||||
<li>Removed <code>GLFW_OPENED</code> window parameter</li>
|
||||
<li>Removed nonsensical key actions for Unicode character input</li>
|
||||
<li>Removed <code>GLFWCALL</code> and <code>GLFWAPIENTRY</code> macros for stdcall calling convention</li>
|
||||
|
32
src/opengl.c
32
src/opengl.c
@ -556,38 +556,6 @@ GLFWAPI void* glfwGetProcAddress(const char* procname)
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Returns the OpenGL version
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwGetGLVersion(int* major, int* minor, int* rev)
|
||||
{
|
||||
_GLFWwindow* window;
|
||||
|
||||
if (!_glfwInitialized)
|
||||
{
|
||||
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
window = _glfwLibrary.currentWindow;
|
||||
if (!window)
|
||||
{
|
||||
_glfwSetError(GLFW_NO_CURRENT_WINDOW, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (major != NULL)
|
||||
*major = window->glMajor;
|
||||
|
||||
if (minor != NULL)
|
||||
*minor = window->glMinor;
|
||||
|
||||
if (rev != NULL)
|
||||
*rev = window->glRevision;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Copies the specified OpenGL state categories from src to dst
|
||||
//========================================================================
|
||||
|
@ -777,6 +777,8 @@ GLFWAPI int glfwGetWindowParam(GLFWwindow handle, int param)
|
||||
return window->glMajor;
|
||||
case GLFW_OPENGL_VERSION_MINOR:
|
||||
return window->glMinor;
|
||||
case GLFW_OPENGL_REVISION:
|
||||
return window->glRevision;
|
||||
case GLFW_OPENGL_FORWARD_COMPAT:
|
||||
return window->glForward;
|
||||
case GLFW_OPENGL_DEBUG_CONTEXT:
|
||||
|
@ -229,7 +229,9 @@ int main(int argc, char** argv)
|
||||
|
||||
printf("OpenGL context version string: \"%s\"\n", glGetString(GL_VERSION));
|
||||
|
||||
glfwGetGLVersion(&major, &minor, &revision);
|
||||
major = glfwGetWindowParam(window, GLFW_OPENGL_VERSION_MAJOR);
|
||||
minor = glfwGetWindowParam(window, GLFW_OPENGL_VERSION_MINOR);
|
||||
revision = glfwGetWindowParam(window, GLFW_OPENGL_REVISION);
|
||||
|
||||
printf("OpenGL context version parsed by GLFW: %u.%u.%u\n", major, minor, revision);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user