OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Triangle.cpp File Reference

A sample which shows how to draw a simple triangle to the screen. More...

#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <jni.h>
#include <android/log.h>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include "AndroidPlatform.h"
#include "Triangle.h"
#include "Text.h"
#include "Shader.h"
#include "Timer.h"

Go to the source code of this file.

Functions

bool setupGraphics (int width, int height)
 
void renderFrame (void)
 
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_triangle_Triangle_init (JNIEnv *env, jclass jcls, jint width, jint height)
 
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_triangle_Triangle_step (JNIEnv *env, jclass jcls)
 
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_triangle_Triangle_uninit (JNIEnv *, jclass)
 

Variables

string resourceDirectory = "/data/data/com.arm.malideveloper.openglessdk.triangle/"
 
string vertexShaderFilename = "Triangle_triangle.vert"
 
string fragmentShaderFilename = "Triangle_triangle.frag"
 
GLuint programID
 
GLint iLocPosition = -1
 
GLint iLocFillColor = -1
 
Texttext
 

Detailed Description

A sample which shows how to draw a simple triangle to the screen.

Uses a simple shader to fill the the triangle with a gradient color.

Definition in file Triangle.cpp.

Function Documentation

JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_triangle_Triangle_init ( JNIEnv *  env,
jclass  jcls,
jint  width,
jint  height 
)

Definition at line 145 of file Triangle.cpp.

JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_triangle_Triangle_step ( JNIEnv *  env,
jclass  jcls 
)

Definition at line 155 of file Triangle.cpp.

JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_triangle_Triangle_uninit ( JNIEnv *  ,
jclass   
)

Definition at line 161 of file Triangle.cpp.

void renderFrame ( void  )

Definition at line 118 of file Triangle.cpp.

bool setupGraphics ( int  width,
int  height 
)

Definition at line 60 of file Triangle.cpp.

Variable Documentation

string fragmentShaderFilename = "Triangle_triangle.frag"

Definition at line 50 of file Triangle.cpp.

GLint iLocFillColor = -1

Definition at line 55 of file Triangle.cpp.

GLint iLocPosition = -1

Definition at line 54 of file Triangle.cpp.

GLuint programID

Definition at line 53 of file Triangle.cpp.

string resourceDirectory = "/data/data/com.arm.malideveloper.openglessdk.triangle/"

Definition at line 48 of file Triangle.cpp.

Text* text

Definition at line 58 of file Triangle.cpp.

string vertexShaderFilename = "Triangle_triangle.vert"

Definition at line 49 of file Triangle.cpp.