Initial NaCL support for GLEW - it's not Windows or Linux/X11.

This commit is contained in:
Nigel Stewart 2012-08-16 14:01:11 -05:00
parent 62d2c87d5a
commit 2de0716a46
5 changed files with 11 additions and 9 deletions

View File

@ -188,7 +188,7 @@ $(S.DEST)/glew.c: $(EXT)/.dummy
cat $(SRC)/glew_init_wgl.c >> $@ cat $(SRC)/glew_init_wgl.c >> $@
$(BIN)/make_list.pl $(WGL_EXT_SPEC) >> $@ $(BIN)/make_list.pl $(WGL_EXT_SPEC) >> $@
echo -e "\n return GLEW_OK;\n}" >> $@; echo -e "\n return GLEW_OK;\n}" >> $@;
echo -e "\n#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@ echo -e "\n#elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@
$(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@ $(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@
$(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@ $(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@
echo -e "\n#if !defined(GLEW_MX)" >> $@; echo -e "\n#if !defined(GLEW_MX)" >> $@;
@ -203,7 +203,7 @@ $(S.DEST)/glew.c: $(EXT)/.dummy
$(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@ $(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@
$(BIN)/make_list.pl $(GLX_EXT_SPEC) >> $@ $(BIN)/make_list.pl $(GLX_EXT_SPEC) >> $@
echo -e "\n return GLEW_OK;\n}" >> $@ echo -e "\n return GLEW_OK;\n}" >> $@
echo -e "\n#endif /* !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */\n" >> $@; echo -e "\n#endif /* !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */\n" >> $@;
cat $(SRC)/glew_init_tail.c >> $@ cat $(SRC)/glew_init_tail.c >> $@
cat $(SRC)/glew_str_head.c >> $@ cat $(SRC)/glew_str_head.c >> $@
$(BIN)/make_str.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ $(BIN)/make_str.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
@ -234,7 +234,7 @@ $(S.DEST)/glew_def.c: $(EXT)/.dummy
$(BIN)/make_def_var.pl WGL $(WGL_EXT_SPEC) >> $@ $(BIN)/make_def_var.pl WGL $(WGL_EXT_SPEC) >> $@
echo -e "\n#endif /* _WIN32 */" >> $@ echo -e "\n#endif /* _WIN32 */" >> $@
echo -e "\n#endif /* !GLEW_MX */" >> $@; echo -e "\n#endif /* !GLEW_MX */" >> $@;
echo -e "\n#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@ echo -e "\n#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@
$(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@ $(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@
$(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@ $(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@
echo -e "\n#if !defined(GLEW_MX)" >> $@; echo -e "\n#if !defined(GLEW_MX)" >> $@;
@ -243,7 +243,7 @@ $(S.DEST)/glew_def.c: $(EXT)/.dummy
$(BIN)/make_def_var.pl GLX $(GLX_CORE_SPEC) >> $@ $(BIN)/make_def_var.pl GLX $(GLX_CORE_SPEC) >> $@
$(BIN)/make_def_var.pl GLX $(GLX_EXT_SPEC) >> $@ $(BIN)/make_def_var.pl GLX $(GLX_EXT_SPEC) >> $@
echo -e "\n#endif /* !GLEW_MX */" >> $@; echo -e "\n#endif /* !GLEW_MX */" >> $@;
echo -e "\n#endif /* !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */" >> $@; echo -e "\n#endif /* !defined(_WIN32) && !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */" >> $@;
rm -f $@.bak rm -f $@.bak
$(S.DEST)/glew_init.c: $(EXT)/.dummy $(S.DEST)/glew_init.c: $(EXT)/.dummy

View File

@ -2,7 +2,7 @@
#if defined(_WIN32) #if defined(_WIN32)
# include <GL/wglew.h> # include <GL/wglew.h>
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) #elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
# include <GL/glxew.h> # include <GL/glxew.h>
#endif #endif
@ -135,6 +135,8 @@ void* NSGLGetProcAddress (const GLubyte *name)
# define glewGetProcAddress(name) dlGetProcAddress(name) # define glewGetProcAddress(name) dlGetProcAddress(name)
#elif defined(__ANDROID__) #elif defined(__ANDROID__)
# define glewGetProcAddress(name) NULL /* TODO */ # define glewGetProcAddress(name) NULL /* TODO */
#elif defined(__native_client__)
# define glewGetProcAddress(name) NULL /* TODO */
#else /* __linux */ #else /* __linux */
# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) # define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
#endif #endif

View File

@ -36,7 +36,7 @@ GLboolean glewExperimental = GL_FALSE;
#if defined(_WIN32) #if defined(_WIN32)
extern GLenum GLEWAPIENTRY wglewContextInit (void); extern GLenum GLEWAPIENTRY wglewContextInit (void);
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) #elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
extern GLenum GLEWAPIENTRY glxewContextInit (void); extern GLenum GLEWAPIENTRY glxewContextInit (void);
#endif /* _WIN32 */ #endif /* _WIN32 */
@ -47,7 +47,7 @@ GLenum GLEWAPIENTRY glewInit (void)
if ( r != 0 ) return r; if ( r != 0 ) return r;
#if defined(_WIN32) #if defined(_WIN32)
return wglewContextInit(); return wglewContextInit();
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */ #elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */
return glxewContextInit(); return glxewContextInit();
#else #else
return r; return r;

View File

@ -32,7 +32,7 @@
#include <GL/glew.h> #include <GL/glew.h>
#if defined(_WIN32) #if defined(_WIN32)
# include <GL/wglew.h> # include <GL/wglew.h>
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) #elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
# include <GL/glxew.h> # include <GL/glxew.h>
#endif #endif

View File

@ -35,7 +35,7 @@
#include <GL/glew.h> #include <GL/glew.h>
#if defined(_WIN32) #if defined(_WIN32)
# include <GL/wglew.h> # include <GL/wglew.h>
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) #elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
# include <GL/glxew.h> # include <GL/glxew.h>
#endif #endif