![]() |
Mali OpenGL ES SDK v2.4.4
Mali Developer Center
Use of the code snippets present within these pages are subject to these EULA terms
|
A sample which shows how to use frame buffer objects. More...
#include <GLES2/gl2.h>#include <GLES2/gl2ext.h>#include <EGL/egl.h>#include <string>#include "FrameBufferObject.h"#include "Text.h"#include "Shader.h"#include "Texture.h"#include "Matrix.h"#include "Timer.h"#include "Platform.h"#include "EGLRuntime.h"Macros | |
| #define | WINDOW_W 800 |
| #define | WINDOW_H 600 |
| #define | FBO_WIDTH 256 |
| #define | FBO_HEIGHT 256 |
Functions | |
| bool | setupGraphics (int width, int height) |
| void | renderFrame (void) |
| int | main (void) |
Variables | |
| string | resourceDirectory = "assets/" |
| 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 |
| Text * | text |
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.
| #define FBO_HEIGHT 256 |
| #define FBO_WIDTH 256 |
| #define WINDOW_H 600 |
| #define WINDOW_W 800 |
| int main | ( | void | ) |
| void renderFrame | ( | void | ) |
|
static |
|
static |
|
static |
| string fragmentShaderFilename = "FrameBufferObject_cube.frag" |
| GLuint fragmentShaderID = 0 |
| GLuint iFBO = 0 |
| GLuint iFBOTex = 0 |
| GLint iLocFillColor = -1 |
| GLint iLocModelview = -1 |
| GLint iLocPosition = -1 |
| GLint iLocProjection = -1 |
| GLint iLocTexCoord = -1 |
| GLint iLocTexture = -1 |
| GLint iLocTextureMix = -1 |
| Matrix modelView |
| GLuint programID = 0 |
| Matrix projection |
| Matrix projectionFBO |
| string resourceDirectory = "assets/" |
| Matrix rotationX |
| Matrix rotationY |
| Matrix rotationZ |
| Text* text |
| Matrix translation |
| string vertexShaderFilename = "FrameBufferObject_cube.vert" |
| GLuint vertexShaderID = 0 |
| int windowHeight = -1 |
| int windowWidth = -1 |