diff --git a/examples/common/entry_android.cpp b/examples/common/entry_android.cpp new file mode 100644 index 00000000..c8e7ce17 --- /dev/null +++ b/examples/common/entry_android.cpp @@ -0,0 +1,45 @@ +/* + * Copyright 2011-2013 Branimir Karadzic. All rights reserved. + * License: http://www.opensource.org/licenses/BSD-2-Clause + */ + +#include + +#if BX_PLATFORM_ANDROID + +#include +#include "entry.h" + +namespace entry +{ + const Event* poll() + { + return NULL; + } + + void release(const Event* _event) + { + } + + void setWindowSize(uint32_t _width, uint32_t _height) + { + } + + void toggleWindowFrame() + { + } + + void setMouseLock(bool _lock) + { + } + +} // namespace entry + +extern int _main_(int _argc, char** _argv); + +int main(int _argc, char** _argv) +{ + _main_(_argc, _argv); +} + +#endif // BX_PLATFORM_ANDROID diff --git a/include/bgfxplatform.h b/include/bgfxplatform.h index 3717670a..f90aacb7 100755 --- a/include/bgfxplatform.h +++ b/include/bgfxplatform.h @@ -12,7 +12,15 @@ #include -#if BX_PLATFORM_LINUX +#if BX_PLATFORM_ANDROID +struct android_app; + +namespace bgfx +{ + androidSetAndroidApp(struct android_app* _app); +} // namespace bgfx + +#elif BX_PLATFORM_LINUX # include namespace bgfx diff --git a/makefile b/makefile index 3af62430..1d1ae251 100755 --- a/makefile +++ b/makefile @@ -6,17 +6,30 @@ all: premake4 --file=premake/premake4.lua vs2008 premake4 --file=premake/premake4.lua vs2010 + premake4 --file=premake/premake4.lua --gcc=android-arm gmake + premake4 --file=premake/premake4.lua --gcc=emscripten gmake premake4 --file=premake/premake4.lua --gcc=nacl gmake premake4 --file=premake/premake4.lua --gcc=nacl-arm gmake premake4 --file=premake/premake4.lua --gcc=pnacl gmake premake4 --file=premake/premake4.lua --gcc=mingw gmake premake4 --file=premake/premake4.lua --gcc=linux gmake - premake4 --file=premake/premake4.lua --gcc=emscripten gmake premake4 --file=premake/premake4.lua --gcc=osx gmake premake4 --file=premake/premake4.lua --gcc=qnx-arm gmake premake4 --file=premake/premake4.lua xcode4 make -s --no-print-directory -C src +android-arm-debug: + make -R -C .build/projects/gmake-android-arm config=debug +android-arm-release: + make -R -C .build/projects/gmake-android-arm config=release +android-arm: android-arm-debug android-arm-release + +emscripten-debug: + make -R -C .build/projects/gmake-emscripten config=debug +emscripten-arm-release: + make -R -C .build/projects/gmake-emscripten config=release +emscripten-arm: emscripten-arm-debug emscripten-arm-release + linux-debug32: make -R -C .build/projects/gmake-linux config=debug32 linux-release32: diff --git a/src/renderer_gl.h b/src/renderer_gl.h index e7556680..b5a7d016 100755 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -86,7 +86,7 @@ # include # endif // BGFX_CONFIG_RENDERER_ -# if BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_WINDOWS || BX_PLATFORM_QNX +# if BX_PLATFORM_ANDROID || BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_WINDOWS || BX_PLATFORM_QNX # undef BGFX_USE_EGL # define BGFX_USE_EGL 1 # include "glcontext_egl.h" @@ -108,10 +108,18 @@ typedef void (*PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC)(GLuint shader, GLsizei b # define GL_BGRA_EXT 0x80E1 # endif // GL_BGRA_EXT +# ifndef GL_R16F_EXT +# define GL_R16F_EXT 0x822D +# endif // GL_R16F_EXT + # ifndef GL_R32F_EXT # define GL_R32F_EXT 0x822E # endif // GL_R32F_EXT +# ifndef GL_RGB10_A2_EXT +# define GL_RGB10_A2_EXT 0x8059 +# endif // GL_RGB10_A2_EXT + # ifndef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT # define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 # endif // GL_COMPRESSED_RGBA_S3TC_DXT1_EXT