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

A sample which shows how to use frame buffer objects. More...

#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <string>
#include <jni.h>
#include <android/log.h>
#include "FrameBufferObject.h"
#include "Text.h"
#include "Shader.h"
#include "Texture.h"
#include "Matrix.h"
#include "AndroidPlatform.h"

Go to the source code of this file.

Macros

#define FBO_WIDTH   256
 
#define FBO_HEIGHT   256
 

Functions

bool setupGraphics (int width, int height)
 
void renderFrame (void)
 
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_framebufferobject_FrameBufferObject_init (JNIEnv *env, jclass jcls, jint width, jint height)
 
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_framebufferobject_FrameBufferObject_step (JNIEnv *env, jclass jcls)
 
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_framebufferobject_FrameBufferObject_uninit (JNIEnv *, jclass)
 

Variables

string resourceDirectory = "/data/data/com.arm.malideveloper.openglessdk.framebufferobject/"
 
string vertexShaderFilename = "FrameBufferObject_cube.vert"
 
string fragmentShaderFilename = "FrameBufferObject_cube.frag"
 
GLuint vertexShaderID = 0
 
GLuint fragmentShaderID = 0
 
GLuint programID = 0
 
GLint iLocPosition = -1
 
GLint iLocTextureMix = -1
 
GLint iLocTexture = -1
 
GLint iLocFillColor = -1
 
GLint iLocTexCoord = -1
 
GLint iLocProjection = -1
 
GLint iLocModelview = -1
 
static float angleX = 0
 
static float angleY = 0
 
static float angleZ = 0
 
Matrix rotationX
 
Matrix rotationY
 
Matrix rotationZ
 
Matrix translation
 
Matrix modelView
 
Matrix projection
 
Matrix projectionFBO
 
GLuint iFBO = 0
 
GLuint iFBOTex = 0
 
int windowWidth = -1
 
int windowHeight = -1
 
Texttext
 

Detailed Description

A sample which shows how to use frame buffer objects.

A cube is rendered into a frame buffer object rather than to the default frame buffer. This frame buffer object is then used as a texture for another spinning cube.

Definition in file FrameBufferObject.cpp.

Macro Definition Documentation

#define FBO_HEIGHT   256

Definition at line 54 of file FrameBufferObject.cpp.

#define FBO_WIDTH   256

Definition at line 53 of file FrameBufferObject.cpp.

Function Documentation

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

Definition at line 343 of file FrameBufferObject.cpp.

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

Definition at line 353 of file FrameBufferObject.cpp.

JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_framebufferobject_FrameBufferObject_uninit ( JNIEnv *  ,
jclass   
)

Definition at line 359 of file FrameBufferObject.cpp.

void renderFrame ( void  )

Definition at line 234 of file FrameBufferObject.cpp.

bool setupGraphics ( int  width,
int  height 
)

Definition at line 92 of file FrameBufferObject.cpp.

Variable Documentation

float angleX = 0
static

Definition at line 69 of file FrameBufferObject.cpp.

float angleY = 0
static

Definition at line 70 of file FrameBufferObject.cpp.

float angleZ = 0
static

Definition at line 71 of file FrameBufferObject.cpp.

string fragmentShaderFilename = "FrameBufferObject_cube.frag"

Definition at line 51 of file FrameBufferObject.cpp.

GLuint fragmentShaderID = 0

Definition at line 58 of file FrameBufferObject.cpp.

GLuint iFBO = 0

Definition at line 81 of file FrameBufferObject.cpp.

GLuint iFBOTex = 0

Definition at line 84 of file FrameBufferObject.cpp.

GLint iLocFillColor = -1

Definition at line 63 of file FrameBufferObject.cpp.

GLint iLocModelview = -1

Definition at line 66 of file FrameBufferObject.cpp.

GLint iLocPosition = -1

Definition at line 60 of file FrameBufferObject.cpp.

GLint iLocProjection = -1

Definition at line 65 of file FrameBufferObject.cpp.

GLint iLocTexCoord = -1

Definition at line 64 of file FrameBufferObject.cpp.

GLint iLocTexture = -1

Definition at line 62 of file FrameBufferObject.cpp.

GLint iLocTextureMix = -1

Definition at line 61 of file FrameBufferObject.cpp.

Matrix modelView

Definition at line 76 of file FrameBufferObject.cpp.

GLuint programID = 0

Definition at line 59 of file FrameBufferObject.cpp.

Matrix projection

Definition at line 77 of file FrameBufferObject.cpp.

Matrix projectionFBO

Definition at line 78 of file FrameBufferObject.cpp.

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

Definition at line 49 of file FrameBufferObject.cpp.

Matrix rotationX

Definition at line 72 of file FrameBufferObject.cpp.

Matrix rotationY

Definition at line 73 of file FrameBufferObject.cpp.

Matrix rotationZ

Definition at line 74 of file FrameBufferObject.cpp.

Text* text

Definition at line 90 of file FrameBufferObject.cpp.

Matrix translation

Definition at line 75 of file FrameBufferObject.cpp.

string vertexShaderFilename = "FrameBufferObject_cube.vert"

Definition at line 50 of file FrameBufferObject.cpp.

GLuint vertexShaderID = 0

Definition at line 57 of file FrameBufferObject.cpp.

int windowHeight = -1

Definition at line 87 of file FrameBufferObject.cpp.

int windowWidth = -1

Definition at line 86 of file FrameBufferObject.cpp.