OpenGL ES SDK for Android
ARM Developer Center
|
Demonstration of ETC2 texture compression support in OpenGL ES 3.0. More...
#include <jni.h>
#include <android/log.h>
#include <GLES3/gl3.h>
#include "Common.h"
#include "ETCHeader.h"
#include "EtcTexture.h"
#include "Matrix.h"
#include "Shader.h"
#include "Text.h"
#include "Texture.h"
#include "Timer.h"
Go to the source code of this file.
Classes | |
struct | Image |
Functions | |
void | initializeTexture (int textureIndex) |
void | setupTextures () |
void | draw () |
void | setupGraphics (int width, int height) |
void | renderFrame (void) |
void | uninit () |
JNIEXPORT void JNICALL | Java_com_arm_malideveloper_openglessdk_etcTexture_NativeLibrary_init (JNIEnv *env, jobject obj, jint width, jint height) |
JNIEXPORT void JNICALL | Java_com_arm_malideveloper_openglessdk_etcTexture_NativeLibrary_step (JNIEnv *env, jobject obj) |
JNIEXPORT void JNICALL | Java_com_arm_malideveloper_openglessdk_etcTexture_NativeLibrary_uninit (JNIEnv *env, jobject obj) |
Variables | |
Image | image0 |
Image | image1 |
Image | image2 |
Image | image3 |
Image | image4 |
Image | image5 |
Image | image6 |
Image | image7 |
Image | image8 |
Image | image9 |
Image | imageArray [] |
GLuint | bufferObjectIds [2] = {0} |
GLuint | currentAssetIndex = 0 |
const float | displayInterval = 5.0f |
GLuint | fragmentShaderId = 0 |
Text * | internalformatTextDisplayer = NULL |
GLint | modelViewMatrixLocation = 0 |
const int | numberOfTextures = sizeof(imageArray) / sizeof(imageArray[0]) |
GLint | positionLocation = 0 |
GLuint | programId = 0 |
float | scalingFactor = 0.75f |
GLint | textureCoordinateLocation = 0 |
GLint | textureLocation = 0 |
Timer | timer |
int | windowHeight = 0 |
int | windowWidth = 0 |
GLuint | vertexShaderId = 0 |
GLuint | vertexArrayId = 0 |
float | vertexData [] |
float | textureCoordinatesData [] |
Demonstration of ETC2 texture compression support in OpenGL ES 3.0.
Compressed textures are loaded and displayed on the screen. The internal format of each texture is displayed at the bottom of the screen. The application cycles through all of the texture formats supported by OpenGL ES 3.0.
Formats:
Definition in file Native.cpp.
Draw image and text into back buffer.
Definition at line 267 of file Native.cpp.
Generate and fill texture objects with data.
textureIndex | holds index of an imageArray (indicates which texture is to be created). |
Definition at line 169 of file Native.cpp.
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_etcTexture_NativeLibrary_init | ( | JNIEnv * | env, |
jobject | obj, | ||
jint | width, | ||
jint | height | ||
) |
Definition at line 471 of file Native.cpp.
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_etcTexture_NativeLibrary_step | ( | JNIEnv * | env, |
jobject | obj | ||
) |
Definition at line 484 of file Native.cpp.
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_etcTexture_NativeLibrary_uninit | ( | JNIEnv * | env, |
jobject | obj | ||
) |
Definition at line 477 of file Native.cpp.
Render new frame's contents into back buffer.
Definition at line 416 of file Native.cpp.
Create program that will be used to rasterize the geometry.
Definition at line 300 of file Native.cpp.
void setupTextures | ( | ) |
Initializes data used for rendering.
Definition at line 224 of file Native.cpp.
void uninit | ( | ) |
Definition at line 441 of file Native.cpp.
GLuint bufferObjectIds[2] = {0} |
Definition at line 129 of file Native.cpp.
GLuint currentAssetIndex = 0 |
Definition at line 130 of file Native.cpp.
const float displayInterval = 5.0f |
Definition at line 131 of file Native.cpp.
GLuint fragmentShaderId = 0 |
Definition at line 132 of file Native.cpp.
Image image0 |
Definition at line 76 of file Native.cpp.
Image image1 |
Definition at line 80 of file Native.cpp.
Image image2 |
Definition at line 84 of file Native.cpp.
Image image3 |
Definition at line 88 of file Native.cpp.
Image image4 |
Definition at line 92 of file Native.cpp.
Image image5 |
Definition at line 96 of file Native.cpp.
Image image6 |
Definition at line 100 of file Native.cpp.
Image image7 |
Definition at line 104 of file Native.cpp.
Image image8 |
Definition at line 108 of file Native.cpp.
Image image9 |
Definition at line 112 of file Native.cpp.
Image imageArray[] |
Definition at line 118 of file Native.cpp.
Text* internalformatTextDisplayer = NULL |
Definition at line 133 of file Native.cpp.
GLint modelViewMatrixLocation = 0 |
Definition at line 134 of file Native.cpp.
const int numberOfTextures = sizeof(imageArray) / sizeof(imageArray[0]) |
Definition at line 135 of file Native.cpp.
GLint positionLocation = 0 |
Definition at line 136 of file Native.cpp.
GLuint programId = 0 |
Definition at line 137 of file Native.cpp.
float scalingFactor = 0.75f |
Definition at line 138 of file Native.cpp.
GLint textureCoordinateLocation = 0 |
Definition at line 139 of file Native.cpp.
float textureCoordinatesData[] |
Definition at line 157 of file Native.cpp.
GLint textureLocation = 0 |
Definition at line 140 of file Native.cpp.
Timer timer |
Definition at line 141 of file Native.cpp.
GLuint vertexArrayId = 0 |
Definition at line 145 of file Native.cpp.
float vertexData[] |
Definition at line 148 of file Native.cpp.
GLuint vertexShaderId = 0 |
Definition at line 144 of file Native.cpp.
int windowHeight = 0 |
Definition at line 142 of file Native.cpp.
int windowWidth = 0 |
Definition at line 143 of file Native.cpp.