Added BlackBerry PlayBook support Bug memleak when getting the number of mouse buttons on a non-PlayBook where an appropriate device is found and the value is returned

This commit is contained in:
Rcmaniac25 2013-09-17 01:50:15 -04:00
parent 468e13e958
commit 325873c14e
6 changed files with 128 additions and 22 deletions

View File

@ -269,11 +269,17 @@ IF(ANDROID)
# -llog for native Android logging # -llog for native Android logging
LIST(APPEND LIBS android log) LIST(APPEND LIBS android log)
ELSEIF(BLACKBERRY) ELSEIF(BLACKBERRY)
if(PLAYBOOK)
# -lbps for event loop
# -screen for native screen
LIST(APPEND LIBS bps screen)
ELSE()
# -lbps for event loop # -lbps for event loop
# -lslog2 for logging # -lslog2 for logging
# -screen for native screen # -screen for native screen
LIST(APPEND LIBS bps slog2 screen) LIST(APPEND LIBS bps slog2 screen)
ENDIF() ENDIF()
ENDIF()
INCLUDE(CheckFunctionExists) INCLUDE(CheckFunctionExists)
INCLUDE(CheckTypeSize) INCLUDE(CheckTypeSize)
@ -487,7 +493,11 @@ ELSEIF(FREEGLUT_GLES2)
IF(ANDROID) IF(ANDROID)
SET(PC_LIBS_PRIVATE "-llog -landroid -lGLESv2 -lEGL -lm") SET(PC_LIBS_PRIVATE "-llog -landroid -lGLESv2 -lEGL -lm")
ELSEIF(BLACKBERRY) ELSEIF(BLACKBERRY)
IF(PLAYBOOK)
SET(PC_LIBS_PRIVATE "-lbps -lscreen -lGLESv2 -lEGL -lm")
ELSE()
SET(PC_LIBS_PRIVATE "-lbps -lslog2 -lscreen -lGLESv2 -lEGL -lm") SET(PC_LIBS_PRIVATE "-lbps -lslog2 -lscreen -lGLESv2 -lEGL -lm")
ENDIF()
ELSE() ELSE()
SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGLESv2 -lEGL -lm") SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGLESv2 -lEGL -lm")
ENDIF() ENDIF()
@ -495,7 +505,11 @@ ELSEIF(FREEGLUT_GLES1)
IF(ANDROID) IF(ANDROID)
SET(PC_LIBS_PRIVATE "-llog -landroid -lGLESv1_CM -lEGL -lm") SET(PC_LIBS_PRIVATE "-llog -landroid -lGLESv1_CM -lEGL -lm")
ELSEIF(BLACKBERRY) ELSEIF(BLACKBERRY)
IF(PLAYBOOK)
SET(PC_LIBS_PRIVATE "-lbps -lscreen -lGLESv1_CM -lEGL -lm")
ELSE()
SET(PC_LIBS_PRIVATE "-lbps -lslog2 -lscreen -lGLESv1_CM -lEGL -lm") SET(PC_LIBS_PRIVATE "-lbps -lslog2 -lscreen -lGLESv1_CM -lEGL -lm")
ENDIF()
ELSE() ELSE()
SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGLESv1_CM -lEGL -lm") SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGLESv1_CM -lEGL -lm")
ENDIF() ENDIF()

View File

