|
Kore
|
Provides functions for handling render-targets. More...
#include <kinc/global.h>#include <kinc/backend/graphics4/rendertarget.h>#include "textureunit.h"#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | kinc_g4_render_target |
Typedefs | |
| typedef enum kinc_g4_render_target_format | kinc_g4_render_target_format_t |
| typedef struct kinc_g4_render_target | kinc_g4_render_target_t |
Functions | |
| KINC_FUNC void | kinc_g4_render_target_init (kinc_g4_render_target_t *renderTarget, int width, int height, kinc_g4_render_target_format_t format, int depthBufferBits, int stencilBufferBits) |
| Allocates and initializes a regular render-target. The contents of the render-target are undefined. | |
| KINC_FUNC void | kinc_g4_render_target_init_with_multisampling (kinc_g4_render_target_t *renderTarget, int width, int height, kinc_g4_render_target_format_t format, int depthBufferBits, int stencilBufferBits, int samples_per_pixel) |
| Allocates and initializes a multi-sampled render-target if possible - otherwise it falls back to a regular render-target. The contents of the render-target are undefined. | |
| KINC_FUNC void | kinc_g4_render_target_init_cube (kinc_g4_render_target_t *renderTarget, int cubeMapSize, kinc_g4_render_target_format_t format, int depthBufferBits, int stencilBufferBits) |
| Allocates and initializes a render-target-cube-map. The contents of the render-target are undefined. | |
| KINC_FUNC void | kinc_g4_render_target_init_cube_with_multisampling (kinc_g4_render_target_t *renderTarget, int cubeMapSize, kinc_g4_render_target_format_t format, int depthBufferBits, int stencilBufferBits, int samples_per_pixel) |
| Allocates and initializes a multi-sampled render-target-cube-map. Can fall back to a non-multi-sampled cube-map. The contents of the render-target are undefined. | |
| KINC_FUNC void | kinc_g4_render_target_destroy (kinc_g4_render_target_t *renderTarget) |
| Deallocates and destroys a render-target. | |
| KINC_FUNC void | kinc_g4_render_target_use_color_as_texture (kinc_g4_render_target_t *renderTarget, kinc_g4_texture_unit_t unit) |
| Uses the color-component of a render-target as a texture. | |
| KINC_FUNC void | kinc_g4_render_target_use_depth_as_texture (kinc_g4_render_target_t *renderTarget, kinc_g4_texture_unit_t unit) |
| Uses the depth-component of a render-target as a texture. | |
| KINC_FUNC void | kinc_g4_render_target_set_depth_stencil_from (kinc_g4_render_target_t *renderTarget, kinc_g4_render_target_t *source) |
| Copies the depth and stencil-components of one render-target into another one. | |
| KINC_FUNC void | kinc_g4_render_target_get_pixels (kinc_g4_render_target_t *renderTarget, uint8_t *data) |
| Copies out the color-data from a render-target. Beware, this is very slow. | |
| KINC_FUNC void | kinc_g4_render_target_generate_mipmaps (kinc_g4_render_target_t *renderTarget, int levels) |
| Generates the mipmap-chain for a render-target. | |
Provides functions for handling render-targets.
| KINC_FUNC void kinc_g4_render_target_destroy | ( | kinc_g4_render_target_t * | renderTarget | ) |
Deallocates and destroys a render-target.
| renderTarget | The render-target to destroy |
| KINC_FUNC void kinc_g4_render_target_generate_mipmaps | ( | kinc_g4_render_target_t * | renderTarget, |
| int | levels ) |
Generates the mipmap-chain for a render-target.
| renderTarget | The render-target to create the mipmaps for |
| levels | The number of mipmap-levels to generate |
| KINC_FUNC void kinc_g4_render_target_get_pixels | ( | kinc_g4_render_target_t * | renderTarget, |
| uint8_t * | data ) |
Copies out the color-data from a render-target. Beware, this is very slow.
| renderTarget | The render-target to copy the color-data from |
| data | A pointer to where the data will be copied to |
| KINC_FUNC void kinc_g4_render_target_init | ( | kinc_g4_render_target_t * | renderTarget, |
| int | width, | ||
| int | height, | ||
| kinc_g4_render_target_format_t | format, | ||
| int | depthBufferBits, | ||
| int | stencilBufferBits ) |
Allocates and initializes a regular render-target. The contents of the render-target are undefined.
| renderTarget | |
| width | |
| height | |
| format | |
| depthBufferBits | |
| stencilBufferBits |
| KINC_FUNC void kinc_g4_render_target_init_cube | ( | kinc_g4_render_target_t * | renderTarget, |
| int | cubeMapSize, | ||
| kinc_g4_render_target_format_t | format, | ||
| int | depthBufferBits, | ||
| int | stencilBufferBits ) |
Allocates and initializes a render-target-cube-map. The contents of the render-target are undefined.
| renderTarget | |
| cubeMapSize | |
| format | |
| depthBufferBits | |
| stencilBufferBits |
| KINC_FUNC void kinc_g4_render_target_init_cube_with_multisampling | ( | kinc_g4_render_target_t * | renderTarget, |
| int | cubeMapSize, | ||
| kinc_g4_render_target_format_t | format, | ||
| int | depthBufferBits, | ||
| int | stencilBufferBits, | ||
| int | samples_per_pixel ) |
Allocates and initializes a multi-sampled render-target-cube-map. Can fall back to a non-multi-sampled cube-map. The contents of the render-target are undefined.
| renderTarget | |
| cubeMapSize | |
| format | |
| depthBufferBits | |
| stencilBufferBits | |
| samples_per_pixel |
| KINC_FUNC void kinc_g4_render_target_init_with_multisampling | ( | kinc_g4_render_target_t * | renderTarget, |
| int | width, | ||
| int | height, | ||
| kinc_g4_render_target_format_t | format, | ||
| int | depthBufferBits, | ||
| int | stencilBufferBits, | ||
| int | samples_per_pixel ) |
Allocates and initializes a multi-sampled render-target if possible - otherwise it falls back to a regular render-target. The contents of the render-target are undefined.
| renderTarget | |
| width | |
| height | |
| format | |
| depthBufferBits | |
| stencilBufferBits | |
| samples_per_pixel |
| KINC_FUNC void kinc_g4_render_target_set_depth_stencil_from | ( | kinc_g4_render_target_t * | renderTarget, |
| kinc_g4_render_target_t * | source ) |
Copies the depth and stencil-components of one render-target into another one.
| renderTarget | The render-target to copy the data into |
| source | The render-target from which to copy the data |
| KINC_FUNC void kinc_g4_render_target_use_color_as_texture | ( | kinc_g4_render_target_t * | renderTarget, |
| kinc_g4_texture_unit_t | unit ) |
Uses the color-component of a render-target as a texture.
| renderTarget | The render-target to use |
| unit | The texture-unit to assign the render-target to |
| KINC_FUNC void kinc_g4_render_target_use_depth_as_texture | ( | kinc_g4_render_target_t * | renderTarget, |
| kinc_g4_texture_unit_t | unit ) |
Uses the depth-component of a render-target as a texture.
| renderTarget | The render-target to use |
| unit | The texture-unit to assign the render-target to |