From af70283f3eb0af4253e067b1501926e99ec21f09 Mon Sep 17 00:00:00 2001 From: Sylvain Beucler Date: Wed, 2 May 2012 17:28:52 +0000 Subject: [PATCH] Implement a few missing enums in fgPlatformGlutDeviceGet/fgPlatformGlutGet git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1284 7f0cb862-5218-0410-a997-914c9d46530a --- src/android/fg_state_android.c | 43 +++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/src/android/fg_state_android.c b/src/android/fg_state_android.c index 6aed163..b011765 100644 --- a/src/android/fg_state_android.c +++ b/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); } -- 1.7.10.4