(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:
@@ -34,7 +34,7 @@ struct gl_platform {
|
||||
struct gs_swap_chain swap;
|
||||
};
|
||||
|
||||
static NSOpenGLContext *gl_context_create(struct gs_init_data *info)
|
||||
static NSOpenGLContext *gl_context_create(const struct gs_init_data *info)
|
||||
{
|
||||
unsigned attrib_count = 0;
|
||||
|
||||
@@ -97,7 +97,7 @@ static NSOpenGLContext *gl_context_create(struct gs_init_data *info)
|
||||
}
|
||||
|
||||
static bool gl_init_default_swap(struct gl_platform *plat, gs_device_t *dev,
|
||||
struct gs_init_data *info)
|
||||
const struct gs_init_data *info)
|
||||
{
|
||||
if(!(plat->context = gl_context_create(info)))
|
||||
return false;
|
||||
@@ -110,7 +110,7 @@ static bool gl_init_default_swap(struct gl_platform *plat, gs_device_t *dev,
|
||||
}
|
||||
|
||||
struct gl_platform *gl_platform_create(gs_device_t *device,
|
||||
struct gs_init_data *info)
|
||||
const struct gs_init_data *info)
|
||||
{
|
||||
struct gl_platform *plat = bzalloc(sizeof(struct gl_platform));
|
||||
|
||||
@@ -161,7 +161,7 @@ void gl_platform_cleanup_swapchain(struct gs_swap_chain *swap)
|
||||
UNUSED_PARAMETER(swap);
|
||||
}
|
||||
|
||||
struct gl_windowinfo *gl_windowinfo_create(struct gs_init_data *info)
|
||||
struct gl_windowinfo *gl_windowinfo_create(const struct gs_init_data *info)
|
||||
{
|
||||
if(!info)
|
||||
return NULL;
|
||||
@@ -220,7 +220,7 @@ void device_present(gs_device_t *device)
|
||||
[device->plat->context flushBuffer];
|
||||
}
|
||||
|
||||
void gl_getclientsize(struct gs_swap_chain *swap, uint32_t *width,
|
||||
void gl_getclientsize(const struct gs_swap_chain *swap, uint32_t *width,
|
||||
uint32_t *height)
|
||||
{
|
||||
if(width) *width = swap->info.cx;
|
||||
|
@@ -86,17 +86,17 @@ fail:
|
||||
blog(LOG_ERROR, "gs_indexbuffer_flush (GL) failed");
|
||||
}
|
||||
|
||||
void *gs_indexbuffer_get_data(gs_indexbuffer_t *ib)
|
||||
void *gs_indexbuffer_get_data(const gs_indexbuffer_t *ib)
|
||||
{
|
||||
return ib->data;
|
||||
}
|
||||
|
||||
size_t gs_indexbuffer_get_num_indices(gs_indexbuffer_t *ib)
|
||||
size_t gs_indexbuffer_get_num_indices(const gs_indexbuffer_t *ib)
|
||||
{
|
||||
return ib->num;
|
||||
}
|
||||
|
||||
enum gs_index_type gs_indexbuffer_get_type(gs_indexbuffer_t *ib)
|
||||
enum gs_index_type gs_indexbuffer_get_type(const gs_indexbuffer_t *ib)
|
||||
{
|
||||
return ib->type;
|
||||
}
|
||||
|
@@ -338,7 +338,7 @@ void gs_shader_destroy(gs_shader_t *shader)
|
||||
bfree(shader);
|
||||
}
|
||||
|
||||
int gs_shader_get_num_params(gs_shader_t *shader)
|
||||
int gs_shader_get_num_params(const gs_shader_t *shader)
|
||||
{
|
||||
return (int)shader->params.num;
|
||||
}
|
||||
@@ -362,17 +362,17 @@ gs_sparam_t *gs_shader_get_param_by_name(gs_shader_t *shader, const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return shader->viewproj;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return shader->world;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
info->type = param->type;
|
||||
|
@@ -186,17 +186,18 @@ failed:
|
||||
|
||||
#endif
|
||||
|
||||
uint32_t gs_stagesurface_get_width(gs_stagesurf_t *stagesurf)
|
||||
uint32_t gs_stagesurface_get_width(const gs_stagesurf_t *stagesurf)
|
||||
{
|
||||
return stagesurf->width;
|
||||
}
|
||||
|
||||
uint32_t gs_stagesurface_get_height(gs_stagesurf_t *stagesurf)
|
||||
uint32_t gs_stagesurface_get_height(const gs_stagesurf_t *stagesurf)
|
||||
{
|
||||
return stagesurf->height;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return stagesurf->format;
|
||||
}
|
||||
|
@@ -147,7 +147,7 @@ static void clear_textures(struct gs_device *device)
|
||||
}
|
||||
|
||||
void convert_sampler_info(struct gs_sampler_state *sampler,
|
||||
struct gs_sampler_info *info)
|
||||
const struct gs_sampler_info *info)
|
||||
{
|
||||
GLint max_anisotropy_max;
|
||||
convert_filter(info->filter, &sampler->min_filter,
|
||||
@@ -191,7 +191,7 @@ const char *device_preprocessor_name(void)
|
||||
return "_OPENGL";
|
||||
}
|
||||
|
||||
int device_create(gs_device_t **p_device, struct gs_init_data *info)
|
||||
int device_create(gs_device_t **p_device, const struct gs_init_data *info)
|
||||
{
|
||||
struct gs_device *device = bzalloc(sizeof(struct gs_device));
|
||||
int errorcode = GS_ERROR_FAIL;
|
||||
@@ -240,7 +240,7 @@ void device_destroy(gs_device_t *device)
|
||||
}
|
||||
|
||||
gs_swapchain_t *device_swapchain_create(gs_device_t *device,
|
||||
struct gs_init_data *info)
|
||||
const struct gs_init_data *info)
|
||||
{
|
||||
struct gs_swap_chain *swap = bzalloc(sizeof(struct gs_swap_chain));
|
||||
|
||||
@@ -271,18 +271,18 @@ void device_resize(gs_device_t *device, uint32_t cx, uint32_t cy)
|
||||
gl_update(device);
|
||||
}
|
||||
|
||||
void device_get_size(gs_device_t *device, uint32_t *cx, uint32_t *cy)
|
||||
void device_get_size(const gs_device_t *device, uint32_t *cx, uint32_t *cy)
|
||||
{
|
||||
*cx = device->cur_swap->info.cx;
|
||||
*cy = device->cur_swap->info.cy;
|
||||
}
|
||||
|
||||
uint32_t device_get_width(gs_device_t *device)
|
||||
uint32_t device_get_width(const gs_device_t *device)
|
||||
{
|
||||
return device->cur_swap->info.cx;
|
||||
}
|
||||
|
||||
uint32_t device_get_height(gs_device_t *device)
|
||||
uint32_t device_get_height(const gs_device_t *device)
|
||||
{
|
||||
return device->cur_swap->info.cy;
|
||||
}
|
||||
@@ -305,7 +305,7 @@ gs_texture_t *device_voltexture_create(gs_device_t *device, uint32_t width,
|
||||
}
|
||||
|
||||
gs_samplerstate_t *device_samplerstate_create(gs_device_t *device,
|
||||
struct gs_sampler_info *info)
|
||||
const struct gs_sampler_info *info)
|
||||
{
|
||||
struct gs_sampler_state *sampler;
|
||||
|
||||
@@ -317,7 +317,7 @@ gs_samplerstate_t *device_samplerstate_create(gs_device_t *device,
|
||||
return sampler;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return texture->type;
|
||||
}
|
||||
@@ -555,22 +555,22 @@ void device_load_default_samplerstate(gs_device_t *device, bool b_3d, int unit)
|
||||
UNUSED_PARAMETER(unit);
|
||||
}
|
||||
|
||||
gs_shader_t *device_get_vertex_shader(gs_device_t *device)
|
||||
gs_shader_t *device_get_vertex_shader(const gs_device_t *device)
|
||||
{
|
||||
return device->cur_vertex_shader;
|
||||
}
|
||||
|
||||
gs_shader_t *device_get_pixel_shader(gs_device_t *device)
|
||||
gs_shader_t *device_get_pixel_shader(const gs_device_t *device)
|
||||
{
|
||||
return device->cur_pixel_shader;
|
||||
}
|
||||
|
||||
gs_texture_t *device_get_render_target(gs_device_t *device)
|
||||
gs_texture_t *device_get_render_target(const gs_device_t *device)
|
||||
{
|
||||
return device->cur_render_target;
|
||||
}
|
||||
|
||||
gs_zstencil_t *device_get_zstencil_target(gs_device_t *device)
|
||||
gs_zstencil_t *device_get_zstencil_target(const gs_device_t *device)
|
||||
{
|
||||
return device->cur_zstencil_buffer;
|
||||
}
|
||||
@@ -843,7 +843,7 @@ void device_begin_scene(gs_device_t *device)
|
||||
clear_textures(device);
|
||||
}
|
||||
|
||||
static inline bool can_render(gs_device_t *device)
|
||||
static inline bool can_render(const gs_device_t *device)
|
||||
{
|
||||
if (!device->cur_vertex_shader) {
|
||||
blog(LOG_ERROR, "No vertex shader specified");
|
||||
@@ -876,7 +876,7 @@ static void update_viewproj_matrix(struct gs_device *device)
|
||||
gs_shader_set_matrix4(vs->viewproj, &device->cur_viewproj);
|
||||
}
|
||||
|
||||
static inline struct gs_program *find_program(struct gs_device *device)
|
||||
static inline struct gs_program *find_program(const struct gs_device *device)
|
||||
{
|
||||
struct gs_program *program = device->first_program;
|
||||
|
||||
@@ -967,7 +967,7 @@ void device_end_scene(gs_device_t *device)
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
GLbitfield gl_flags = 0;
|
||||
|
||||
@@ -1018,7 +1018,7 @@ void device_set_cull_mode(gs_device_t *device, enum gs_cull_mode mode)
|
||||
gl_disable(GL_CULL_FACE);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return device->cur_cull_mode;
|
||||
}
|
||||
@@ -1124,7 +1124,7 @@ void device_stencil_op(gs_device_t *device, enum gs_stencil_side side,
|
||||
UNUSED_PARAMETER(device);
|
||||
}
|
||||
|
||||
static inline uint32_t get_target_height(struct gs_device *device)
|
||||
static inline uint32_t get_target_height(const struct gs_device *device)
|
||||
{
|
||||
if (!device->cur_render_target)
|
||||
return device_get_height(device);
|
||||
@@ -1158,12 +1158,12 @@ void device_set_viewport(gs_device_t *device, int x, int y, int width,
|
||||
device->cur_viewport.cy = height;
|
||||
}
|
||||
|
||||
void device_get_viewport(gs_device_t *device, struct gs_rect *rect)
|
||||
void device_get_viewport(const gs_device_t *device, struct gs_rect *rect)
|
||||
{
|
||||
*rect = device->cur_viewport;
|
||||
}
|
||||
|
||||
void device_set_scissor_rect(gs_device_t *device, struct gs_rect *rect)
|
||||
void device_set_scissor_rect(gs_device_t *device, const struct gs_rect *rect)
|
||||
{
|
||||
UNUSED_PARAMETER(device);
|
||||
|
||||
@@ -1268,28 +1268,28 @@ void gs_voltexture_destroy(gs_texture_t *voltex)
|
||||
UNUSED_PARAMETER(voltex);
|
||||
}
|
||||
|
||||
uint32_t gs_voltexture_get_width(gs_texture_t *voltex)
|
||||
uint32_t gs_voltexture_get_width(const gs_texture_t *voltex)
|
||||
{
|
||||
/* TODO */
|
||||
UNUSED_PARAMETER(voltex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t gs_voltexture_get_height(gs_texture_t *voltex)
|
||||
uint32_t gs_voltexture_get_height(const gs_texture_t *voltex)
|
||||
{
|
||||
/* TODO */
|
||||
UNUSED_PARAMETER(voltex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t gs_voltexture_getdepth(gs_texture_t *voltex)
|
||||
uint32_t gs_voltexture_getdepth(const gs_texture_t *voltex)
|
||||
{
|
||||
/* TODO */
|
||||
UNUSED_PARAMETER(voltex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
/* TODO */
|
||||
UNUSED_PARAMETER(voltex);
|
||||
|
@@ -270,7 +270,7 @@ static inline GLenum convert_gs_topology(enum gs_draw_mode mode)
|
||||
}
|
||||
|
||||
extern void convert_sampler_info(struct gs_sampler_state *sampler,
|
||||
struct gs_sampler_info *info);
|
||||
const struct gs_sampler_info *info);
|
||||
|
||||
struct gs_sampler_state {
|
||||
gs_device_t *device;
|
||||
@@ -510,16 +510,17 @@ extern struct fbo_info *get_fbo(struct gs_device *device,
|
||||
extern void gl_update(gs_device_t *device);
|
||||
|
||||
extern struct gl_platform *gl_platform_create(gs_device_t *device,
|
||||
struct gs_init_data *info);
|
||||
const struct gs_init_data *info);
|
||||
extern struct gs_swap_chain *gl_platform_getswap(struct gl_platform *platform);
|
||||
extern void gl_platform_destroy(struct gl_platform *platform);
|
||||
|
||||
extern bool gl_platform_init_swapchain(struct gs_swap_chain *swap);
|
||||
extern void gl_platform_cleanup_swapchain(struct gs_swap_chain *swap);
|
||||
|
||||
extern struct gl_windowinfo *gl_windowinfo_create(struct gs_init_data *info);
|
||||
extern struct gl_windowinfo *gl_windowinfo_create(
|
||||
const struct gs_init_data *info);
|
||||
extern void gl_windowinfo_destroy(struct gl_windowinfo *wi);
|
||||
|
||||
extern void gl_getclientsize(struct gs_swap_chain *swap,
|
||||
extern void gl_getclientsize(const struct gs_swap_chain *swap,
|
||||
uint32_t *width,
|
||||
uint32_t *height);
|
||||
|
@@ -112,7 +112,7 @@ fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline bool is_texture_2d(gs_texture_t *tex, const char *func)
|
||||
static inline bool is_texture_2d(const gs_texture_t *tex, const char *func)
|
||||
{
|
||||
bool is_tex2d = tex->type == GS_TEXTURE_2D;
|
||||
if (!is_tex2d)
|
||||
@@ -141,25 +141,25 @@ void gs_texture_destroy(gs_texture_t *tex)
|
||||
bfree(tex);
|
||||
}
|
||||
|
||||
uint32_t gs_texture_get_width(gs_texture_t *tex)
|
||||
uint32_t gs_texture_get_width(const gs_texture_t *tex)
|
||||
{
|
||||
struct gs_texture_2d *tex2d = (struct gs_texture_2d*)tex;
|
||||
const struct gs_texture_2d *tex2d = (const struct gs_texture_2d*)tex;
|
||||
if (!is_texture_2d(tex, "gs_texture_get_width"))
|
||||
return 0;
|
||||
|
||||
return tex2d->width;
|
||||
}
|
||||
|
||||
uint32_t gs_texture_get_height(gs_texture_t *tex)
|
||||
uint32_t gs_texture_get_height(const gs_texture_t *tex)
|
||||
{
|
||||
struct gs_texture_2d *tex2d = (struct gs_texture_2d*)tex;
|
||||
const struct gs_texture_2d *tex2d = (const struct gs_texture_2d*)tex;
|
||||
if (!is_texture_2d(tex, "gs_texture_get_height"))
|
||||
return 0;
|
||||
|
||||
return tex2d->height;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return tex->format;
|
||||
}
|
||||
@@ -226,9 +226,9 @@ failed:
|
||||
blog(LOG_ERROR, "gs_texture_unmap (GL) failed");
|
||||
}
|
||||
|
||||
bool gs_texture_is_rect(gs_texture_t *tex)
|
||||
bool gs_texture_is_rect(const gs_texture_t *tex)
|
||||
{
|
||||
struct gs_texture_2d *tex2d = (struct gs_texture_2d*)tex;
|
||||
const struct gs_texture_2d *tex2d = (const struct gs_texture_2d*)tex;
|
||||
if (!is_texture_2d(tex, "gs_texture_unmap")) {
|
||||
blog(LOG_ERROR, "gs_texture_is_rect (GL) failed");
|
||||
return false;
|
||||
|
@@ -100,7 +100,7 @@ void gs_cubetexture_destroy(gs_texture_t *tex)
|
||||
bfree(tex);
|
||||
}
|
||||
|
||||
static inline bool is_texture_cube(gs_texture_t *tex, const char *func)
|
||||
static inline bool is_texture_cube(const gs_texture_t *tex, const char *func)
|
||||
{
|
||||
bool is_texcube = tex->type == GS_TEXTURE_CUBE;
|
||||
if (!is_texcube)
|
||||
@@ -108,16 +108,19 @@ static inline bool is_texture_cube(gs_texture_t *tex, const char *func)
|
||||
return is_texcube;
|
||||
}
|
||||
|
||||
uint32_t gs_cubetexture_get_size(gs_texture_t *cubetex)
|
||||
uint32_t gs_cubetexture_get_size(const gs_texture_t *cubetex)
|
||||
{
|
||||
struct gs_texture_cube *cube = (struct gs_texture_cube*)cubetex;
|
||||
const struct gs_texture_cube *cube =
|
||||
(const struct gs_texture_cube*)cubetex;
|
||||
|
||||
if (!is_texture_cube(cubetex, "gs_cubetexture_get_size"))
|
||||
return 0;
|
||||
|
||||
return cube->size;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return cubetex->format;
|
||||
}
|
||||
|
@@ -170,7 +170,7 @@ failed:
|
||||
blog(LOG_ERROR, "gs_vertexbuffer_flush (GL) failed");
|
||||
}
|
||||
|
||||
struct gs_vb_data *gs_vertexbuffer_get_data(gs_vertbuffer_t *vb)
|
||||
struct gs_vb_data *gs_vertexbuffer_get_data(const gs_vertbuffer_t *vb)
|
||||
{
|
||||
return vb->data;
|
||||
}
|
||||
|
@@ -267,7 +267,7 @@ static inline void add_attrib(struct darray *list, int attrib, int val)
|
||||
}
|
||||
|
||||
/* Creates the real pixel format for the target window */
|
||||
static int gl_choose_pixel_format(HDC hdc, struct gs_init_data *info)
|
||||
static int gl_choose_pixel_format(HDC hdc, const struct gs_init_data *info)
|
||||
{
|
||||
struct darray attribs;
|
||||
int color_bits = get_color_format_bits(info->format);
|
||||
@@ -307,7 +307,7 @@ static int gl_choose_pixel_format(HDC hdc, struct gs_init_data *info)
|
||||
return format;
|
||||
}
|
||||
|
||||
static inline bool gl_getpixelformat(HDC hdc, struct gs_init_data *info,
|
||||
static inline bool gl_getpixelformat(HDC hdc, const struct gs_init_data *info,
|
||||
int *format, PIXELFORMATDESCRIPTOR *pfd)
|
||||
{
|
||||
if (!format)
|
||||
@@ -335,7 +335,7 @@ static inline bool gl_setpixelformat(HDC hdc, int format,
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct gl_windowinfo *gl_windowinfo_bare(struct gs_init_data *info)
|
||||
static struct gl_windowinfo *gl_windowinfo_bare(const struct gs_init_data *info)
|
||||
{
|
||||
struct gl_windowinfo *wi = bzalloc(sizeof(struct gl_windowinfo));
|
||||
wi->hwnd = info->window.hwnd;
|
||||
@@ -352,7 +352,7 @@ static struct gl_windowinfo *gl_windowinfo_bare(struct gs_init_data *info)
|
||||
|
||||
static bool init_default_swap(struct gl_platform *plat, gs_device_t *device,
|
||||
int pixel_format, PIXELFORMATDESCRIPTOR *pfd,
|
||||
struct gs_init_data *info)
|
||||
const struct gs_init_data *info)
|
||||
{
|
||||
plat->swap.device = device;
|
||||
plat->swap.info = *info;
|
||||
@@ -373,7 +373,7 @@ void gl_update(gs_device_t *device)
|
||||
}
|
||||
|
||||
struct gl_platform *gl_platform_create(gs_device_t *device,
|
||||
struct gs_init_data *info)
|
||||
const struct gs_init_data *info)
|
||||
{
|
||||
struct gl_platform *plat = bzalloc(sizeof(struct gl_platform));
|
||||
struct dummy_context dummy;
|
||||
@@ -444,7 +444,7 @@ void gl_platform_cleanup_swapchain(struct gs_swap_chain *swap)
|
||||
UNUSED_PARAMETER(swap);
|
||||
}
|
||||
|
||||
struct gl_windowinfo *gl_windowinfo_create(struct gs_init_data *info)
|
||||
struct gl_windowinfo *gl_windowinfo_create(const struct gs_init_data *info)
|
||||
{
|
||||
struct gl_windowinfo *wi = gl_windowinfo_bare(info);
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
@@ -519,7 +519,7 @@ void device_present(gs_device_t *device)
|
||||
}
|
||||
}
|
||||
|
||||
extern void gl_getclientsize(struct gs_swap_chain *swap,
|
||||
extern void gl_getclientsize(const struct gs_swap_chain *swap,
|
||||
uint32_t *width, uint32_t *height)
|
||||
{
|
||||
RECT rc;
|
||||
|
@@ -61,7 +61,8 @@ extern struct gs_swap_chain *gl_platform_getswap(struct gl_platform *platform)
|
||||
return &platform->swap;
|
||||
}
|
||||
|
||||
extern struct gl_windowinfo *gl_windowinfo_create(struct gs_init_data *info)
|
||||
extern struct gl_windowinfo *gl_windowinfo_create(
|
||||
const struct gs_init_data *info)
|
||||
{
|
||||
struct gl_windowinfo *wi = bzalloc(sizeof(struct gl_windowinfo));
|
||||
wi->id = info->window.id;
|
||||
@@ -75,7 +76,7 @@ extern void gl_windowinfo_destroy(struct gl_windowinfo *wi)
|
||||
bfree(wi);
|
||||
}
|
||||
|
||||
extern void gl_getclientsize(struct gs_swap_chain *swap,
|
||||
extern void gl_getclientsize(const struct gs_swap_chain *swap,
|
||||
uint32_t *width, uint32_t *height)
|
||||
{
|
||||
XWindowAttributes info = { 0 };
|
||||
@@ -86,7 +87,7 @@ extern void gl_getclientsize(struct gs_swap_chain *swap,
|
||||
*width = info.width;
|
||||
}
|
||||
|
||||
static void print_info_stuff(struct gs_init_data *info)
|
||||
static void print_info_stuff(const struct gs_init_data *info)
|
||||
{
|
||||
blog( LOG_INFO,
|
||||
"X and Y: %i %i\n"
|
||||
@@ -136,7 +137,7 @@ static bool handle_x_error(Display *disp, const char *error_string)
|
||||
}
|
||||
|
||||
struct gl_platform *gl_platform_create(gs_device_t *device,
|
||||
struct gs_init_data *info)
|
||||
const struct gs_init_data *info)
|
||||
{
|
||||
int num_configs = 0;
|
||||
int error_base = 0, event_base = 0;
|
||||
|
Reference in New Issue
Block a user