sphore 0.0.1
SPH openGL rendering engine
|
Code for managing offscreen rendering. More...
#include <GL/gl.h>
Go to the source code of this file.
Typedefs | |
typedef struct _offscreen | offscreen_t |
Public handel to the offsceen object. | |
Functions | |
offscreen_t * | offscreen_create (unsigned int width, unsigned int height) |
Creates an offscreen object with the sepcified dimensions. | |
void | offscreen_destroy (offscreen_t *o) |
Cleans up the memory accosiated with an offscreen object. | |
unsigned int | get_next_power_2 (unsigned int x) |
Returns a number that is the smallest power of two heigher that x. | |
GLuint | offscreen_get_texture (offscreen_t *o) |
Gets the OpenGL identifier for the texture that has been drawn to. | |
GLint | offscreen_get_texture_location (offscreen_t *o) |
Gets the location of the texture in the current glsl program. | |
void | offscreen_set_texture_location (offscreen_t *o, GLint loc) |
Sets the location of the texture in the current glsl program. | |
void | offscreen_load_texture (offscreen_t *o) |
void | offscreen_get_texture_size (offscreen_t *o, unsigned int *width, unsigned int *height) |
void | offscreen_start (offscreen_t *o) |
Begins drawing to the offscreen texture. | |
void | offscreen_stop (offscreen_t *o) |
Ends drawing to the offscreen texture. |
Code for managing offscreen rendering.
Actual implimentation is either with fbo's (offscreen-fbo.c) or by copying the texture from the window system provided buffer.
typedef struct _offscreen offscreen_t |
Public handel to the offsceen object.
unsigned int get_next_power_2 | ( | unsigned int | x | ) |
Returns a number that is the smallest power of two heigher that x.
[in] | x | The number that the return value must be equall to or higher than. |
offscreen_t* offscreen_create | ( | unsigned int | width, |
unsigned int | height | ||
) |
Creates an offscreen object with the sepcified dimensions.
[in] | width | The width of the offscreen object in pixels. |
[in] | height | The height of the offscreen object in pixels. |
void offscreen_destroy | ( | offscreen_t * | o | ) |
Cleans up the memory accosiated with an offscreen object.
[in] | o | The object to be destroyed. |
GLuint offscreen_get_texture | ( | offscreen_t * | o | ) |
Gets the OpenGL identifier for the texture that has been drawn to.
[in] | o | The object for which we want the texture. |
GLint offscreen_get_texture_location | ( | offscreen_t * | o | ) |
Gets the location of the texture in the current glsl program.
[in] | o | The offscreen object to query. |
void offscreen_get_texture_size | ( | offscreen_t * | o, |
unsigned int * | width, | ||
unsigned int * | height | ||
) |
Returns the size of the offscreen object in pixels.
[in] | o | The object to query. |
[out] | width | Gets set to the width of the object in pixels. |
[out] | height | Gets set to the height of the object in pixels. |
void offscreen_load_texture | ( | offscreen_t * | o | ) |
void offscreen_set_texture_location | ( | offscreen_t * | o, |
GLint | loc | ||
) |
Sets the location of the texture in the current glsl program.
[in] | o | The offscreen object to modify. |
[in] | loc | The new location identifier. |
void offscreen_start | ( | offscreen_t * | o | ) |
Begins drawing to the offscreen texture.
[in] | o | The object to draw to. |
void offscreen_stop | ( | offscreen_t * | o | ) |
Ends drawing to the offscreen texture.
[in] | o | The object to stop drawing to. |