| C H A P T E R 6 |
|
OpenGL ES |
JSR 239 defines a Java platform API binding for the industry standard OpenGL® ES API. Your job as porting engineer is to bind the JSR 239 API to the underlying OpenGL ES API for your device.
This porting process is the same regardless of whether you are using the JavaCall API or not. The implementation of JSR 239 in Java Wireless Client software bypasses the JavaCall layer and binds directly to your device's OpenGL ES API.
In most cases, you will be porting to a third-party OpenGL ES engine. Then the only task is to tune the build system to collect together Java Wireless Client software and the third-party engine.
Java Wireless Client software has ready-to-use make files for Hybrid's Gerbera engine (Win32 and Linux x86 platform are supported), nVidia's MX and PowerVR (TI OMAP 2420/2430 boards also known as H4/H5 boards). These files are located in jsr239-com/src/config/sdk.
To integrate a third-party OpenGL ES engine, make the following changes in the makefile, jsr239/src/cldc-oi/config/subsystem.gmk:
1. Add or modify paths to library header files. Here is an example:
SUBSYSTEM_JSR_239_EXTRA_INCLUDES += \
-I$(JSR_239_SDK_DIR)/include
2. Change the path to the directory where library files are located, like this:
JSR_239_LIB_DIR = $(JSR_239_SDK_DIR)/lib/linux
3. Specify the particular names of library files. You may use fully qualified names or specify directory and library names separately.
LIBS += -L$(JSR_239_LIB_DIR) -lGLES_CM
LIBS += $(JSR_239_LIB_DIR)/GLES_CM.lib
4. Make sure that there is no conflict with standard libraries. For example, to assemble the code for Win32 using Visual C++ tool you need to exclude libc to avoid conflicts with msvcrt:
LD_FLAGS += -nodefaultlib:libcmt.lib
Copyright © 2007, Sun Microsystems, Inc. All rights reserved. SUN PROPRIETARY/CONFIDENTIAL.