Added major, minor, and micro version strings

git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@519 783a27ee-832a-0410-bc00-9f386506c6dd
This commit is contained in:
ikits 2007-12-28 00:24:07 +00:00
parent 3f734c5097
commit 2a3114f78f
3 changed files with 13 additions and 1 deletions

View File

@ -210,6 +210,9 @@ $(S.DEST)/glew.c: $(EXT)/.dummy
$(BIN)/make_str.pl $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@ $(BIN)/make_str.pl $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@
cat $(SRC)/glew_str_tail.c >> $@ cat $(SRC)/glew_str_tail.c >> $@
perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@ perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@
perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@
perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@
perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@
perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@ perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@
perl -e "s/\(\(glColorSubTable = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glColorSubTable = /g" -pi $@ perl -e "s/\(\(glColorSubTable = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glColorSubTable = /g" -pi $@
$(BIN)/fix_OML_sync_control.sh $@ $(BIN)/fix_OML_sync_control.sh $@
@ -263,6 +266,9 @@ $(S.DEST)/glew_init.c: $(EXT)/.dummy
echo -e "\n return GLEW_OK;\n}\n\n#endif /* !__APPLE__ || GLEW_APPLE_GLX */\n" >> $@; echo -e "\n return GLEW_OK;\n}\n\n#endif /* !__APPLE__ || GLEW_APPLE_GLX */\n" >> $@;
cat $(SRC)/glew_init_tail.c >> $@ cat $(SRC)/glew_init_tail.c >> $@
perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@ perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@
perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@
perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@
perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@
perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@ perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@
perl -e "s/\(\(glBlendColor = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glBlendColor = /g" -pi $@ perl -e "s/\(\(glBlendColor = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glBlendColor = /g" -pi $@
$(BIN)/fix_OML_sync_control.sh $@ $(BIN)/fix_OML_sync_control.sh $@

View File

@ -19,7 +19,10 @@ const GLubyte* glewGetString (GLenum name)
static const GLubyte* _glewString[] = static const GLubyte* _glewString[] =
{ {
(const GLubyte*)NULL, (const GLubyte*)NULL,
(const GLubyte*)"GLEW_VERSION_STRING" (const GLubyte*)"GLEW_VERSION_STRING",
(const GLubyte*)"GLEW_VERSION_MAJOR_STRING",
(const GLubyte*)"GLEW_VERSION_MINOR_STRING",
(const GLubyte*)"GLEW_VERSION_MICRO_STRING"
}; };
const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
return _glewString[(int)name > max_string ? 0 : (int)name]; return _glewString[(int)name > max_string ? 0 : (int)name];

View File

@ -9,6 +9,9 @@
/* string codes */ /* string codes */
#define GLEW_VERSION 1 #define GLEW_VERSION 1
#define GLEW_VERSION_MAJOR 2
#define GLEW_VERSION_MINOR 3
#define GLEW_VERSION_MICRO 4
/* API */ /* API */
#ifdef GLEW_MX #ifdef GLEW_MX