@ -32,6 +32,11 @@ set( BLACKBERRY_TARGET_ROOT "$ENV{QNX_TARGET}" )
set( CMAKE_SYSTEM_NAME Linux ) set( CMAKE_SYSTEM_NAME Linux )
set( CMAKE_SYSTEM_VERSION 1 ) set( CMAKE_SYSTEM_VERSION 1 )
# Check for PlayBook
if( EXISTS "${BLACKBERRY_TARGET_ROOT}/usr/include" )
set( PLAYBOOK True )
endif()
# STL version: by default gnustl_static will be used # STL version: by default gnustl_static will be used
set( BLACKBERRY_USE_STLPORT FALSE CACHE BOOL "Experimental: use stlport_static instead of gnustl_static") set( BLACKBERRY_USE_STLPORT FALSE CACHE BOOL "Experimental: use stlport_static instead of gnustl_static")
mark_as_advanced( BLACKBERRY_USE_STLPORT ) mark_as_advanced( BLACKBERRY_USE_STLPORT )
@ -91,16 +96,30 @@ else()
endif() endif()
# Includes # Includes
if( PLAYBOOK )
list( APPEND BLACKBERRY_SYSTEM_INCLUDE_DIRS "${BLACKBERRY_TARGET_ROOT}/usr/include" )
else()
list( APPEND BLACKBERRY_SYSTEM_INCLUDE_DIRS "${BLACKBERRY_TARGET_ROOT}/qnx6/usr/include" ) list( APPEND BLACKBERRY_SYSTEM_INCLUDE_DIRS "${BLACKBERRY_TARGET_ROOT}/qnx6/usr/include" )
endif()
# Flags and preprocessor definitions # Flags and preprocessor definitions
if( BLACKBERRY_ARCHITECTURE STREQUAL "arm" ) if( BLACKBERRY_ARCHITECTURE STREQUAL "arm" )
if( PLAYBOOK )
set( BLACKBERRY_CC_FLAGS " -V4.4.2,gcc_ntoarmv7le -D__PLAYBOOK__" )
set( BLACKBERRY_CXX_FLAGS " -V4.4.2,gcc_ntoarmv7le -Y_gpp -D__PLAYBOOK__" )
else()
set( BLACKBERRY_CC_FLAGS " -V4.6.3,gcc_ntoarmv7le -D__QNX__" ) set( BLACKBERRY_CC_FLAGS " -V4.6.3,gcc_ntoarmv7le -D__QNX__" )
set( BLACKBERRY_CXX_FLAGS " -V4.6.3,gcc_ntoarmv7le -Y_gpp -D__QNX__" ) set( BLACKBERRY_CXX_FLAGS " -V4.6.3,gcc_ntoarmv7le -Y_gpp -D__QNX__" )
endif()
else()
if( PLAYBOOK )
set( BLACKBERRY_CC_FLAGS " -V4.4.2,gcc_ntox86 -D__PLAYBOOK__" )
set( BLACKBERRY_CXX_FLAGS " -V4.4.2,gcc_ntox86 -Y_gpp -D__PLAYBOOK__" )
else() else()
set( BLACKBERRY_CC_FLAGS " -V4.6.3,gcc_ntox86 -D__QNX__" ) set( BLACKBERRY_CC_FLAGS " -V4.6.3,gcc_ntox86 -D__QNX__" )
set( BLACKBERRY_CXX_FLAGS " -V4.6.3,gcc_ntox86 -Y_gpp -D__QNX__" ) set( BLACKBERRY_CXX_FLAGS " -V4.6.3,gcc_ntox86 -Y_gpp -D__QNX__" )
endif() endif()
endif()
set( BLACKBERRY 1 ) set( BLACKBERRY 1 )
# NDK flags # NDK flags
@ -131,7 +150,7 @@ set( CMAKE_SHARED_LINKER_FLAGS "" CACHE STRING "linker flags" )
SET( CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "" CACHE STRING "linker flags") SET( CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "" CACHE STRING "linker flags")
SET( CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "" CACHE STRING "linker flags") SET( CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "" CACHE STRING "linker flags")
set( CMAKE_MODULE_LINKER_FLAGS "" CACHE STRING "linker flags" ) set( CMAKE_MODULE_LINKER_FLAGS "" CACHE STRING "linker flags" )
set( CMAKE_EXE_LINKER_FLAGS "-lstdc++ -lm -lEGL -lGLESv2 -lbps -lscreen" CACHE STRING "linker flags" ) set( CMAKE_EXE_LINKER_FLAGS "-lstdc++" CACHE STRING "linker flags" )
# Finish flags # Finish flags
set( BLACKBERRY_CXX_FLAGS "${BLACKBERRY_CXX_FLAGS}" CACHE INTERNAL "Extra BlackBerry compiler flags") set( BLACKBERRY_CXX_FLAGS "${BLACKBERRY_CXX_FLAGS}" CACHE INTERNAL "Extra BlackBerry compiler flags")

View File

