From 528e86758739d7c46328a93418e2a4d3807eb030 Mon Sep 17 00:00:00 2001 From: beuc Date: Wed, 2 May 2012 17:28:52 +0000 Subject: [PATCH] Implement a few missing enums in fgPlatformGlutDeviceGet/fgPlatformGlutGet git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1284 7f0cb862-5218-0410-a997-914c9d46530a --- .../freeglut/src/android/fg_state_android.c | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/freeglut/freeglut/src/android/fg_state_android.c b/freeglut/freeglut/src/android/fg_state_android.c index 6aed163..b011765 100644 --- a/freeglut/freeglut/src/android/fg_state_android.c +++ b/freeglut/freeglut/src/android/fg_state_android.c @@ -33,15 +33,43 @@ int fgPlatformGlutDeviceGet ( GLenum eWhat ) { - fprintf(stderr, "fgPlatformGlutDeviceGet: STUB\n"); - return -1; + switch( eWhat ) + { + case GLUT_HAS_KEYBOARD: + /* Android has a keyboard, though it may be virtual. */ + return 1; + + case GLUT_HAS_MOUSE: + /* Android has a touchscreen; until we get proper touchscreen + support, consider it as a mouse. */ + return 1 ; + + case GLUT_NUM_MOUSE_BUTTONS: + /* Android has a touchscreen; until we get proper touchscreen + support, consider it as a 1-button mouse. */ + return 1; + + default: + fgWarning( "glutDeviceGet(): missing enum handle %d", eWhat ); + break; + } + + /* And now -- the failure. */ + return -1; } int fgPlatformGlutGet ( GLenum eWhat ) { - fprintf(stderr, "fgPlatformGlutGet: STUB\n"); - switch (eWhat) { + /* One full-screen window only */ + case GLUT_WINDOW_X: + case GLUT_WINDOW_Y: + return 0; + case GLUT_WINDOW_BORDER_WIDTH: + return fgPlatformGlutGet(GLUT_WINDOW_WIDTH); + case GLUT_WINDOW_HEADER_HEIGHT: + return fgPlatformGlutGet(GLUT_WINDOW_HEIGHT); + case GLUT_WINDOW_WIDTH: case GLUT_WINDOW_HEIGHT: { @@ -57,7 +85,12 @@ int fgPlatformGlutGet ( GLenum eWhat ) return height; } } - + + case GLUT_WINDOW_COLORMAP_SIZE: + /* 0 for RGBA/non-indexed mode */ + /* Under Android and GLES more generally, no indexed-mode */ + return 0; + default: return fghPlatformGlutGetEGL(eWhat); }