Initial commit of BlackBerry implementation. It compiles, but doesn't have required...
authorRcmaniac25 <rcmaniac25@hotmail.com>
Fri, 24 Jan 2014 10:24:23 +0000 (10:24 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Fri, 24 Jan 2014 10:24:23 +0000 (10:24 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1644 7f0cb862-5218-0410-a997-914c9d46530a

AUTHORS
CMakeLists.txt
README.blackberry [new file with mode: 0644]
blackberry.toolchain.cmake [new file with mode: 0644]
src/blackberry/fg_internal_blackberry.h [new file with mode: 0644]
src/blackberry/fg_main_blackberry.h [new file with mode: 0644]
src/fg_internal.h

diff --git a/AUTHORS b/AUTHORS
index 617af75..972e662 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -32,6 +32,9 @@ John Tsiombikas <nuclear@member.fsf.org>
 Sylvain Beucler
     support for Android, X11/EGL, OpenGL(ES) 2.x, misc fixes
 
+Vincent Simonetti
+    support for BlackBerry
+
 Diederick C. Niehorster
 Chris Marshall
 Clive McCarthy
index a3a4fd6..2bc9b2b 100644 (file)
@@ -137,6 +137,11 @@ ELSEIF(ANDROID)
         src/android/fg_structure_android.c
         src/android/fg_window_android.c
     )
+ELSEIF(BLACKBERRY)
+    LIST(APPEND FREEGLUT_SRCS
+        src/blackberry/fg_internal_blackberry.h
+        src/blackberry/fg_main_blackberry.h
+    )
 ELSE()
     LIST(APPEND FREEGLUT_SRCS
         src/x11/fg_cursor_x11.c
@@ -219,14 +224,14 @@ ENDIF()
 
 IF(CMAKE_COMPILER_IS_GNUCC)
   SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
-  IF(!ANDROID)
+  IF(NOT(ANDROID OR BLACKBERRY))
     # not setting -ansi as EGL/KHR headers doesn't support it
     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi")
   ENDIF()
 ENDIF(CMAKE_COMPILER_IS_GNUCC)
 
 INCLUDE(CheckIncludeFiles)
-IF(UNIX AND NOT ANDROID)
+IF(UNIX AND NOT(ANDROID OR BLACKBERRY))
     FIND_PACKAGE(X11 REQUIRED)
     LIST(APPEND LIBS ${X11_LIBRARIES})
     IF(X11_Xrandr_FOUND)
@@ -251,6 +256,8 @@ IF(ANDROID)
     # -landroid for ANativeWindow
     # -llog for native Android logging
     LIST(APPEND LIBS android log)
+ELSEIF(BLACKBERRY)
+    LIST(APPEND LIBS bps slog2)
 ENDIF()
 
 INCLUDE(CheckFunctionExists)
@@ -464,12 +471,16 @@ IF(WIN32)
 ELSEIF(FREEGLUT_GLES2)
   IF(ANDROID)
     SET(PC_LIBS_PRIVATE "-llog -landroid -lGLESv2 -lEGL -lm")
+  ELSEIF(BLACKBERRY)
+    SET(PC_LIBS_PRIVATE "-lbps -lslog2 -lGLESv2 -lEGL -lm")
   ELSE()
     SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGLESv2 -lEGL -lm")
   ENDIF()
 ELSEIF(FREEGLUT_GLES1)
   IF(ANDROID)
     SET(PC_LIBS_PRIVATE "-llog -landroid -lGLESv1_CM -lEGL -lm")
+  ELSEIF(BLACKBERRY)
+    SET(PC_LIBS_PRIVATE "-lbps -lslog2 -lGLESv1_CM -lEGL -lm")
   ELSE()
     SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGLESv1_CM -lEGL -lm")
   ENDIF()
diff --git a/README.blackberry b/README.blackberry
new file mode 100644 (file)
index 0000000..6eac203
--- /dev/null
@@ -0,0 +1,21 @@
+# ------------------------------------------------------------------------------
+#  BlackBerry CMake toolchain file, for use with the BlackBerry 10 NDK 
+#  Requires cmake 2.6.3 or newer (2.8.3 or newer is recommended).
+#
+#  Usage Linux:
+#   $ source /absolute/path/to/the/bbndk/bbndk-env.sh
+#   $ mkdir build
+#   $ cd build
+#   $ cmake .. -DCMAKE_TOOLCHAIN_FILE="../blackberry.toolchain.cmake" -DBLACKBERRY_ARCHITECTURE=arm -DFREEGLUT_GLES2=ON -DFREEGLUT_BUILD_DEMOS=NO -DCMAKE_VERBOSE_MAKEFILE=TRUE -G "Eclipse CDT4 - Unix Makefiles"
+#   $ make -j8
+#
+#  Usage Mac:
+#   Same as the steps on Linux
+#
+#  Usage Windows:
+#   > /absolute/path/to/the/bbndk/bbndk-env.bat
+#   > mkdir build
+#   > cd build
+#   > cmake .. -DCMAKE_TOOLCHAIN_FILE="../blackberry.toolchain.cmake" -DBLACKBERRY_ARCHITECTURE=arm -DFREEGLUT_GLES2=ON -DFREEGLUT_BUILD_DEMOS=NO -DCMAKE_VERBOSE_MAKEFILE=TRUE -G "Eclipse CDT4 - Unix Makefiles"
+#   > make -j8
+#
\ No newline at end of file
diff --git a/blackberry.toolchain.cmake b/blackberry.toolchain.cmake
new file mode 100644 (file)
index 0000000..4c9d264
--- /dev/null
@@ -0,0 +1,196 @@
+# ------------------------------------------------------------------------------
+#  BlackBerry CMake toolchain file, for use with the BlackBerry 10 NDK 
+#  Requires cmake 2.6.3 or newer (2.8.3 or newer is recommended).
+#
+#  Usage Linux:
+#   $ source /absolute/path/to/the/bbndk/bbndk-env.sh
+#   $ mkdir build
+#   $ cd build
+#   $ cmake .. -DCMAKE_TOOLCHAIN_FILE="../blackberry.toolchain.cmake" -DBLACKBERRY_ARCHITECTURE=arm -DFREEGLUT_GLES2=ON -DFREEGLUT_BUILD_DEMOS=NO -DCMAKE_VERBOSE_MAKEFILE=TRUE -G "Eclipse CDT4 - Unix Makefiles"
+#   $ make -j8
+#
+#  Usage Mac:
+#   Same as the steps on Linux
+#
+#  Usage Windows:
+#   > /absolute/path/to/the/bbndk/bbndk-env.bat
+#   > mkdir build
+#   > cd build
+#   > cmake .. -DCMAKE_TOOLCHAIN_FILE="../blackberry.toolchain.cmake" -DBLACKBERRY_ARCHITECTURE=arm -DFREEGLUT_GLES2=ON -DFREEGLUT_BUILD_DEMOS=NO -DCMAKE_VERBOSE_MAKEFILE=TRUE -G "Eclipse CDT4 - Unix Makefiles"
+#   > make -j8
+#
+
+cmake_minimum_required( VERSION 2.6.3 )
+
+if( DEFINED CMAKE_CROSSCOMPILING )
+  # Subsequent toolchain loading is not really needed
+  return()
+endif()
+
+set( BLACKBERRY_TOOLCHAIN_ROOT "$ENV{QNX_HOST}" )
+set( BLACKBERRY_TARGET_ROOT "$ENV{QNX_TARGET}" )
+set( CMAKE_SYSTEM_NAME Linux )
+set( CMAKE_SYSTEM_VERSION 1 )
+
+# STL version: by default gnustl_static will be used
+set( BLACKBERRY_USE_STLPORT FALSE CACHE BOOL "Experimental: use stlport_static instead of gnustl_static")
+mark_as_advanced( BLACKBERRY_USE_STLPORT )
+
+# Detect host platform
+set( TOOL_OS_SUFFIX "" )
+if( CMAKE_HOST_APPLE )
+ set( BLACKBERRY_NDK_HOST_SYSTEM_NAME "darwin-x86" )
+elseif( CMAKE_HOST_WIN32 )
+ set( BLACKBERRY_NDK_HOST_SYSTEM_NAME "windows" )
+ set( TOOL_OS_SUFFIX ".exe" )
+elseif( CMAKE_HOST_UNIX )
+ set(BLACKBERRY_NDK_HOST_SYSTEM_NAME "linux-x86" )
+else()
+ message( FATAL_ERROR "Cross-compilation on your platform is not supported by this cmake toolchain" )
+endif()
+
+# Specify the cross compiler
+set( CMAKE_C_COMPILER   "$ENV{QNX_HOST}/usr/bin/qcc${TOOL_OS_SUFFIX}"                CACHE PATH "gcc" )
+set( CMAKE_CXX_COMPILER "$ENV{QNX_HOST}/usr/bin/qcc${TOOL_OS_SUFFIX}"                CACHE PATH "g++" )
+set( CMAKE_ASM_COMPILER "$ENV{QNX_HOST}/usr/bin/qcc${TOOL_OS_SUFFIX}"                CACHE PATH "Assembler" )
+if( CMAKE_VERSION VERSION_LESS 2.8.5 )
+ set( CMAKE_ASM_COMPILER_ARG1 "-c" )
+endif()
+
+# There may be a way to make cmake reduce these TODO
+if( BLACKBERRY_ARCHITECTURE STREQUAL "arm" )
+ set( NEUTRINO_ARCH "v7" )
+else()
+ set( NEUTRINO_ARCH "" )
+endif()
+set( CMAKE_STRIP        "$ENV{QNX_HOST}/usr/bin/nto${BLACKBERRY_ARCHITECTURE}-strip${TOOL_OS_SUFFIX}"       CACHE PATH "strip" )
+set( CMAKE_AR           "$ENV{QNX_HOST}/usr/bin/nto${BLACKBERRY_ARCHITECTURE}-ar${TOOL_OS_SUFFIX}"          CACHE PATH "archive" )
+set( CMAKE_LINKER       "$ENV{QNX_HOST}/usr/bin/nto${BLACKBERRY_ARCHITECTURE}${NEUTRINO_ARCH}-ld${TOOL_OS_SUFFIX}"        CACHE PATH "linker" )
+set( CMAKE_NM           "$ENV{QNX_HOST}/usr/bin/nto${BLACKBERRY_ARCHITECTURE}${NEUTRINO_ARCH}-nm${TOOL_OS_SUFFIX}"        CACHE PATH "nm" )
+set( CMAKE_OBJCOPY      "$ENV{QNX_HOST}/usr/bin/nto${BLACKBERRY_ARCHITECTURE}${NEUTRINO_ARCH}-objcopy${TOOL_OS_SUFFIX}"   CACHE PATH "objcopy" )
+set( CMAKE_OBJDUMP      "$ENV{QNX_HOST}/usr/bin/nto${BLACKBERRY_ARCHITECTURE}${NEUTRINO_ARCH}-objdump${TOOL_OS_SUFFIX}"   CACHE PATH "objdump" )
+set( CMAKE_RANLIB       "$ENV{QNX_HOST}/usr/bin/nto${BLACKBERRY_ARCHITECTURE}-ranlib${TOOL_OS_SUFFIX}"      CACHE PATH "ranlib" )
+
+# Installer
+#if( APPLE )
+# find_program( CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool )
+# if( NOT CMAKE_INSTALL_NAME_TOOL )
+#  message( FATAL_ERROR "Could not find install_name_tool, please check your #installation." )
+# endif()
+# mark_as_advanced( CMAKE_INSTALL_NAME_TOOL )
+# endif()
+
+# Setup output directories
+set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR}                                       CACHE PATH "root for library output, set this to change where android libs are installed to" )
+set( CMAKE_INSTALL_PREFIX "${BLACKBERRY_TOOLCHAIN_ROOT}/user"                           CACHE STRING "path for installing" )
+
+if( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
+ set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}"  CACHE PATH "Output directory for applications" )
+else()
+ set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin"                          CACHE PATH "Output directory for applications" )
+endif()
+
+# Includes
+list( APPEND BLACKBERRY_SYSTEM_INCLUDE_DIRS "${BLACKBERRY_TARGET_ROOT}/qnx6/usr/include" )
+
+# Flags and preprocessor definitions
+if( BLACKBERRY_ARCHITECTURE STREQUAL "arm" )
+ set( BLACKBERRY_CC_FLAGS  " -V4.6.3,gcc_ntoarmv7le -D__QNX__" )
+ set( BLACKBERRY_CXX_FLAGS " -V4.6.3,gcc_ntoarmv7le -Y_gpp -D__QNX__" )
+else()
+ set( BLACKBERRY_CC_FLAGS  " -V4.6.3,gcc_ntox86 -D__QNX__" )
+ set( BLACKBERRY_CXX_FLAGS " -V4.6.3,gcc_ntox86 -Y_gpp -D__QNX__" )
+endif()
+set( BLACKBERRY 1 )
+
+# NDK flags
+set( CMAKE_CXX_FLAGS "${BLACKBERRY_CXX_FLAGS}" )
+set( CMAKE_C_FLAGS "${BLACKBERRY_CC_FLAGS}" )
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions" )
+set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions" )
+
+# Release and Debug flags
+if( BLACKBERRY_ARCHITECTURE STREQUAL "arm" )
+ set( CMAKE_CXX_FLAGS_RELEASE "-mthumb -O3" )
+ set( CMAKE_C_FLAGS_RELEASE   "-mthumb -O3" )
+ set( CMAKE_CXX_FLAGS_DEBUG   "-marm -Os -finline-limit=64" )
+ set( CMAKE_C_FLAGS_DEBUG     "-marm -Os -finline-limit=64" )
+else()
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i486" )
+ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i486" )
+endif()
+
+# Cache flags
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags" )
+set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags" )
+set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "c++ Release flags" )
+set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "c Release flags" )
+set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING "c++ Debug flags" )
+set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}" CACHE STRING "c Debug flags" )
+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_C_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" )
+
+# Finish flags
+set( BLACKBERRY_CXX_FLAGS    "${BLACKBERRY_CXX_FLAGS}"    CACHE INTERNAL "Extra BlackBerry compiler flags")
+set( BLACKBERRY_LINKER_FLAGS "${BLACKBERRY_LINKER_FLAGS}" CACHE INTERNAL "Extra BlackBerry linker flags")
+set( CMAKE_CXX_FLAGS  "${BLACKBERRY_CXX_FLAGS} ${CMAKE_CXX_FLAGS}" )
+set( CMAKE_C_FLAGS    "${BLACKBERRY_CXX_FLAGS} ${CMAKE_C_FLAGS}" )
+
+# Global flags for cmake client scripts to change behavior
+set( BLACKBERRY True )
+# Find the Target environment 
+set( CMAKE_FIND_ROOT_PATH "${CMAKE_SOURCE_DIR}" "${BLACKBERRY_TARGET_ROOT}"  "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" )
+# Search for libraries and includes in the ndk toolchain
+set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+
+# Macro to find packages on the host OS
+macro( find_host_package )
+ set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
+ set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER )
+ set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER )
+ if( CMAKE_HOST_WIN32 )
+  SET( WIN32 1 )
+  SET( UNIX )
+ elseif( CMAKE_HOST_APPLE )
+  SET( APPLE 1 )
+  SET( UNIX )
+ endif()
+ find_package( ${ARGN} )
+ SET( WIN32 )
+ SET( APPLE )
+ SET( UNIX 1 )
+ set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
+ set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
+ set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+endmacro()
+
+# Macro to find programs on the host OS
+macro( find_host_program )
+ set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
+ set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER )
+ set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER )
+ if( CMAKE_HOST_WIN32 )
+  SET( WIN32 1 )
+  SET( UNIX )
+ elseif( CMAKE_HOST_APPLE )
+  SET( APPLE 1 )
+  SET( UNIX )
+ endif()
+ find_program( ${ARGN} )
+ SET( WIN32 )
+ SET( APPLE )
+ SET( UNIX 1 )
+ set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
+ set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
+ set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+endmacro()
+
+# We are doing cross compiling, reset the OS information of the Building system
+UNSET( APPLE )
+UNSET( WIN32 )
+UNSET( UNIX )
diff --git a/src/blackberry/fg_internal_blackberry.h b/src/blackberry/fg_internal_blackberry.h
new file mode 100644 (file)
index 0000000..0223144
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * fg_internal_blackberry.h
+ *
+ * The freeglut library private include file.
+ *
+ * Copyright (C) 2012  Sylvain Beucler
+ * Copyright (C) 2013  Vincent Simonetti
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef  FREEGLUT_INTERNAL_BLACKBERRY_H
+#define  FREEGLUT_INTERNAL_BLACKBERRY_H
+
+//Minor modified version of fg_internal_android.h
+
+/* -- PLATFORM-SPECIFIC INCLUDES ------------------------------------------- */
+/* BlackBerry OpenGL ES is accessed through EGL */
+#include "egl/fg_internal_egl.h"
+
+/* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */
+/* The structure used by display initialization in freeglut_init.c */
+typedef struct tagSFG_PlatformDisplay SFG_PlatformDisplay;
+struct tagSFG_PlatformDisplay
+{
+  struct tagSFG_PlatformDisplayEGL egl;
+  EGLNativeWindowType single_native_window;
+};
+
+typedef struct tagSFG_PlatformContext SFG_PlatformContext;
+/* SFG_PlatformContext is used for SFG_Window.Window */
+struct tagSFG_PlatformContext
+{
+  struct tagSFG_PlatformContextEGL egl;
+};
+
+
+/**
+ * Virtual PAD (spots on touchscreen that simulate keys)
+ */
+struct vpad_state {
+    bool on;
+    bool left;
+    bool right;
+    bool up;
+    bool down;
+};
+struct touchscreen {
+    struct vpad_state vpad;
+    bool in_mmotion;
+};
+
+
+/* -- JOYSTICK-SPECIFIC STRUCTURES AND TYPES ------------------------------- */
+/*
+ * Initial defines from "js.h" starting around line 33 with the existing "freeglut_joystick.c"
+ * interspersed
+ */
+
+  /*
+   * We'll put these values in and that should
+   * allow the code to at least compile when there is
+   * no support. The JS open routine should error out
+   * and shut off all the code downstream anyway and if
+   * the application doesn't use a joystick we'll be fine.
+   */
+
+  struct JS_DATA_TYPE
+  {
+    int buttons;
+    int x;
+    int y;
+  };
+
+#            define JS_RETURN (sizeof(struct JS_DATA_TYPE))
+
+/* XXX It might be better to poll the operating system for the numbers of buttons and
+ * XXX axes and then dynamically allocate the arrays.
+ */
+#    define _JS_MAX_AXES 16
+typedef struct tagSFG_PlatformJoystick SFG_PlatformJoystick;
+struct tagSFG_PlatformJoystick
+{
+       struct JS_DATA_TYPE js;
+
+    char         fname [ 128 ];
+    int          fd;
+};
+
+/* Window's state description. This structure should be kept portable. */
+typedef struct tagSFG_PlatformWindowState SFG_PlatformWindowState;
+struct tagSFG_PlatformWindowState
+{
+    char unused;
+};
+
+/* Menu font and color definitions */
+#define  FREEGLUT_MENU_FONT    NULL
+
+#define  FREEGLUT_MENU_PEN_FORE_COLORS   {0.0f,  0.0f,  0.0f,  1.0f}
+#define  FREEGLUT_MENU_PEN_BACK_COLORS   {0.70f, 0.70f, 0.70f, 1.0f}
+#define  FREEGLUT_MENU_PEN_HFORE_COLORS  {0.0f,  0.0f,  0.0f,  1.0f}
+#define  FREEGLUT_MENU_PEN_HBACK_COLORS  {1.0f,  1.0f,  1.0f,  1.0f}
+
+#endif  /* FREEGLUT_INTERNAL_BLACKBERRY_H */
diff --git a/src/blackberry/fg_main_blackberry.h b/src/blackberry/fg_main_blackberry.h
new file mode 100644 (file)
index 0000000..8febf36
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * fg_main_blackberry.h
+ *
+ * The BlackBerry-specific windows message processing methods.
+ *
+ * Copyright (C) 2013  Vincent Simonetti
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __FG_MAIN_BLACKBERRY_H__
+#define __FG_MAIN_BLACKBERRY_H__
+
+#include <GL/freeglut.h>
+#include "fg_internal.h"
+
+/*extern void fgPlatformProcessSingleEvent(void);
+extern unsigned long fgPlatformSystemTime(void);
+extern void fgPlatformSleepForEvents(long msec);
+extern void fgPlatformMainLoopPreliminaryWork(void);*/
+
+#endif
index 645c82f..4792ad8 100644 (file)
@@ -45,6 +45,9 @@
 #elif defined (__ANDROID__)
 #   define  TARGET_HOST_ANDROID  1
 
+#elif defined (__QNX__)
+#   define  TARGET_HOST_BLACKBERRY  1
+
 #elif defined(__posix__) || defined(__unix__) || defined(__linux__) || defined(__sun)
 #   define  TARGET_HOST_POSIX_X11  1
 
 #if TARGET_HOST_ANDROID
 #include "android/fg_internal_android.h"
 #endif
+#if TARGET_HOST_BLACKBERRY
+#include "blackberry/fg_internal_blackberry.h"
+#endif
 
 
 /* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */
@@ -372,7 +378,7 @@ struct tagSFG_Context
 
     int             DoubleBuffered;  /* Treat the window as double-buffered */
 
-    /* When drawing geometry to vertex attribute buffers, user specifies 
+    /* When drawing geometry to vertex attribute buffers, user specifies
      * the attribute indices for vertices, normals and/or texture coords
      * to freeglut. Those are stored here
      */