@ -31,6 +31,18 @@
#include "fg_internal.h" #include "fg_internal.h"
#include "egl/fg_window_egl.h" #include "egl/fg_window_egl.h"
#ifdef __PLAYBOOK__
#include <sys/slog.h>
#ifdef NDEBUG
#define LOGI(...)
#else
#define LOGI(...) ((void)slogf(1337, _SLOG_INFO, __VA_ARGS__))
#endif
#define LOGW(...) ((void)slogf(1337, _SLOG_WARNING, __VA_ARGS__))
#ifndef SLOG2_FA_SIGNED
#define SLOG2_FA_SIGNED(x) (x)
#endif
#else
#include <slog2.h> #include <slog2.h>
#ifdef NDEBUG #ifdef NDEBUG
#define LOGI(...) #define LOGI(...)
@ -38,6 +50,7 @@
#define LOGI(...) ((void)slog2fa(NULL, 1337, SLOG2_INFO, __VA_ARGS__, SLOG2_FA_END)) #define LOGI(...) ((void)slog2fa(NULL, 1337, SLOG2_INFO, __VA_ARGS__, SLOG2_FA_END))
#endif #endif
#define LOGW(...) ((void)slog2fa(NULL, 1337, SLOG2_WARNING, __VA_ARGS__, SLOG2_FA_END)) #define LOGW(...) ((void)slog2fa(NULL, 1337, SLOG2_WARNING, __VA_ARGS__, SLOG2_FA_END))
#endif
#include <sys/keycodes.h> #include <sys/keycodes.h>
#include <input/screen_helpers.h> #include <input/screen_helpers.h>
#include <bps/bps.h> #include <bps/bps.h>
@ -355,7 +368,11 @@ void fgPlatformProcessSingleEvent ( void )
{ {
mtouch_event_t touchEvent; mtouch_event_t touchEvent;
screen_get_mtouch_event(screenEvent, &touchEvent, 0); screen_get_mtouch_event(screenEvent, &touchEvent, 0);
#ifndef __PLAYBOOK__
screen_get_event_property_iv(screenEvent, SCREEN_PROPERTY_KEY_MODIFIERS, &mod); screen_get_event_property_iv(screenEvent, SCREEN_PROPERTY_KEY_MODIFIERS, &mod);
#else
mod = 0;
#endif
LOGI("fgPlatformProcessSingleEvent: SCREEN_EVENT_MTOUCH_*: Type: 0x%X, X: %d, Y: %d, Contact Id: %d, Mod: 0x%X", SLOG2_FA_SIGNED(eventType), SLOG2_FA_SIGNED(touchEvent.x), SLOG2_FA_SIGNED(touchEvent.y), SLOG2_FA_SIGNED(touchEvent.contact_id), SLOG2_FA_SIGNED(mod)); LOGI("fgPlatformProcessSingleEvent: SCREEN_EVENT_MTOUCH_*: Type: 0x%X, X: %d, Y: %d, Contact Id: %d, Mod: 0x%X", SLOG2_FA_SIGNED(eventType), SLOG2_FA_SIGNED(touchEvent.x), SLOG2_FA_SIGNED(touchEvent.y), SLOG2_FA_SIGNED(touchEvent.contact_id), SLOG2_FA_SIGNED(mod));
@ -397,8 +414,12 @@ void fgPlatformProcessSingleEvent ( void )
// This is a mouse move event, it is applicable to a device with a usb mouse or simulator. // This is a mouse move event, it is applicable to a device with a usb mouse or simulator.
screen_get_event_property_iv(screenEvent, SCREEN_PROPERTY_BUTTONS, &buttons); screen_get_event_property_iv(screenEvent, SCREEN_PROPERTY_BUTTONS, &buttons);
screen_get_event_property_iv(screenEvent, SCREEN_PROPERTY_SOURCE_POSITION, position); screen_get_event_property_iv(screenEvent, SCREEN_PROPERTY_SOURCE_POSITION, position);
#ifndef __PLAYBOOK__
screen_get_event_property_iv(screenEvent, SCREEN_PROPERTY_MOUSE_WHEEL, &wheel); screen_get_event_property_iv(screenEvent, SCREEN_PROPERTY_MOUSE_WHEEL, &wheel);
screen_get_event_property_iv(screenEvent, SCREEN_PROPERTY_KEY_MODIFIERS, &mod); screen_get_event_property_iv(screenEvent, SCREEN_PROPERTY_KEY_MODIFIERS, &mod);
#else
wheel = mod = 0;
#endif
int size[2]; int size[2];
screen_get_window_property_iv(window->Window.Handle, SCREEN_PROPERTY_BUFFER_SIZE, size); screen_get_window_property_iv(window->Window.Handle, SCREEN_PROPERTY_BUFFER_SIZE, size);
@ -552,7 +573,7 @@ void fgPlatformProcessSingleEvent ( void )
break; break;
} }
} else if (domain == navigator_get_domain()) { } else if (domain == navigator_get_domain()) {
int eventType = bps_event_get_code(fgDisplay.pDisplay.event); unsigned int eventType = bps_event_get_code(fgDisplay.pDisplay.event);
switch (eventType) { switch (eventType) {
case NAVIGATOR_WINDOW_STATE: case NAVIGATOR_WINDOW_STATE:
@ -636,6 +657,11 @@ void fgPlatformProcessSingleEvent ( void )
/* Rotate and resize the window */ /* Rotate and resize the window */
fgPlatformRotateWindow(window, navigator_event_get_orientation_angle(fgDisplay.pDisplay.event)); fgPlatformRotateWindow(window, navigator_event_get_orientation_angle(fgDisplay.pDisplay.event));
fgPlatformFlushCommands(); fgPlatformFlushCommands();
#ifdef __PLAYBOOK__
/* PlayBook doesn't indicate what the new size will be, so we need to retrieve it from the window itself */
window->State.pWState.newWidth = glutGet(GLUT_WINDOW_WIDTH);
window->State.pWState.newHeight = glutGet(GLUT_WINDOW_HEIGHT);
#endif
fghOnReshapeNotify(window, window->State.pWState.newWidth, window->State.pWState.newHeight, GL_FALSE); fghOnReshapeNotify(window, window->State.pWState.newWidth, window->State.pWState.newHeight, GL_FALSE);
/* Reset sizes */ /* Reset sizes */
@ -667,6 +693,7 @@ void fgPlatformProcessSingleEvent ( void )
LOGI("fgPlatformProcessSingleEvent: NAVIGATOR_ORIENTATION_DONE/NAVIGATOR_ORIENTATION_RESULT"); LOGI("fgPlatformProcessSingleEvent: NAVIGATOR_ORIENTATION_DONE/NAVIGATOR_ORIENTATION_RESULT");
break; break;
#ifndef __PLAYBOOK__
case NAVIGATOR_KEYBOARD_STATE: case NAVIGATOR_KEYBOARD_STATE:
{ {
LOGI("fgPlatformProcessSingleEvent: NAVIGATOR_KEYBOARD_STATE"); LOGI("fgPlatformProcessSingleEvent: NAVIGATOR_KEYBOARD_STATE");
@ -732,6 +759,7 @@ void fgPlatformProcessSingleEvent ( void )
window->State.pWState.newWidth = navigator_event_get_orientation_size_width(fgDisplay.pDisplay.event); window->State.pWState.newWidth = navigator_event_get_orientation_size_width(fgDisplay.pDisplay.event);
window->State.pWState.newHeight = navigator_event_get_orientation_size_height(fgDisplay.pDisplay.event); window->State.pWState.newHeight = navigator_event_get_orientation_size_height(fgDisplay.pDisplay.event);
break; break;
#endif
case 0: //Doesn't exist in header, but shows up when keyboard shows and resizes case 0: //Doesn't exist in header, but shows up when keyboard shows and resizes
break; break;
@ -741,6 +769,29 @@ void fgPlatformProcessSingleEvent ( void )
break; break;
} }
} }
#ifdef __PLAYBOOK__
else if(domain == virtualkeyboard_get_domain()) {
unsigned int eventType = bps_event_get_code(fgDisplay.pDisplay.event);
switch (eventType) {
case VIRTUALKEYBOARD_EVENT_VISIBLE:
break;
case VIRTUALKEYBOARD_EVENT_HIDDEN:
LOGI("fgPlatformProcessSingleEvent: VIRTUALKEYBOARD_EVENT_HIDDEN");
fgPlatformHandleKeyboardHeight(window, 0);
break;
case VIRTUALKEYBOARD_EVENT_INFO:
LOGI("fgPlatformProcessSingleEvent: VIRTUALKEYBOARD_EVENT_INFO");
fgPlatformHandleKeyboardHeight(window, virtualkeyboard_event_get_height(fgDisplay.pDisplay.event));
break;
default:
LOGW("fgPlatformProcessSingleEvent: unknown virtualkeyboard event: 0x%X", eventType);
break;
}
}
#endif
} while(bps_get_event(&fgDisplay.pDisplay.event, 1) == BPS_SUCCESS && fgDisplay.pDisplay.event != NULL); } while(bps_get_event(&fgDisplay.pDisplay.event, 1) == BPS_SUCCESS && fgDisplay.pDisplay.event != NULL);
/* Reset event to reduce chances of triggering something */ /* Reset event to reduce chances of triggering something */
@ -757,6 +808,11 @@ void fgPlatformMainLoopPreliminaryWork ( void )
/* Allow rotation */ /* Allow rotation */
navigator_rotation_lock(false); navigator_rotation_lock(false);
#ifdef __PLAYBOOK__
/* Request keyboard events */
virtualkeyboard_request_events(0);
#endif
/* Request window events */ /* Request window events */
screen_request_events(fgDisplay.pDisplay.screenContext); screen_request_events(fgDisplay.pDisplay.screenContext);
} }
@ -768,7 +824,9 @@ void fgPlatformMainLoopPostWork ( void )
/* Stop all events */ /* Stop all events */
screen_stop_events(fgDisplay.pDisplay.screenContext); screen_stop_events(fgDisplay.pDisplay.screenContext);
#ifndef __PLAYBOOK__
navigator_stop_events(0); navigator_stop_events(0);
#endif
} }
/* deal with work list items */ /* deal with work list items */

