#else
- #if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+ #if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__ODROID__)
#define property _property
#define new _new
#undef String
#endif
-#if defined(__ANDROID__)
+#if defined(__ANDROID__) || defined(__ODROID__)
+
+#define uint _uint
+#define property _property
+#define new _new
+#define class _class
+#define Window X11Window
+#define Cursor X11Cursor
+#define Font X11Font
+#define Display X11Display
+#define Time X11Time
+#define KeyCode X11KeyCode
+#define Picture X11Picture
+#define Bool X11Bool
#include <GLES/gl.h>
#include <EGL/egl.h>
+#undef Bool
+#undef Picture
+#undef Window
+#undef Cursor
+#undef Font
+#undef Display
+#undef Time
+#undef KeyCode
+#undef uint
+#undef new
+#undef property
+#undef class
+
#elif defined(__EMSCRIPTEN__)
#define property _property
#endif
+#if defined(__ODROID__) && !defined(_GLES)
+#define _GLES
+#endif
+
#if defined(__EMSCRIPTEN__)
#define EM_MODE
// #define _GLES
#if defined(__unix__) || defined(__APPLE__)
- #if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+ #if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__ODROID__)
import "XInterface"
#endif
static PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
-#elif defined(__ANDROID__)
+#elif defined(__ANDROID__) || defined(__ODROID__)
#define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
#define GL_RENDERBUFFER GL_RENDERBUFFER_OES
#if defined(_GLES)
// OpenGL ES Porting Kit
-#if defined(__ANDROID__)
+#if defined(__ANDROID__) || defined(__ODROID__)
#define glBindFramebuffer glBindFramebufferOES
#define glBindRenderbuffer glBindRenderbufferOES
#define glFramebufferTexture2D glFramebufferTexture2DOES
#endif
-#if defined(__ANDROID__)
+#if defined(__ANDROID__) || defined(__ODROID__)
static EGLDisplay eglDisplay;
static EGLSurface eglSurface;
static EGLContext eglContext;
static int eglWidth, eglHeight;
+#if defined(__ANDROID__)
static bool egl_init_display(ANativeWindow* window)
+#else
+ static bool egl_init_display(uint window)
+#endif
{
const EGLint attribs[] =
{
#endif
}
-#ifdef __ANDROID__
+#if defined(__ANDROID__) || defined(__ODROID__)
void glClearDepth( double depth ) { glClearDepthf((float)depth); }
void glFogi( unsigned int pname, int param ) { }
void glPolygonMode( unsigned int i, unsigned int j ) { }
#endif
-#if !defined(__APPLE__) && !defined(__WIN32__)
+#if !defined(__APPLE__) && !defined(__WIN32__) && !defined(__ODROID__)
void (APIENTRY * glBindBufferARB) (GLenum target, GLuint buffer);
void (APIENTRY * glGenBuffersARB) (GLsizei n, GLuint *buffers);
void (APIENTRY * glDeleteBuffersARB) (GLsizei n, const GLuint *buffers);
public void GLGenBuffers(int count, GLAB * buffers)
{
-#if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+#if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
glGenBuffers(count, (GLuint *)buffers);
#else
#if defined(__WIN32__)
public void GLDeleteBuffers(int count, GLAB * buffers)
{
-#if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+#if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
glDeleteBuffers(count, (GLuint *)buffers);
#else
#if defined(__WIN32__)
void GLBindBuffer(int target, uint buffer)
{
-#if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+#if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
glBindBuffer(target, buffer);
#else
#if defined(__WIN32__)
else
#endif
-#if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+#if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
glBufferData(target, size, data, usage);
#else
int imageBuffers[2];
byte * pboMemory1, * pboMemory2;
*/
-#elif !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#elif !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__ODROID__)
GLXContext glContext;
Pixmap pixmap;
HDC hdc;
HGLRC glrc;
HWND hwnd;
-#elif !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#elif !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__ODROID__)
XVisualInfo * visualInfo;
GLXContext glContext;
GLXDrawable glxDrawable;
bool LockSystem(DisplaySystem displaySystem)
{
-#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__ODROID__)
OGLSystem oglSystem = displaySystem.driverData;
if(useSingleGLContext) return true;
#if defined(__WIN32__)
wglMakeCurrent(null, null);
#elif defined(__unix__) || defined(__APPLE__)
// printf("Making NULL current\n");
- #if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+ #if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
#else
glXMakeCurrent(xGlobalDisplay, None, null);
#endif
bool Lock(Display display)
{
-#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__ODROID__)
OGLDisplay oglDisplay = display.driverData;
if(useSingleGLContext) return true;
#if defined(__WIN32__)
if(oglDisplay.memBitmap) DeleteObject(oglDisplay.memBitmap);
#elif defined(__unix__) || defined(__APPLE__)
- #if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+ #if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
#else
if(oglDisplay.shapePixmap)
XFreePixmap(xGlobalDisplay, oglDisplay.shapePixmap);
vboAvailable = true;
#if defined(__ANDROID__)
egl_init_display(guiApp.desktop.windowHandle);
+ #elif defined(__ODROID__)
+ egl_init_display((uint)displaySystem.window);
CheckExtensions(oglSystem);
result = true;
#elif defined(__EMSCRIPTEN__)
DestroyWindow(oglSystem.hwnd);
#elif defined(__unix__) || defined(__APPLE__)
- #if defined(__ANDROID__)
+ #if defined(__ANDROID__) || defined(__ODROID__)
egl_term_display();
#elif defined(__EMSCRIPTEN__)
glfwTerminate();
{
bool result = false;
OGLDisplay oglDisplay = display.driverData;
-#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__ODROID__)
OGLSystem oglSystem = display.displaySystem.driverData;
#endif
if(!oglDisplay)
else
ReleaseDC(display.window, oglDisplay.hdc);
#elif defined(__unix__) || defined(__APPLE__)
- #if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+ #if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
#else
XVisualInfo * visualInfo = ((XWindowData)display.windowDriverData).visual;
/*
#if defined(__WIN32__)
wglMakeCurrent(null, null);
#elif defined(__unix__) || defined(__APPLE__)
- #if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+ #if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
result = true;
#else
glXMakeCurrent(xGlobalDisplay, None, null);
#endif
#endif
}
+ else
+ {
+ #if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
+ result = true;
+ #endif
+ }
return result;
}
ReleaseDC(display.window, hdc);
}
#elif defined(__unix__) || defined(__APPLE__)
- #if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+ #if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
result = true;
#else
int attrib[] =
#if defined(__WIN32__)
wglMakeCurrent(oglDisplay.hdc, oglDisplay.glrc);
#elif defined(__unix__) || defined(__APPLE__)
- #if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+ #if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
width = eglWidth;
height = eglHeight;
#else
ReleaseDC(0, hdc);
#elif defined(__unix__) || defined(__APPLE__)
- #if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+ #if defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__ODROID__)
#else
XTransform transform =
{
//wglSwapLayerBuffers(oglDisplay.hdc,WGL_SWAP_MAIN_PLANE);
SwapBuffers(oglDisplay.hdc);
#elif defined(__unix__) || defined(__APPLE__)
- #if defined(__ANDROID__)
+ #if defined(__ANDROID__) || defined(__ODROID__)
eglSwapBuffers(eglDisplay, eglSurface);
#elif defined(__EMSCRIPTEN__)
glfwSwapBuffers();
{
//Logf("SelectMesh\n");
-#if !defined( __ANDROID__) && !defined(__APPLE__) && !defined(__EMSCRIPTEN__)
+#if !defined( __ANDROID__) && !defined(__APPLE__) && !defined(__EMSCRIPTEN__) && !defined(__ODROID__)
#if defined(__WIN32__)
if(glUnlockArraysEXT)
glDisableClientState(GL_COLOR_ARRAY);
}
-#if !defined(__ANDROID__) && !defined(__APPLE__) && !defined(__EMSCRIPTEN__)
+#if !defined(__ANDROID__) && !defined(__APPLE__) && !defined(__EMSCRIPTEN__) && !defined(__ODROID__)
#if defined(__WIN32__)
if(glLockArraysEXT)
#if defined(__WIN32__)
OGLSystem system = displaySystem.driverData;
return system.glrc;
-#elif defined(__ANDROID__)
+#elif defined(__ANDROID__) || defined(__ODROID__)
return eglContext;
#elif defined(__EMSCRIPTEN__)
#else