Game Development Reference
In-Depth Information
2, 6, 7, 2, 7, 3,
3, 7, 4, 3, 4, 0,
4, 7, 6, 4, 6, 5,
3, 0, 1, 3, 1, 2
};
void Cube_draw()
{
glFrontFace(GL_CW);
glVertexPointer(3, GL_FLOAT, 0, vertices);
glColorPointer(4, GL_FLOAT, 0 , colors);
glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_BYTE, indices);
}
Compiling and Running the Sample
You have the code in place, and now you must compile it. To do so, use the helper scripts agcc and ald
described in Chapter 1, and the Makefile shown in Listing 5-16.
Listing 5-16. Makefile for This Chapter's Example
#############################################
# Android Makefile for CH05
#############################################
# Android source: Contains GL C headers
SYS_DEV = /home/user/mydroid
# Compiler script
CC = agcc
# Linker script
LINKER = ald
# C files
MAIN_OBJS = cuberenderer.o cube.o
# Library name, dynamic executable
LIB = libgltest_jni.so
DYN = gl-dyn
# Compilation flags & libs
INCLUDES = -I$(SYS_DEV)/frameworks/base/opengl/include
CFLAGS = -DNORMALUNIX -DLINUX -DANDROID
LIBS = -lGLES_CM -lui
# Compile the main library (ibgltest_jni.so)
Search WWH ::




Custom Search