mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 04:54:35 +00:00
Added glfwGetVersionString.
This commit is contained in:
parent
3c2a89e5e8
commit
d6fe447ca9
@ -399,6 +399,7 @@ typedef void (* GLFWcharfun)(GLFWwindow,int);
|
||||
GLFWAPI int glfwInit(void);
|
||||
GLFWAPI void glfwTerminate(void);
|
||||
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
|
||||
GLFWAPI const char* glfwGetVersionString(void);
|
||||
|
||||
/* Error handling */
|
||||
GLFWAPI int glfwGetError(void);
|
||||
|
@ -266,6 +266,7 @@ version of GLFW.</p>
|
||||
<li>Added <code>glfwMakeWindowCurrent</code> function for making the context of the specified window current</li>
|
||||
<li>Added <code>glfwGetError</code> and <code>glfwErrorString</code> error reporting functions and a number of error tokens</li>
|
||||
<li>Added <code>glfwSetWindowUserPointer</code> and <code>glfwGetWindowUserPointer</code> functions for per-window user pointers</li>
|
||||
<li>Added <code>glfwGetVersionString</code> function for determining which code paths were enabled at compile time</li>
|
||||
<li>Added <code>windows</code> simple multi-window test program</li>
|
||||
<li>Changed buffer bit depth parameters of <code>glfwOpenWindow</code> to window hints</li>
|
||||
<li>Renamed <code>lib</code> source code directory to <code>src</code></li>
|
||||
|
10
src/init.c
10
src/init.c
@ -97,3 +97,13 @@ GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev)
|
||||
*rev = GLFW_VERSION_REVISION;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the GLFW version string
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI const char* glfwGetVersionString(void)
|
||||
{
|
||||
return _glfwPlatformGetVersionString();
|
||||
}
|
||||
|
||||
|
@ -235,9 +235,7 @@ GLFWGLOBAL _GLFWlibrary _glfwLibrary;
|
||||
// Init/terminate
|
||||
int _glfwPlatformInit(void);
|
||||
int _glfwPlatformTerminate(void);
|
||||
|
||||
// Error handling
|
||||
void _glfwSetError(int error);
|
||||
const char* _glfwPlatformGetVersionString(void);
|
||||
|
||||
// Enable/Disable
|
||||
void _glfwPlatformEnableSystemKeys(_GLFWwindow* window);
|
||||
@ -285,6 +283,9 @@ void* _glfwPlatformGetProcAddress(const char* procname);
|
||||
// Prototypes for platform independent internal functions
|
||||
//========================================================================
|
||||
|
||||
// Error handling
|
||||
void _glfwSetError(int error);
|
||||
|
||||
// Window management (window.c)
|
||||
void _glfwClearWindowHints(void);
|
||||
|
||||
|
@ -12,3 +12,5 @@
|
||||
/* Define this to 1 if glXGetProcAddressEXT is available */
|
||||
#cmakedefine _GLFW_HAS_GLXGETPROCADDRESSEXT 1
|
||||
|
||||
#define _GLFW_VERSION_FULL "@GLFW_VERSION_FULL@"
|
||||
|
||||
|
@ -247,3 +247,32 @@ int _glfwPlatformTerminate(void)
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
//========================================================================
|
||||
// Get the GLFW version string
|
||||
//========================================================================
|
||||
|
||||
const char* _glfwPlatformGetVersionString(void)
|
||||
{
|
||||
const char* version = "GLFW " _GLFW_VERSION_FULL
|
||||
#if defined(_GLFW_HAS_XRANDR)
|
||||
" XRandR"
|
||||
#elif defined(_GLFW_HAS_XF86VIDMODE)
|
||||
" Xf86VidMode"
|
||||
#endif
|
||||
#if defined(_GLFW_HAS_GLXGETPROCADDRESS)
|
||||
" glXGetProcAddress"
|
||||
#elif defined(_GLFW_HAS_GLXGETPROCADDRESSARB)
|
||||
" glXGetProcAddressARB"
|
||||
#elif defined(_GLFW_HAS_GLXGETPROCADDRESSEXT)
|
||||
" glXGetProcAddressEXT"
|
||||
#elif defined(_GLFW_DLOPEN_LIBGL)
|
||||
" dlopen(libGL)"
|
||||
#endif
|
||||
#if defined(_GLFW_USE_LINUX_JOYSTICKS)
|
||||
" Linux joystick API"
|
||||
#endif
|
||||
;
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user