(API Change) Use const params where applicable
This Fixes a minor flaw with the API where data had to always be mutable to be usable by the API. Functions that do not modify the fundamental underlying data of a structure should be marked as constant, both for safety and to signify that the parameter is input only and will not be modified by the function using it.
This commit is contained in:
@@ -26,16 +26,16 @@ extern "C" {
|
||||
EXPORT const char *device_get_name(void);
|
||||
EXPORT int device_get_type(void);
|
||||
EXPORT const char *device_preprocessor_name(void);
|
||||
EXPORT int device_create(gs_device_t **device, struct gs_init_data *data);
|
||||
EXPORT int device_create(gs_device_t **device, const struct gs_init_data *data);
|
||||
EXPORT void device_destroy(gs_device_t *device);
|
||||
EXPORT void device_enter_context(gs_device_t *device);
|
||||
EXPORT void device_leave_context(gs_device_t *device);
|
||||
EXPORT gs_swapchain_t *device_swapchain_create(gs_device_t *device,
|
||||
struct gs_init_data *data);
|
||||
const struct gs_init_data *data);
|
||||
EXPORT void device_resize(gs_device_t *device, uint32_t x, uint32_t y);
|
||||
EXPORT void device_get_size(gs_device_t *device, uint32_t *x, uint32_t *y);
|
||||
EXPORT uint32_t device_get_width(gs_device_t *device);
|
||||
EXPORT uint32_t device_get_height(gs_device_t *device);
|
||||
EXPORT void device_get_size(const gs_device_t *device, uint32_t *x, uint32_t *y);
|
||||
EXPORT uint32_t device_get_width(const gs_device_t *device);
|
||||
EXPORT uint32_t device_get_height(const gs_device_t *device);
|
||||
EXPORT gs_texture_t *device_texture_create(gs_device_t *device, uint32_t width,
|
||||
uint32_t height, enum gs_color_format color_format,
|
||||
uint32_t levels, const uint8_t **data, uint32_t flags);
|
||||
@@ -53,7 +53,7 @@ EXPORT gs_stagesurf_t *device_stagesurface_create(gs_device_t *device,
|
||||
uint32_t width, uint32_t height,
|
||||
enum gs_color_format color_format);
|
||||
EXPORT gs_samplerstate_t *device_samplerstate_create(gs_device_t *device,
|
||||
struct gs_sampler_info *info);
|
||||
const struct gs_sampler_info *info);
|
||||
EXPORT gs_shader_t *device_vertexshader_create(gs_device_t *device,
|
||||
const char *shader, const char *file,
|
||||
char **error_string);
|
||||
@@ -65,7 +65,8 @@ EXPORT gs_vertbuffer_t *device_vertexbuffer_create(gs_device_t *device,
|
||||
EXPORT gs_indexbuffer_t *device_indexbuffer_create(gs_device_t *device,
|
||||
enum gs_index_type type, void *indices, size_t num,
|
||||
uint32_t flags);
|
||||
EXPORT enum gs_texture_type device_get_texture_type(gs_texture_t *texture);
|
||||
EXPORT enum gs_texture_type device_get_texture_type(
|
||||
const gs_texture_t *texture);
|
||||
EXPORT void device_load_vertexbuffer(gs_device_t *device,
|
||||
gs_vertbuffer_t *vertbuffer);
|
||||
EXPORT void device_load_indexbuffer(gs_device_t *device,
|
||||
@@ -80,10 +81,10 @@ EXPORT void device_load_pixelshader(gs_device_t *device,
|
||||
gs_shader_t *pixelshader);
|
||||
EXPORT void device_load_default_samplerstate(gs_device_t *device, bool b_3d,
|
||||
int unit);
|
||||
EXPORT gs_shader_t *device_get_vertex_shader(gs_device_t *device);
|
||||
EXPORT gs_shader_t *device_get_pixel_shader(gs_device_t *device);
|
||||
EXPORT gs_texture_t *device_get_render_target(gs_device_t *device);
|
||||
EXPORT gs_zstencil_t *device_get_zstencil_target(gs_device_t *device);
|
||||
EXPORT gs_shader_t *device_get_vertex_shader(const gs_device_t *device);
|
||||
EXPORT gs_shader_t *device_get_pixel_shader(const gs_device_t *device);
|
||||
EXPORT gs_texture_t *device_get_render_target(const gs_device_t *device);
|
||||
EXPORT gs_zstencil_t *device_get_zstencil_target(const gs_device_t *device);
|
||||
EXPORT void device_set_render_target(gs_device_t *device, gs_texture_t *tex,
|
||||
gs_zstencil_t *zstencil);
|
||||
EXPORT void device_set_cube_render_target(gs_device_t *device,
|
||||
@@ -104,11 +105,11 @@ EXPORT void device_end_scene(gs_device_t *device);
|
||||
EXPORT void device_load_swapchain(gs_device_t *device,
|
||||
gs_swapchain_t *swapchain);
|
||||
EXPORT void device_clear(gs_device_t *device, uint32_t clear_flags,
|
||||
struct vec4 *color, float depth, uint8_t stencil);
|
||||
const struct vec4 *color, float depth, uint8_t stencil);
|
||||
EXPORT void device_present(gs_device_t *device);
|
||||
EXPORT void device_flush(gs_device_t *device);
|
||||
EXPORT void device_set_cull_mode(gs_device_t *device, enum gs_cull_mode mode);
|
||||
EXPORT enum gs_cull_mode device_get_cull_mode(gs_device_t *device);
|
||||
EXPORT enum gs_cull_mode device_get_cull_mode(const gs_device_t *device);
|
||||
EXPORT void device_enable_blending(gs_device_t *device, bool enable);
|
||||
EXPORT void device_enable_depth_test(gs_device_t *device, bool enable);
|
||||
EXPORT void device_enable_stencil_test(gs_device_t *device, bool enable);
|
||||
@@ -123,18 +124,12 @@ EXPORT void device_stencil_function(gs_device_t *device,
|
||||
EXPORT void device_stencil_op(gs_device_t *device, enum gs_stencil_side side,
|
||||
enum gs_stencil_op_type fail, enum gs_stencil_op_type zfail,
|
||||
enum gs_stencil_op_type zpass);
|
||||
EXPORT void device_enable_fullscreen(gs_device_t *device, bool enable);
|
||||
EXPORT int device_fullscreen_enabled(gs_device_t *device);
|
||||
EXPORT void device_setdisplaymode(gs_device_t *device,
|
||||
const struct gs_display_mode *mode);
|
||||
EXPORT void device_getdisplaymode(gs_device_t *device,
|
||||
struct gs_display_mode *mode);
|
||||
EXPORT void device_setcolorramp(gs_device_t *device, float gamma,
|
||||
float brightness, float contrast);
|
||||
EXPORT void device_set_viewport(gs_device_t *device, int x, int y, int width,
|
||||
int height);
|
||||
EXPORT void device_get_viewport(gs_device_t *device, struct gs_rect *rect);
|
||||
EXPORT void device_set_scissor_rect(gs_device_t *device, struct gs_rect *rect);
|
||||
EXPORT void device_get_viewport(const gs_device_t *device,
|
||||
struct gs_rect *rect);
|
||||
EXPORT void device_set_scissor_rect(gs_device_t *device,
|
||||
const struct gs_rect *rect);
|
||||
EXPORT void device_ortho(gs_device_t *device, float left, float right,
|
||||
float top, float bottom, float znear, float zfar);
|
||||
EXPORT void device_frustum(gs_device_t *device, float left, float right,
|
||||
|
@@ -29,7 +29,8 @@ void gs_effect_destroy(gs_effect_t *effect)
|
||||
}
|
||||
}
|
||||
|
||||
gs_technique_t *gs_effect_get_technique(gs_effect_t *effect, const char *name)
|
||||
gs_technique_t *gs_effect_get_technique(const gs_effect_t *effect,
|
||||
const char *name)
|
||||
{
|
||||
if (!effect) return NULL;
|
||||
|
||||
@@ -194,12 +195,12 @@ void gs_technique_end_pass(gs_technique_t *tech)
|
||||
tech->effect->cur_pass = NULL;
|
||||
}
|
||||
|
||||
size_t gs_effect_get_num_params(gs_effect_t *effect)
|
||||
size_t gs_effect_get_num_params(const gs_effect_t *effect)
|
||||
{
|
||||
return effect ? effect->params.num : 0;
|
||||
}
|
||||
|
||||
gs_eparam_t *gs_effect_get_param_by_idx(gs_effect_t *effect, size_t param)
|
||||
gs_eparam_t *gs_effect_get_param_by_idx(const gs_effect_t *effect, size_t param)
|
||||
{
|
||||
if (!effect) return NULL;
|
||||
|
||||
@@ -210,7 +211,8 @@ gs_eparam_t *gs_effect_get_param_by_idx(gs_effect_t *effect, size_t param)
|
||||
return params+param;
|
||||
}
|
||||
|
||||
gs_eparam_t *gs_effect_get_param_by_name(gs_effect_t *effect, const char *name)
|
||||
gs_eparam_t *gs_effect_get_param_by_name(const gs_effect_t *effect,
|
||||
const char *name)
|
||||
{
|
||||
if (!effect) return NULL;
|
||||
|
||||
@@ -226,17 +228,17 @@ gs_eparam_t *gs_effect_get_param_by_name(gs_effect_t *effect, const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gs_eparam_t *gs_effect_get_viewproj_matrix(gs_effect_t *effect)
|
||||
gs_eparam_t *gs_effect_get_viewproj_matrix(const gs_effect_t *effect)
|
||||
{
|
||||
return effect ? effect->view_proj : NULL;
|
||||
}
|
||||
|
||||
gs_eparam_t *gs_effect_get_world_matrix(gs_effect_t *effect)
|
||||
gs_eparam_t *gs_effect_get_world_matrix(const gs_effect_t *effect)
|
||||
{
|
||||
return effect ? effect->world : NULL;
|
||||
}
|
||||
|
||||
void gs_effect_get_param_info(gs_eparam_t *param,
|
||||
void gs_effect_get_param_info(const gs_eparam_t *param,
|
||||
struct gs_effect_param_info *info)
|
||||
{
|
||||
if (!param)
|
||||
|
@@ -27,16 +27,18 @@ struct gs_exports {
|
||||
const char *(*device_get_name)(void);
|
||||
int (*device_get_type)(void);
|
||||
const char *(*device_preprocessor_name)(void);
|
||||
int (*device_create)(gs_device_t **device, struct gs_init_data *data);
|
||||
int (*device_create)(gs_device_t **device,
|
||||
const struct gs_init_data *data);
|
||||
void (*device_destroy)(gs_device_t *device);
|
||||
void (*device_enter_context)(gs_device_t *device);
|
||||
void (*device_leave_context)(gs_device_t *device);
|
||||
gs_swapchain_t *(*device_swapchain_create)(gs_device_t *device,
|
||||
struct gs_init_data *data);
|
||||
const struct gs_init_data *data);
|
||||
void (*device_resize)(gs_device_t *device, uint32_t x, uint32_t y);
|
||||
void (*device_get_size)(gs_device_t *device, uint32_t *x, uint32_t *y);
|
||||
uint32_t (*device_get_width)(gs_device_t *device);
|
||||
uint32_t (*device_get_height)(gs_device_t *device);
|
||||
void (*device_get_size)(const gs_device_t *device,
|
||||
uint32_t *x, uint32_t *y);
|
||||
uint32_t (*device_get_width)(const gs_device_t *device);
|
||||
uint32_t (*device_get_height)(const gs_device_t *device);
|
||||
gs_texture_t *(*device_texture_create)(gs_device_t *device,
|
||||
uint32_t width, uint32_t height,
|
||||
enum gs_color_format color_format, uint32_t levels,
|
||||
@@ -55,7 +57,7 @@ struct gs_exports {
|
||||
uint32_t width, uint32_t height,
|
||||
enum gs_color_format color_format);
|
||||
gs_samplerstate_t *(*device_samplerstate_create)(gs_device_t *device,
|
||||
struct gs_sampler_info *info);
|
||||
const struct gs_sampler_info *info);
|
||||
gs_shader_t *(*device_vertexshader_create)(gs_device_t *device,
|
||||
const char *shader, const char *file,
|
||||
char **error_string);
|
||||
@@ -67,7 +69,8 @@ struct gs_exports {
|
||||
gs_indexbuffer_t *(*device_indexbuffer_create)(gs_device_t *device,
|
||||
enum gs_index_type type, void *indices, size_t num,
|
||||
uint32_t flags);
|
||||
enum gs_texture_type (*device_get_texture_type)(gs_texture_t *texture);
|
||||
enum gs_texture_type (*device_get_texture_type)(
|
||||
const gs_texture_t *texture);
|
||||
void (*device_load_vertexbuffer)(gs_device_t *device,
|
||||
gs_vertbuffer_t *vertbuffer);
|
||||
void (*device_load_indexbuffer)(gs_device_t *device,
|
||||
@@ -82,10 +85,10 @@ struct gs_exports {
|
||||
gs_shader_t *pixelshader);
|
||||
void (*device_load_default_samplerstate)(gs_device_t *device,
|
||||
bool b_3d, int unit);
|
||||
gs_shader_t *(*device_get_vertex_shader)(gs_device_t *device);
|
||||
gs_shader_t *(*device_get_pixel_shader)(gs_device_t *device);
|
||||
gs_texture_t *(*device_get_render_target)(gs_device_t *device);
|
||||
gs_zstencil_t *(*device_get_zstencil_target)(gs_device_t *device);
|
||||
gs_shader_t *(*device_get_vertex_shader)(const gs_device_t *device);
|
||||
gs_shader_t *(*device_get_pixel_shader)(const gs_device_t *device);
|
||||
gs_texture_t *(*device_get_render_target)(const gs_device_t *device);
|
||||
gs_zstencil_t *(*device_get_zstencil_target)(const gs_device_t *device);
|
||||
void (*device_set_render_target)(gs_device_t *device, gs_texture_t *tex,
|
||||
gs_zstencil_t *zstencil);
|
||||
void (*device_set_cube_render_target)(gs_device_t *device,
|
||||
@@ -105,12 +108,12 @@ struct gs_exports {
|
||||
void (*device_load_swapchain)(gs_device_t *device,
|
||||
gs_swapchain_t *swaphchain);
|
||||
void (*device_clear)(gs_device_t *device, uint32_t clear_flags,
|
||||
struct vec4 *color, float depth, uint8_t stencil);
|
||||
const struct vec4 *color, float depth, uint8_t stencil);
|
||||
void (*device_present)(gs_device_t *device);
|
||||
void (*device_flush)(gs_device_t *device);
|
||||
void (*device_set_cull_mode)(gs_device_t *device,
|
||||
enum gs_cull_mode mode);
|
||||
enum gs_cull_mode (*device_get_cull_mode)(gs_device_t *device);
|
||||
enum gs_cull_mode (*device_get_cull_mode)(const gs_device_t *device);
|
||||
void (*device_enable_blending)(gs_device_t *device, bool enable);
|
||||
void (*device_enable_depth_test)(gs_device_t *device, bool enable);
|
||||
void (*device_enable_stencil_test)(gs_device_t *device, bool enable);
|
||||
@@ -130,9 +133,10 @@ struct gs_exports {
|
||||
enum gs_stencil_op_type zpass);
|
||||
void (*device_set_viewport)(gs_device_t *device, int x, int y,
|
||||
int width, int height);
|
||||
void (*device_get_viewport)(gs_device_t *device, struct gs_rect *rect);
|
||||
void (*device_set_scissor_rect)(gs_device_t *device,
|
||||
void (*device_get_viewport)(const gs_device_t *device,
|
||||
struct gs_rect *rect);
|
||||
void (*device_set_scissor_rect)(gs_device_t *device,
|
||||
const struct gs_rect *rect);
|
||||
void (*device_ortho)(gs_device_t *device, float left, float right,
|
||||
float top, float bottom, float znear, float zfar);
|
||||
void (*device_frustum)(gs_device_t *device, float left, float right,
|
||||
@@ -143,32 +147,33 @@ struct gs_exports {
|
||||
void (*gs_swapchain_destroy)(gs_swapchain_t *swapchain);
|
||||
|
||||
void (*gs_texture_destroy)(gs_texture_t *tex);
|
||||
uint32_t (*gs_texture_get_width)(gs_texture_t *tex);
|
||||
uint32_t (*gs_texture_get_height)(gs_texture_t *tex);
|
||||
enum gs_color_format (*gs_texture_get_color_format)(gs_texture_t *tex);
|
||||
uint32_t (*gs_texture_get_width)(const gs_texture_t *tex);
|
||||
uint32_t (*gs_texture_get_height)(const gs_texture_t *tex);
|
||||
enum gs_color_format (*gs_texture_get_color_format)(
|
||||
const gs_texture_t *tex);
|
||||
bool (*gs_texture_map)(gs_texture_t *tex, uint8_t **ptr,
|
||||
uint32_t *linesize);
|
||||
void (*gs_texture_unmap)(gs_texture_t *tex);
|
||||
bool (*gs_texture_is_rect)(gs_texture_t *tex);
|
||||
void *(*gs_texture_get_obj)(gs_texture_t *tex);
|
||||
bool (*gs_texture_is_rect)(const gs_texture_t *tex);
|
||||
void *(*gs_texture_get_obj)(const gs_texture_t *tex);
|
||||
|
||||
void (*gs_cubetexture_destroy)(gs_texture_t *cubetex);
|
||||
uint32_t (*gs_cubetexture_get_size)(gs_texture_t *cubetex);
|
||||
uint32_t (*gs_cubetexture_get_size)(const gs_texture_t *cubetex);
|
||||
enum gs_color_format (*gs_cubetexture_get_color_format)(
|
||||
gs_texture_t *cubetex);
|
||||
const gs_texture_t *cubetex);
|
||||
|
||||
void (*gs_voltexture_destroy)(gs_texture_t *voltex);
|
||||
uint32_t (*gs_voltexture_get_width)(gs_texture_t *voltex);
|
||||
uint32_t (*gs_voltexture_get_height)(gs_texture_t *voltex);
|
||||
uint32_t (*gs_voltexture_getdepth)(gs_texture_t *voltex);
|
||||
uint32_t (*gs_voltexture_get_width)(const gs_texture_t *voltex);
|
||||
uint32_t (*gs_voltexture_get_height)(const gs_texture_t *voltex);
|
||||
uint32_t (*gs_voltexture_getdepth)(const gs_texture_t *voltex);
|
||||
enum gs_color_format (*gs_voltexture_get_color_format)(
|
||||
gs_texture_t *voltex);
|
||||
const gs_texture_t *voltex);
|
||||
|
||||
void (*gs_stagesurface_destroy)(gs_stagesurf_t *stagesurf);
|
||||
uint32_t (*gs_stagesurface_get_width)(gs_stagesurf_t *stagesurf);
|
||||
uint32_t (*gs_stagesurface_get_height)(gs_stagesurf_t *stagesurf);
|
||||
uint32_t (*gs_stagesurface_get_width)(const gs_stagesurf_t *stagesurf);
|
||||
uint32_t (*gs_stagesurface_get_height)(const gs_stagesurf_t *stagesurf);
|
||||
enum gs_color_format (*gs_stagesurface_get_color_format)(
|
||||
gs_stagesurf_t *stagesurf);
|
||||
const gs_stagesurf_t *stagesurf);
|
||||
bool (*gs_stagesurface_map)(gs_stagesurf_t *stagesurf,
|
||||
uint8_t **data, uint32_t *linesize);
|
||||
void (*gs_stagesurface_unmap)(gs_stagesurf_t *stagesurf);
|
||||
@@ -180,24 +185,26 @@ struct gs_exports {
|
||||
void (*gs_vertexbuffer_destroy)(gs_vertbuffer_t *vertbuffer);
|
||||
void (*gs_vertexbuffer_flush)(gs_vertbuffer_t *vertbuffer);
|
||||
struct gs_vb_data *(*gs_vertexbuffer_get_data)(
|
||||
gs_vertbuffer_t *vertbuffer);
|
||||
const gs_vertbuffer_t *vertbuffer);
|
||||
|
||||
void (*gs_indexbuffer_destroy)(gs_indexbuffer_t *indexbuffer);
|
||||
void (*gs_indexbuffer_flush)(gs_indexbuffer_t *indexbuffer);
|
||||
void *(*gs_indexbuffer_get_data)(gs_indexbuffer_t *indexbuffer);
|
||||
size_t (*gs_indexbuffer_get_num_indices)(gs_indexbuffer_t *indexbuffer);
|
||||
void *(*gs_indexbuffer_get_data)(const gs_indexbuffer_t *indexbuffer);
|
||||
size_t (*gs_indexbuffer_get_num_indices)(
|
||||
const gs_indexbuffer_t *indexbuffer);
|
||||
enum gs_index_type (*gs_indexbuffer_get_type)(
|
||||
gs_indexbuffer_t *indexbuffer);
|
||||
const gs_indexbuffer_t *indexbuffer);
|
||||
|
||||
void (*gs_shader_destroy)(gs_shader_t *shader);
|
||||
int (*gs_shader_get_num_params)(gs_shader_t *shader);
|
||||
int (*gs_shader_get_num_params)(const gs_shader_t *shader);
|
||||
gs_sparam_t *(*gs_shader_get_param_by_idx)(gs_shader_t *shader,
|
||||
uint32_t param);
|
||||
gs_sparam_t *(*gs_shader_get_param_by_name)(gs_shader_t *shader,
|
||||
const char *name);
|
||||
gs_sparam_t *(*gs_shader_get_viewproj_matrix)(gs_shader_t *shader);
|
||||
gs_sparam_t *(*gs_shader_get_world_matrix)(gs_shader_t *shader);
|
||||
void (*gs_shader_get_param_info)(gs_sparam_t *param,
|
||||
gs_sparam_t *(*gs_shader_get_viewproj_matrix)(
|
||||
const gs_shader_t *shader);
|
||||
gs_sparam_t *(*gs_shader_get_world_matrix)(const gs_shader_t *shader);
|
||||
void (*gs_shader_get_param_info)(const gs_sparam_t *param,
|
||||
struct gs_shader_param_info *info);
|
||||
void (*gs_shader_set_bool)(gs_sparam_t *param, bool val);
|
||||
void (*gs_shader_set_float)(gs_sparam_t *param, float val);
|
||||
|
@@ -117,7 +117,7 @@ static bool graphics_init(struct graphics_subsystem *graphics)
|
||||
}
|
||||
|
||||
int gs_create(graphics_t **pgraphics, const char *module,
|
||||
struct gs_init_data *data)
|
||||
const struct gs_init_data *data)
|
||||
{
|
||||
struct gs_init_data new_data = *data;
|
||||
int errcode = GS_ERROR_FAIL;
|
||||
@@ -958,7 +958,7 @@ const char *gs_preprocessor_name(void)
|
||||
return graphics->exports.device_preprocessor_name();
|
||||
}
|
||||
|
||||
gs_swapchain_t *gs_swapchain_create(struct gs_init_data *data)
|
||||
gs_swapchain_t *gs_swapchain_create(const struct gs_init_data *data)
|
||||
{
|
||||
struct gs_init_data new_data = *data;
|
||||
|
||||
@@ -1106,7 +1106,7 @@ gs_stagesurf_t *gs_stagesurface_create(uint32_t width, uint32_t height,
|
||||
width, height, color_format);
|
||||
}
|
||||
|
||||
gs_samplerstate_t *gs_samplerstate_create(struct gs_sampler_info *info)
|
||||
gs_samplerstate_t *gs_samplerstate_create(const struct gs_sampler_info *info)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics) return NULL;
|
||||
@@ -1155,7 +1155,7 @@ gs_indexbuffer_t *gs_indexbuffer_create(enum gs_index_type type,
|
||||
type, indices, num, flags);
|
||||
}
|
||||
|
||||
enum gs_texture_type gs_get_texture_type(gs_texture_t *texture)
|
||||
enum gs_texture_type gs_get_texture_type(const gs_texture_t *texture)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics) return GS_TEXTURE_2D;
|
||||
@@ -1338,7 +1338,7 @@ void gs_load_swapchain(gs_swapchain_t *swapchain)
|
||||
graphics->exports.device_load_swapchain(graphics->device, swapchain);
|
||||
}
|
||||
|
||||
void gs_clear(uint32_t clear_flags, struct vec4 *color, float depth,
|
||||
void gs_clear(uint32_t clear_flags, const struct vec4 *color, float depth,
|
||||
uint8_t stencil)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
@@ -1473,7 +1473,7 @@ void gs_get_viewport(struct gs_rect *rect)
|
||||
graphics->exports.device_get_viewport(graphics->device, rect);
|
||||
}
|
||||
|
||||
void gs_set_scissor_rect(struct gs_rect *rect)
|
||||
void gs_set_scissor_rect(const struct gs_rect *rect)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics) return;
|
||||
@@ -1533,7 +1533,7 @@ void gs_shader_destroy(gs_shader_t *shader)
|
||||
graphics->exports.gs_shader_destroy(shader);
|
||||
}
|
||||
|
||||
int gs_shader_get_num_params(gs_shader_t *shader)
|
||||
int gs_shader_get_num_params(const gs_shader_t *shader)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !shader) return 0;
|
||||
@@ -1557,7 +1557,7 @@ gs_sparam_t *gs_shader_get_param_by_name(gs_shader_t *shader, const char *name)
|
||||
return graphics->exports.gs_shader_get_param_by_name(shader, name);
|
||||
}
|
||||
|
||||
gs_sparam_t *gs_shader_get_viewproj_matrix(gs_shader_t *shader)
|
||||
gs_sparam_t *gs_shader_get_viewproj_matrix(const gs_shader_t *shader)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !shader) return NULL;
|
||||
@@ -1565,7 +1565,7 @@ gs_sparam_t *gs_shader_get_viewproj_matrix(gs_shader_t *shader)
|
||||
return graphics->exports.gs_shader_get_viewproj_matrix(shader);
|
||||
}
|
||||
|
||||
gs_sparam_t *gs_shader_get_world_matrix(gs_shader_t *shader)
|
||||
gs_sparam_t *gs_shader_get_world_matrix(const gs_shader_t *shader)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !shader) return NULL;
|
||||
@@ -1573,7 +1573,7 @@ gs_sparam_t *gs_shader_get_world_matrix(gs_shader_t *shader)
|
||||
return graphics->exports.gs_shader_get_world_matrix(shader);
|
||||
}
|
||||
|
||||
void gs_shader_get_param_info(gs_sparam_t *param,
|
||||
void gs_shader_get_param_info(const gs_sparam_t *param,
|
||||
struct gs_shader_param_info *info)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
@@ -1678,7 +1678,7 @@ void gs_texture_destroy(gs_texture_t *tex)
|
||||
graphics->exports.gs_texture_destroy(tex);
|
||||
}
|
||||
|
||||
uint32_t gs_texture_get_width(gs_texture_t *tex)
|
||||
uint32_t gs_texture_get_width(const gs_texture_t *tex)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !tex) return 0;
|
||||
@@ -1686,7 +1686,7 @@ uint32_t gs_texture_get_width(gs_texture_t *tex)
|
||||
return graphics->exports.gs_texture_get_width(tex);
|
||||
}
|
||||
|
||||
uint32_t gs_texture_get_height(gs_texture_t *tex)
|
||||
uint32_t gs_texture_get_height(const gs_texture_t *tex)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !tex) return 0;
|
||||
@@ -1694,7 +1694,7 @@ uint32_t gs_texture_get_height(gs_texture_t *tex)
|
||||
return graphics->exports.gs_texture_get_height(tex);
|
||||
}
|
||||
|
||||
enum gs_color_format gs_texture_get_color_format(gs_texture_t *tex)
|
||||
enum gs_color_format gs_texture_get_color_format(const gs_texture_t *tex)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !tex) return GS_UNKNOWN;
|
||||
@@ -1718,7 +1718,7 @@ void gs_texture_unmap(gs_texture_t *tex)
|
||||
graphics->exports.gs_texture_unmap(tex);
|
||||
}
|
||||
|
||||
bool gs_texture_is_rect(gs_texture_t *tex)
|
||||
bool gs_texture_is_rect(const gs_texture_t *tex)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !tex) return false;
|
||||
@@ -1745,7 +1745,7 @@ void gs_cubetexture_destroy(gs_texture_t *cubetex)
|
||||
graphics->exports.gs_cubetexture_destroy(cubetex);
|
||||
}
|
||||
|
||||
uint32_t gs_cubetexture_get_size(gs_texture_t *cubetex)
|
||||
uint32_t gs_cubetexture_get_size(const gs_texture_t *cubetex)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !cubetex) return 0;
|
||||
@@ -1753,7 +1753,8 @@ uint32_t gs_cubetexture_get_size(gs_texture_t *cubetex)
|
||||
return graphics->exports.gs_cubetexture_get_size(cubetex);
|
||||
}
|
||||
|
||||
enum gs_color_format gs_cubetexture_get_color_format(gs_texture_t *cubetex)
|
||||
enum gs_color_format gs_cubetexture_get_color_format(
|
||||
const gs_texture_t *cubetex)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !cubetex) return GS_UNKNOWN;
|
||||
@@ -1769,7 +1770,7 @@ void gs_voltexture_destroy(gs_texture_t *voltex)
|
||||
graphics->exports.gs_voltexture_destroy(voltex);
|
||||
}
|
||||
|
||||
uint32_t gs_voltexture_get_width(gs_texture_t *voltex)
|
||||
uint32_t gs_voltexture_get_width(const gs_texture_t *voltex)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !voltex) return 0;
|
||||
@@ -1777,7 +1778,7 @@ uint32_t gs_voltexture_get_width(gs_texture_t *voltex)
|
||||
return graphics->exports.gs_voltexture_get_width(voltex);
|
||||
}
|
||||
|
||||
uint32_t gs_voltexture_get_height(gs_texture_t *voltex)
|
||||
uint32_t gs_voltexture_get_height(const gs_texture_t *voltex)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !voltex) return 0;
|
||||
@@ -1785,7 +1786,7 @@ uint32_t gs_voltexture_get_height(gs_texture_t *voltex)
|
||||
return graphics->exports.gs_voltexture_get_height(voltex);
|
||||
}
|
||||
|
||||
uint32_t gs_voltexture_getdepth(gs_texture_t *voltex)
|
||||
uint32_t gs_voltexture_getdepth(const gs_texture_t *voltex)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !voltex) return 0;
|
||||
@@ -1793,7 +1794,7 @@ uint32_t gs_voltexture_getdepth(gs_texture_t *voltex)
|
||||
return graphics->exports.gs_voltexture_getdepth(voltex);
|
||||
}
|
||||
|
||||
enum gs_color_format gs_voltexture_get_color_format(gs_texture_t *voltex)
|
||||
enum gs_color_format gs_voltexture_get_color_format(const gs_texture_t *voltex)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !voltex) return GS_UNKNOWN;
|
||||
@@ -1809,7 +1810,7 @@ void gs_stagesurface_destroy(gs_stagesurf_t *stagesurf)
|
||||
graphics->exports.gs_stagesurface_destroy(stagesurf);
|
||||
}
|
||||
|
||||
uint32_t gs_stagesurface_get_width(gs_stagesurf_t *stagesurf)
|
||||
uint32_t gs_stagesurface_get_width(const gs_stagesurf_t *stagesurf)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !stagesurf) return 0;
|
||||
@@ -1817,7 +1818,7 @@ uint32_t gs_stagesurface_get_width(gs_stagesurf_t *stagesurf)
|
||||
return graphics->exports.gs_stagesurface_get_width(stagesurf);
|
||||
}
|
||||
|
||||
uint32_t gs_stagesurface_get_height(gs_stagesurf_t *stagesurf)
|
||||
uint32_t gs_stagesurface_get_height(const gs_stagesurf_t *stagesurf)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !stagesurf) return 0;
|
||||
@@ -1825,7 +1826,8 @@ uint32_t gs_stagesurface_get_height(gs_stagesurf_t *stagesurf)
|
||||
return graphics->exports.gs_stagesurface_get_height(stagesurf);
|
||||
}
|
||||
|
||||
enum gs_color_format gs_stagesurface_get_color_format(gs_stagesurf_t *stagesurf)
|
||||
enum gs_color_format gs_stagesurface_get_color_format(
|
||||
const gs_stagesurf_t *stagesurf)
|
||||
{
|
||||
graphics_t *graphics = thread_graphics;
|
||||
if (!graphics || !stagesurf) return GS_UNKNOWN;
|
||||
@@ -1879,7 +1881,7 @@ void gs_vertexbuffer_flush(gs_vertbuffer_t *vertbuffer)
|
||||
thread_graphics->exports.gs_vertexbuffer_flush(vertbuffer);
|
||||
}
|
||||
|
||||
struct gs_vb_data *gs_vertexbuffer_get_data(gs_vertbuffer_t *vertbuffer)
|
||||
struct gs_vb_data *gs_vertexbuffer_get_data(const gs_vertbuffer_t *vertbuffer)
|
||||
{
|
||||
if (!thread_graphics || !vertbuffer) return NULL;
|
||||
|
||||
@@ -1901,14 +1903,14 @@ void gs_indexbuffer_flush(gs_indexbuffer_t *indexbuffer)
|
||||
thread_graphics->exports.gs_indexbuffer_flush(indexbuffer);
|
||||
}
|
||||
|
||||
void *gs_indexbuffer_get_data(gs_indexbuffer_t *indexbuffer)
|
||||
void *gs_indexbuffer_get_data(const gs_indexbuffer_t *indexbuffer)
|
||||
{
|
||||
if (!thread_graphics || !indexbuffer) return NULL;
|
||||
|
||||
return thread_graphics->exports.gs_indexbuffer_get_data(indexbuffer);
|
||||
}
|
||||
|
||||
size_t gs_indexbuffer_get_num_indices(gs_indexbuffer_t *indexbuffer)
|
||||
size_t gs_indexbuffer_get_num_indices(const gs_indexbuffer_t *indexbuffer)
|
||||
{
|
||||
if (!thread_graphics || !indexbuffer) return 0;
|
||||
|
||||
@@ -1916,7 +1918,7 @@ size_t gs_indexbuffer_get_num_indices(gs_indexbuffer_t *indexbuffer)
|
||||
indexbuffer);
|
||||
}
|
||||
|
||||
enum gs_index_type gs_indexbuffer_get_type(gs_indexbuffer_t *indexbuffer)
|
||||
enum gs_index_type gs_indexbuffer_get_type(const gs_indexbuffer_t *indexbuffer)
|
||||
{
|
||||
if (!thread_graphics || !indexbuffer) return (enum gs_index_type)0;
|
||||
|
||||
|
@@ -292,16 +292,16 @@ enum gs_shader_type {
|
||||
|
||||
EXPORT void gs_shader_destroy(gs_shader_t *shader);
|
||||
|
||||
EXPORT int gs_shader_get_num_params(gs_shader_t *shader);
|
||||
EXPORT int gs_shader_get_num_params(const gs_shader_t *shader);
|
||||
EXPORT gs_sparam_t *gs_shader_get_param_by_idx(gs_shader_t *shader,
|
||||
uint32_t param);
|
||||
EXPORT gs_sparam_t *gs_shader_get_param_by_name(gs_shader_t *shader,
|
||||
const char *name);
|
||||
|
||||
EXPORT gs_sparam_t *gs_shader_get_viewproj_matrix(gs_shader_t *shader);
|
||||
EXPORT gs_sparam_t *gs_shader_get_world_matrix(gs_shader_t *shader);
|
||||
EXPORT gs_sparam_t *gs_shader_get_viewproj_matrix(const gs_shader_t *shader);
|
||||
EXPORT gs_sparam_t *gs_shader_get_world_matrix(const gs_shader_t *shader);
|
||||
|
||||
EXPORT void gs_shader_get_param_info(gs_sparam_t *param,
|
||||
EXPORT void gs_shader_get_param_info(const gs_sparam_t *param,
|
||||
struct gs_shader_param_info *info);
|
||||
EXPORT void gs_shader_set_bool(gs_sparam_t *param, bool val);
|
||||
EXPORT void gs_shader_set_float(gs_sparam_t *param, float val);
|
||||
@@ -339,7 +339,7 @@ struct gs_effect_param_info {
|
||||
|
||||
EXPORT void gs_effect_destroy(gs_effect_t *effect);
|
||||
|
||||
EXPORT gs_technique_t *gs_effect_get_technique(gs_effect_t *effect,
|
||||
EXPORT gs_technique_t *gs_effect_get_technique(const gs_effect_t *effect,
|
||||
const char *name);
|
||||
|
||||
EXPORT size_t gs_technique_begin(gs_technique_t *technique);
|
||||
@@ -349,18 +349,19 @@ EXPORT bool gs_technique_begin_pass_by_name(gs_technique_t *technique,
|
||||
const char *name);
|
||||
EXPORT void gs_technique_end_pass(gs_technique_t *technique);
|
||||
|
||||
EXPORT size_t gs_effect_get_num_params(gs_effect_t *effect);
|
||||
EXPORT gs_eparam_t *gs_effect_get_param_by_idx(gs_effect_t *effect, size_t param);
|
||||
EXPORT gs_eparam_t *gs_effect_get_param_by_name(gs_effect_t *effect,
|
||||
EXPORT size_t gs_effect_get_num_params(const gs_effect_t *effect);
|
||||
EXPORT gs_eparam_t *gs_effect_get_param_by_idx(const gs_effect_t *effect,
|
||||
size_t param);
|
||||
EXPORT gs_eparam_t *gs_effect_get_param_by_name(const gs_effect_t *effect,
|
||||
const char *name);
|
||||
|
||||
/** used internally */
|
||||
EXPORT void gs_effect_update_params(gs_effect_t *effect);
|
||||
|
||||
EXPORT gs_eparam_t *gs_effect_get_viewproj_matrix(gs_effect_t *effect);
|
||||
EXPORT gs_eparam_t *gs_effect_get_world_matrix(gs_effect_t *effect);
|
||||
EXPORT gs_eparam_t *gs_effect_get_viewproj_matrix(const gs_effect_t *effect);
|
||||
EXPORT gs_eparam_t *gs_effect_get_world_matrix(const gs_effect_t *effect);
|
||||
|
||||
EXPORT void gs_effect_get_param_info(gs_eparam_t *param,
|
||||
EXPORT void gs_effect_get_param_info(const gs_eparam_t *param,
|
||||
struct gs_effect_param_info *info);
|
||||
EXPORT void gs_effect_set_bool(gs_eparam_t *param, bool val);
|
||||
EXPORT void gs_effect_set_float(gs_eparam_t *param, float val);
|
||||
@@ -385,7 +386,7 @@ EXPORT bool gs_texrender_begin(gs_texrender_t *texrender, uint32_t cx,
|
||||
uint32_t cy);
|
||||
EXPORT void gs_texrender_end(gs_texrender_t *texrender);
|
||||
EXPORT void gs_texrender_reset(gs_texrender_t *texrender);
|
||||
EXPORT gs_texture_t *gs_texrender_get_texture(gs_texrender_t *texrender);
|
||||
EXPORT gs_texture_t *gs_texrender_get_texture(const gs_texrender_t *texrender);
|
||||
|
||||
/* ---------------------------------------------------
|
||||
* graphics subsystem
|
||||
@@ -432,7 +433,7 @@ EXPORT const char *gs_get_device_name(void);
|
||||
EXPORT int gs_get_device_type(void);
|
||||
|
||||
EXPORT int gs_create(graphics_t **graphics, const char *module,
|
||||
struct gs_init_data *data);
|
||||
const struct gs_init_data *data);
|
||||
EXPORT void gs_destroy(graphics_t *graphics);
|
||||
|
||||
EXPORT void gs_enter_context(graphics_t *graphics);
|
||||
@@ -522,7 +523,7 @@ EXPORT void gs_reset_blend_state(void);
|
||||
/* -------------------------- */
|
||||
/* library-specific functions */
|
||||
|
||||
EXPORT gs_swapchain_t *gs_swapchain_create(struct gs_init_data *data);
|
||||
EXPORT gs_swapchain_t *gs_swapchain_create(const struct gs_init_data *data);
|
||||
|
||||
EXPORT void gs_resize(uint32_t x, uint32_t y);
|
||||
EXPORT void gs_get_size(uint32_t *x, uint32_t *y);
|
||||
@@ -545,7 +546,8 @@ EXPORT gs_zstencil_t *gs_zstencil_create(uint32_t width, uint32_t height,
|
||||
EXPORT gs_stagesurf_t *gs_stagesurface_create(uint32_t width, uint32_t height,
|
||||
enum gs_color_format color_format);
|
||||
|
||||
EXPORT gs_samplerstate_t *gs_samplerstate_create(struct gs_sampler_info *info);
|
||||
EXPORT gs_samplerstate_t *gs_samplerstate_create(
|
||||
const struct gs_sampler_info *info);
|
||||
|
||||
EXPORT gs_shader_t *gs_vertexshader_create(const char *shader,
|
||||
const char *file, char **error_string);
|
||||
@@ -557,7 +559,7 @@ EXPORT gs_vertbuffer_t *gs_vertexbuffer_create(struct gs_vb_data *data,
|
||||
EXPORT gs_indexbuffer_t *gs_indexbuffer_create(enum gs_index_type type,
|
||||
void *indices, size_t num, uint32_t flags);
|
||||
|
||||
EXPORT enum gs_texture_type gs_get_texture_type(gs_texture_t *texture);
|
||||
EXPORT enum gs_texture_type gs_get_texture_type(const gs_texture_t *texture);
|
||||
|
||||
EXPORT void gs_load_vertexbuffer(gs_vertbuffer_t *vertbuffer);
|
||||
EXPORT void gs_load_indexbuffer(gs_indexbuffer_t *indexbuffer);
|
||||
@@ -595,7 +597,7 @@ EXPORT void gs_end_scene(void);
|
||||
#define GS_CLEAR_STENCIL (1<<2)
|
||||
|
||||
EXPORT void gs_load_swapchain(gs_swapchain_t *swapchain);
|
||||
EXPORT void gs_clear(uint32_t clear_flags, struct vec4 *color,
|
||||
EXPORT void gs_clear(uint32_t clear_flags, const struct vec4 *color,
|
||||
float depth, uint8_t stencil);
|
||||
EXPORT void gs_present(void);
|
||||
EXPORT void gs_flush(void);
|
||||
@@ -621,7 +623,7 @@ EXPORT void gs_stencil_op(enum gs_stencil_side side,
|
||||
|
||||
EXPORT void gs_set_viewport(int x, int y, int width, int height);
|
||||
EXPORT void gs_get_viewport(struct gs_rect *rect);
|
||||
EXPORT void gs_set_scissor_rect(struct gs_rect *rect);
|
||||
EXPORT void gs_set_scissor_rect(const struct gs_rect *rect);
|
||||
|
||||
EXPORT void gs_ortho(float left, float right, float top, float bottom,
|
||||
float znear, float zfar);
|
||||
@@ -634,16 +636,17 @@ EXPORT void gs_projection_pop(void);
|
||||
EXPORT void gs_swapchain_destroy(gs_swapchain_t *swapchain);
|
||||
|
||||
EXPORT void gs_texture_destroy(gs_texture_t *tex);
|
||||
EXPORT uint32_t gs_texture_get_width(gs_texture_t *tex);
|
||||
EXPORT uint32_t gs_texture_get_height(gs_texture_t *tex);
|
||||
EXPORT enum gs_color_format gs_texture_get_color_format(gs_texture_t *tex);
|
||||
EXPORT uint32_t gs_texture_get_width(const gs_texture_t *tex);
|
||||
EXPORT uint32_t gs_texture_get_height(const gs_texture_t *tex);
|
||||
EXPORT enum gs_color_format gs_texture_get_color_format(
|
||||
const gs_texture_t *tex);
|
||||
EXPORT bool gs_texture_map(gs_texture_t *tex, uint8_t **ptr,
|
||||
uint32_t *linesize);
|
||||
EXPORT void gs_texture_unmap(gs_texture_t *tex);
|
||||
/** special-case function (GL only) - specifies whether the texture is a
|
||||
* GL_TEXTURE_RECTANGLE type, which doesn't use normalized texture
|
||||
* coordinates, doesn't support mipmapping, and requires address clamping */
|
||||
EXPORT bool gs_texture_is_rect(gs_texture_t *tex);
|
||||
EXPORT bool gs_texture_is_rect(const gs_texture_t *tex);
|
||||
/**
|
||||
* Gets a pointer to the context-specific object associated with the texture.
|
||||
* For example, for GL, this is a GLuint*. For D3D11, ID3D11Texture2D*.
|
||||
@@ -651,22 +654,22 @@ EXPORT bool gs_texture_is_rect(gs_texture_t *tex);
|
||||
EXPORT void *gs_texture_get_obj(gs_texture_t *tex);
|
||||
|
||||
EXPORT void gs_cubetexture_destroy(gs_texture_t *cubetex);
|
||||
EXPORT uint32_t gs_cubetexture_get_size(gs_texture_t *cubetex);
|
||||
EXPORT uint32_t gs_cubetexture_get_size(const gs_texture_t *cubetex);
|
||||
EXPORT enum gs_color_format gs_cubetexture_get_color_format(
|
||||
gs_texture_t *cubetex);
|
||||
const gs_texture_t *cubetex);
|
||||
|
||||
EXPORT void gs_voltexture_destroy(gs_texture_t *voltex);
|
||||
EXPORT uint32_t gs_voltexture_get_width(gs_texture_t *voltex);
|
||||
EXPORT uint32_t gs_voltexture_get_height(gs_texture_t *voltex);
|
||||
EXPORT uint32_t gs_voltexture_getdepth(gs_texture_t *voltex);
|
||||
EXPORT uint32_t gs_voltexture_get_width(const gs_texture_t *voltex);
|
||||
EXPORT uint32_t gs_voltexture_get_height(const gs_texture_t *voltex);
|
||||
EXPORT uint32_t gs_voltexture_getdepth(const gs_texture_t *voltex);
|
||||
EXPORT enum gs_color_format gs_voltexture_get_color_format(
|
||||
gs_texture_t *voltex);
|
||||
const gs_texture_t *voltex);
|
||||
|
||||
EXPORT void gs_stagesurface_destroy(gs_stagesurf_t *stagesurf);
|
||||
EXPORT uint32_t gs_stagesurface_get_width(gs_stagesurf_t *stagesurf);
|
||||
EXPORT uint32_t gs_stagesurface_get_height(gs_stagesurf_t *stagesurf);
|
||||
EXPORT uint32_t gs_stagesurface_get_width(const gs_stagesurf_t *stagesurf);
|
||||
EXPORT uint32_t gs_stagesurface_get_height(const gs_stagesurf_t *stagesurf);
|
||||
EXPORT enum gs_color_format gs_stagesurface_get_color_format(
|
||||
gs_stagesurf_t *stagesurf);
|
||||
const gs_stagesurf_t *stagesurf);
|
||||
EXPORT bool gs_stagesurface_map(gs_stagesurf_t *stagesurf, uint8_t **data,
|
||||
uint32_t *linesize);
|
||||
EXPORT void gs_stagesurface_unmap(gs_stagesurf_t *stagesurf);
|
||||
@@ -677,14 +680,16 @@ EXPORT void gs_samplerstate_destroy(gs_samplerstate_t *samplerstate);
|
||||
|
||||
EXPORT void gs_vertexbuffer_destroy(gs_vertbuffer_t *vertbuffer);
|
||||
EXPORT void gs_vertexbuffer_flush(gs_vertbuffer_t *vertbuffer);
|
||||
EXPORT struct gs_vb_data *gs_vertexbuffer_get_data(gs_vertbuffer_t *vertbuffer);
|
||||
EXPORT struct gs_vb_data *gs_vertexbuffer_get_data(
|
||||
const gs_vertbuffer_t *vertbuffer);
|
||||
|
||||
EXPORT void gs_indexbuffer_destroy(gs_indexbuffer_t *indexbuffer);
|
||||
EXPORT void gs_indexbuffer_flush(gs_indexbuffer_t *indexbuffer);
|
||||
EXPORT void *gs_indexbuffer_get_data(gs_indexbuffer_t *indexbuffer);
|
||||
EXPORT size_t gs_indexbuffer_get_num_indices(gs_indexbuffer_t *indexbuffer);
|
||||
EXPORT void *gs_indexbuffer_get_data(const gs_indexbuffer_t *indexbuffer);
|
||||
EXPORT size_t gs_indexbuffer_get_num_indices(
|
||||
const gs_indexbuffer_t *indexbuffer);
|
||||
EXPORT enum gs_index_type gs_indexbuffer_get_type(
|
||||
gs_indexbuffer_t *indexbuffer);
|
||||
const gs_indexbuffer_t *indexbuffer);
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
|
@@ -139,7 +139,7 @@ void gs_texrender_reset(gs_texrender_t *texrender)
|
||||
texrender->rendered = false;
|
||||
}
|
||||
|
||||
gs_texture_t *gs_texrender_get_texture(gs_texrender_t *texrender)
|
||||
gs_texture_t *gs_texrender_get_texture(const gs_texrender_t *texrender)
|
||||
{
|
||||
return texrender ? texrender->target : NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user