View File

@ -35,8 +35,10 @@
//From fg_state_android.c //From fg_state_android.c
int fgPlatformGlutDeviceGet ( GLenum eWhat ) int fgPlatformGlutDeviceGet ( GLenum eWhat )
{ {
#ifndef __PLAYBOOK__
int deviceCount, i, value; int deviceCount, i, value;
screen_device_t* devices; screen_device_t* devices;
#endif
switch( eWhat ) switch( eWhat )
{ {
@ -51,7 +53,8 @@ int fgPlatformGlutDeviceGet ( GLenum eWhat )
case GLUT_NUM_MOUSE_BUTTONS: case GLUT_NUM_MOUSE_BUTTONS:
/* BlackBerry has a touchscreen, which we can consider a 1-button mouse at min. /* BlackBerry has a touchscreen, which we can consider a 1-button mouse at min.
Otherwise check for an actual mouse, else get max touch points */ Otherwise check for an actual mouse, else get max touch points. PlayBook does not support this. */
#ifndef __PLAYBOOK__
if(!screen_get_context_property_iv(fgDisplay.pDisplay.screenContext, SCREEN_PROPERTY_DEVICE_COUNT, &deviceCount)) { if(!screen_get_context_property_iv(fgDisplay.pDisplay.screenContext, SCREEN_PROPERTY_DEVICE_COUNT, &deviceCount)) {
devices = (screen_device_t*)calloc(deviceCount, sizeof(screen_device_t)); devices = (screen_device_t*)calloc(deviceCount, sizeof(screen_device_t));
if(!screen_get_context_property_pv(fgDisplay.pDisplay.screenContext, SCREEN_PROPERTY_DEVICES, (void**)devices)) { if(!screen_get_context_property_pv(fgDisplay.pDisplay.screenContext, SCREEN_PROPERTY_DEVICES, (void**)devices)) {
@ -60,6 +63,7 @@ int fgPlatformGlutDeviceGet ( GLenum eWhat )
if(!screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_TYPE, &value) && if(!screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_TYPE, &value) &&
value == SCREEN_EVENT_POINTER && value == SCREEN_EVENT_POINTER &&
!screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_BUTTON_COUNT, &value)) { !screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_BUTTON_COUNT, &value)) {
free(devices);
return value; return value;
} }
} }
@ -68,12 +72,14 @@ int fgPlatformGlutDeviceGet ( GLenum eWhat )
if(!screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_TYPE, &value) && if(!screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_TYPE, &value) &&
value == SCREEN_EVENT_MTOUCH_TOUCH && value == SCREEN_EVENT_MTOUCH_TOUCH &&
!screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_MAXIMUM_TOUCH_ID, &value)) { !screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_MAXIMUM_TOUCH_ID, &value)) {
free(devices);
return value; return value;
} }
} }
} }
free(devices); free(devices);
} }
#endif
/* Backup, pretend it's a 1-button mouse */ /* Backup, pretend it's a 1-button mouse */
return 1; return 1;
@ -101,12 +107,14 @@ int fgPlatformGlutGet ( GLenum eWhat )
{ {
if ( fgStructure.CurrentWindow == NULL ) if ( fgStructure.CurrentWindow == NULL )
return 0; return 0;
int size[2]; int size[2];
int orientation; int orientation;
if ( screen_get_window_property_iv(fgStructure.CurrentWindow->Window.Handle, SCREEN_PROPERTY_BUFFER_SIZE, size) != 0 ) if ( screen_get_window_property_iv(fgStructure.CurrentWindow->Window.Handle, SCREEN_PROPERTY_BUFFER_SIZE, size) != 0 )
return 0; return 0;
if ( screen_get_window_property_iv(fgStructure.CurrentWindow->Window.Handle, SCREEN_PROPERTY_ROTATION, &orientation) != 0 ) if ( screen_get_window_property_iv(fgStructure.CurrentWindow->Window.Handle, SCREEN_PROPERTY_ROTATION, &orientation) != 0 )
return 0; return 0;
int orientationDif = abs(orientation - fgStructure.CurrentWindow->State.pWState.originalRotation); int orientationDif = abs(orientation - fgStructure.CurrentWindow->State.pWState.originalRotation);
if (orientationDif == 90 || orientationDif == 270) { if (orientationDif == 90 || orientationDif == 270) {
/* Swap dim. if screen is rotated */ /* Swap dim. if screen is rotated */

View File

@ -32,7 +32,6 @@
#include "fg_internal.h" #include "fg_internal.h"
#include "egl/fg_window_egl.h" #include "egl/fg_window_egl.h"
#include <screen/screen.h> #include <screen/screen.h>
#include <bps/screen.h>
/* /*
* Opens a window. Requires a SFG_Window object created and attached * Opens a window. Requires a SFG_Window object created and attached
@ -65,7 +64,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title,
#elif GL_VERSION_ES_CM_1_0 || GL_VERSION_ES_CL_1_0 || GL_VERSION_ES_CM_1_1 || GL_VERSION_ES_CL_1_1 #elif GL_VERSION_ES_CM_1_0 || GL_VERSION_ES_CL_1_0 || GL_VERSION_ES_CM_1_1 || GL_VERSION_ES_CL_1_1
int screenUsage = SCREEN_USAGE_OPENGL_ES1 | SCREEN_USAGE_ROTATION; int screenUsage = SCREEN_USAGE_OPENGL_ES1 | SCREEN_USAGE_ROTATION;
#endif #endif
#ifndef __X86__ #if !defined(__X86__) && !defined(__PLAYBOOK__)
screenUsage |= SCREEN_USAGE_DISPLAY; // Physical device copy directly into physical display screenUsage |= SCREEN_USAGE_DISPLAY; // Physical device copy directly into physical display
#endif #endif
if (screen_set_window_property_iv(sWindow, SCREEN_PROPERTY_FORMAT, &screenFormat)) { if (screen_set_window_property_iv(sWindow, SCREEN_PROPERTY_FORMAT, &screenFormat)) {

View File

@ -45,7 +45,7 @@
#elif defined (__ANDROID__) #elif defined (__ANDROID__)
# define TARGET_HOST_ANDROID 1 # define TARGET_HOST_ANDROID 1
#elif defined (__QNXNTO__) #elif defined (__QNXNTO__) || defined (__PLAYBOOK__)
# define TARGET_HOST_BLACKBERRY 1 # define TARGET_HOST_BLACKBERRY 1
#elif defined(__posix__) || defined(__unix__) || defined(__linux__) || defined(__sun) #elif defined(__posix__) || defined(__unix__) || defined(__linux__) || defined(__sun)
@ -71,6 +71,14 @@
# define TARGET_HOST_MS_WINDOWS 0 # define TARGET_HOST_MS_WINDOWS 0
#endif #endif
#ifndef TARGET_HOST_ANDROID
# define TARGET_HOST_ANDROID 0
#endif
#ifndef TARGET_HOST_BLACKBERRY
# define TARGET_HOST_BLACKBERRY 0
#endif
#ifndef TARGET_HOST_POSIX_X11 #ifndef TARGET_HOST_POSIX_X11
# define TARGET_HOST_POSIX_X11 0 # define TARGET_HOST_POSIX_X11 0
#endif #endif