 |
Open Broadcaster Software
Free, open source software for live streaming and recording
|
Go to the documentation of this file.
20 #include "../util/bmem.h"
23 #include <objc/objc-runtime.h>
37 #define GS_MAX_TEXTURES 8
202 static inline struct gs_vb_data *gs_vbdata_create(
void)
207 static inline void gs_vbdata_destroy(
struct gs_vb_data *data)
217 for (i = 0; i < data->
num_tex; i++)
249 struct gs_stage_surface;
250 struct gs_zstencil_buffer;
251 struct gs_vertex_buffer;
252 struct gs_index_buffer;
253 struct gs_sampler_state;
255 struct gs_swap_chain;
258 struct gs_shader_param;
454 #define GS_BUILD_MIPMAPS (1 << 0)
455 #define GS_DYNAMIC (1 << 1)
456 #define GS_RENDER_TARGET (1 << 2)
457 #define GS_GL_DUMMYTEX (1 << 3)
458 #define GS_DUP_BUFFER \
461 #define GS_SHARED_TEX (1 << 5)
462 #define GS_SHARED_KM_TEX (1 << 6)
468 #define GS_ERROR_FAIL -1
469 #define GS_ERROR_MODULE_NOT_FOUND -2
470 #define GS_ERROR_NOT_SUPPORTED -3
475 #elif defined(__APPLE__)
476 __unsafe_unretained
id view;
477 #elif defined(__linux__) || defined(__FreeBSD__)
493 #define GS_DEVICE_OPENGL 1
494 #define GS_DEVICE_DIRECT3D_11 2
544 char **error_string);
546 const char *filename,
char **error_string);
549 char **error_string);
551 char **error_string);
556 uint32_t *cx, uint32_t *cy);
558 #define GS_FLIP_U (1 << 0)
559 #define GS_FLIP_V (1 << 1)
572 uint32_t x, uint32_t y, uint32_t cx,
576 float left,
float right,
float top,
577 float bottom,
float znear);
591 uint32_t linesize,
bool invert);
593 const void *data, uint32_t linesize,
614 uint32_t levels,
const uint8_t **data,
618 uint32_t levels,
const uint8_t **data, uint32_t flags);
622 uint32_t levels,
const uint8_t **data,
636 char **error_string);
638 char **error_string);
643 void *indices,
size_t num,
673 uint32_t src_x, uint32_t src_y,
674 uint32_t src_w, uint32_t src_h);
683 #define GS_CLEAR_COLOR (1 << 0)
684 #define GS_CLEAR_DEPTH (1 << 1)
685 #define GS_CLEAR_STENCIL (1 << 2)
689 float depth, uint8_t stencil);
720 EXPORT void gs_ortho(
float left,
float right,
float top,
float bottom,
721 float znear,
float zfar);
723 float znear,
float zfar);
798 uint64_t *frequency);
802 #define GS_USE_DEBUG_MARKERS 0
803 #if GS_USE_DEBUG_MARKERS
804 static const float GS_DEBUG_COLOR_DEFAULT[] = {0.5f, 0.5f, 0.5f, 1.0f};
805 static const float GS_DEBUG_COLOR_RENDER_VIDEO[] = {0.0f, 0.5f, 0.0f, 1.0f};
806 static const float GS_DEBUG_COLOR_MAIN_TEXTURE[] = {0.0f, 0.25f, 0.0f, 1.0f};
807 static const float GS_DEBUG_COLOR_DISPLAY[] = {0.0f, 0.5f, 0.5f, 1.0f};
808 static const float GS_DEBUG_COLOR_SOURCE[] = {0.0f, 0.5f, 5.0f, 1.0f};
809 static const float GS_DEBUG_COLOR_ITEM[] = {0.5f, 0.0f, 0.0f, 1.0f};
810 static const float GS_DEBUG_COLOR_ITEM_TEXTURE[] = {0.25f, 0.0f, 0.0f, 1.0f};
811 static const float GS_DEBUG_COLOR_CONVERT_FORMAT[] = {0.5f, 0.5f, 0.0f, 1.0f};
812 #define GS_DEBUG_MARKER_BEGIN(color, markername) \
813 gs_debug_marker_begin(color, markername)
814 #define GS_DEBUG_MARKER_BEGIN_FORMAT(color, format, ...) \
815 gs_debug_marker_begin_format(color, format, __VA_ARGS__)
816 #define GS_DEBUG_MARKER_END() gs_debug_marker_end()
818 #define GS_DEBUG_MARKER_BEGIN(color, markername) ((void)0)
819 #define GS_DEBUG_MARKER_BEGIN_FORMAT(color, format, ...) ((void)0)
820 #define GS_DEBUG_MARKER_END() ((void)0)
825 const char *format, ...);
837 EXPORT bool gs_gdi_texture_available(
void);
838 EXPORT bool gs_shared_texture_available(
void);
840 struct gs_duplicator;
841 typedef struct gs_duplicator gs_duplicator_t;
848 gs_get_duplicator_monitor_info(
int monitor_idx,
852 EXPORT gs_duplicator_t *gs_duplicator_create(
int monitor_idx);
853 EXPORT void gs_duplicator_destroy(gs_duplicator_t *duplicator);
855 EXPORT bool gs_duplicator_update_frame(gs_duplicator_t *duplicator);
867 #define GS_INVALID_HANDLE (uint32_t) - 1
870 #define GS_WAIT_INFINITE (uint32_t) - 1
886 uint32_t width, uint32_t height,
893 EXPORT void gs_unregister_loss_callbacks(
void *data);
945 static inline bool gs_is_compressed_format(
enum gs_color_format format)
950 static inline uint32_t gs_get_total_levels(uint32_t width, uint32_t height,
953 uint32_t size = width > height ? width : height;
954 size = size > depth ? size : depth;
955 uint32_t num_levels = 1;
@ GS_R8G8
Definition: graphics.h:75
@ GS_FILTER_MIN_POINT_MAG_MIP_LINEAR
Definition: graphics.h:152
Definition: graphics.h:232
EXPORT graphics_t * gs_get_context(void)
struct gs_vertex_buffer gs_vertbuffer_t
Definition: graphics.h:269
EXPORT void gs_stage_texture(gs_stagesurf_t *dst, gs_texture_t *src)
EXPORT void gs_technique_end(gs_technique_t *technique)
EXPORT void gs_stencil_function(enum gs_stencil_side side, enum gs_depth_test test)
EXPORT void gs_depth_function(enum gs_depth_test test)
EXPORT void gs_enable_stencil_write(bool enable)
@ GS_BLEND_ONE
Definition: graphics.h:99
EXPORT void gs_timer_range_begin(gs_timer_range_t *range)
struct gs_stage_surface gs_stagesurf_t
Definition: graphics.h:267
EXPORT void gs_technique_end_pass(gs_technique_t *technique)
struct gs_device gs_device_t
Definition: graphics.h:282
EXPORT bool gs_texrender_begin(gs_texrender_t *texrender, uint32_t cx, uint32_t cy)
gs_zstencil_format
Definition: graphics.h:78
EXPORT void gs_set_3d_mode(double fovy, double znear, double zvar)
int cy
Definition: graphics.h:243
EXPORT void gs_debug_marker_begin_format(const float color[4], const char *format,...)
@ GS_BLEND_INVSRCALPHA
Definition: graphics.h:103
@ GS_RGBA16
Definition: graphics.h:64
@ GS_SHADER_PARAM_VEC4
Definition: graphics.h:297
long y
Definition: graphics.h:181
@ GS_SHADER_PIXEL
Definition: graphics.h:313
EXPORT void gs_texrender_destroy(gs_texrender_t *texrender)
EXPORT void gs_resize(uint32_t x, uint32_t y)
@ GS_SHADER_PARAM_FLOAT
Definition: graphics.h:292
EXPORT gs_stagesurf_t * gs_stagesurface_create(uint32_t width, uint32_t height, enum gs_color_format color_format)
EXPORT int gs_create(graphics_t **graphics, const char *module, uint32_t adapter)
int cx
Definition: graphics.h:242
EXPORT void gs_texrender_end(gs_texrender_t *texrender)
EXPORT void gs_draw_cube_backdrop(gs_texture_t *cubetex, const struct quat *rot, float left, float right, float top, float bottom, float znear)
EXPORT void gs_vertex3f(float x, float y, float z)
@ GS_ZERO
Definition: graphics.h:130
EXPORT void gs_load_texture(gs_texture_t *tex, int unit)
EXPORT void gs_texrender_reset(gs_texrender_t *texrender)
EXPORT void gs_load_default_samplerstate(bool b_3d, int unit)
EXPORT gs_effect_t * gs_effect_create(const char *effect_string, const char *filename, char **error_string)
@ GS_INVERT
Definition: graphics.h:134
struct gs_shader_param gs_sparam_t
Definition: graphics.h:277
EXPORT uint32_t gs_get_width(void)
@ GS_UNSIGNED_SHORT
Definition: graphics.h:87
@ GS_POSITIVE_X
Definition: graphics.h:138
int max_anisotropy
Definition: graphics.h:228
EXPORT void gs_load_vertexbuffer(gs_vertbuffer_t *vertbuffer)
EXPORT void gs_enable_blending(bool enable)
gs_color_format
Definition: graphics.h:56
EXPORT void gs_load_samplerstate(gs_samplerstate_t *samplerstate, int unit)
EXPORT void gs_matrix_set(const struct matrix4 *matrix)
EXPORT void gs_render_start(bool b_new)
EXPORT void * gs_effect_get_val(gs_eparam_t *param)
EXPORT void gs_effect_set_bool(gs_eparam_t *param, bool val)
EXPORT gs_epass_t * gs_technique_get_pass_by_idx(const gs_technique_t *technique, size_t pass)
EXPORT void gs_matrix_scale(const struct vec3 *scale)
EXPORT void gs_draw_sprite(gs_texture_t *tex, uint32_t flip, uint32_t width, uint32_t height)
EXPORT gs_technique_t * gs_effect_get_technique(const gs_effect_t *effect, const char *name)
EXPORT void gs_texcoord(float x, float y, int unit)
EXPORT void gs_matrix_translate(const struct vec3 *pos)
EXPORT gs_timer_range_t * gs_timer_range_create()
@ GS_RGBA32F
Definition: graphics.h:67
@ GS_TEXTURE_3D
Definition: graphics.h:168
EXPORT void gs_vertex3v(const struct vec3 *v)
EXPORT void gs_shader_set_int(gs_sparam_t *param, int val)
EXPORT void gs_viewport_pop(void)
EXPORT void gs_voltexture_destroy(gs_texture_t *voltex)
EXPORT void gs_draw_sprite_subregion(gs_texture_t *tex, uint32_t flip, uint32_t x, uint32_t y, uint32_t cx, uint32_t cy)
EXPORT bool gs_texture_map(gs_texture_t *tex, uint8_t **ptr, uint32_t *linesize)
struct gs_timer_range gs_timer_range_t
Definition: graphics.h:274
EXPORT struct gs_vb_data * gs_vertexbuffer_get_data(const gs_vertbuffer_t *vertbuffer)
EXPORT enum gs_color_format gs_texture_get_color_format(const gs_texture_t *tex)
EXPORT void gs_reset_blend_state(void)
@ GS_BGRA
Definition: graphics.h:62
@ GS_R16F
Definition: graphics.h:70
@ GS_NEGATIVE_Z
Definition: graphics.h:143
EXPORT void gs_effect_set_texture(gs_eparam_t *param, gs_texture_t *val)
gs_stencil_op_type
Definition: graphics.h:128
@ GS_STENCIL_BOTH
Definition: graphics.h:125
EXPORT void gs_render_stop(enum gs_draw_mode mode)
@ GS_Z32F_S8X24
Definition: graphics.h:83
EXPORT gs_eparam_t * gs_effect_get_world_matrix(const gs_effect_t *effect)
EXPORT void gs_shader_set_vec3(gs_sparam_t *param, const struct vec3 *val)
Definition: graphics.h:484
void * array
Definition: graphics.h:188
@ GS_NEGATIVE_X
Definition: graphics.h:139
@ GS_BLEND_SRCALPHASAT
Definition: graphics.h:108
@ GS_BACK
Definition: graphics.h:92
EXPORT gs_vertbuffer_t * gs_vertexbuffer_create(struct gs_vb_data *data, uint32_t flags)
EXPORT void gs_texture_unmap(gs_texture_t *tex)
EXPORT void gs_set_cull_mode(enum gs_cull_mode mode)
EXPORT void gs_stagesurface_destroy(gs_stagesurf_t *stagesurf)
@ GS_BLEND_DSTCOLOR
Definition: graphics.h:104
EXPORT void gs_shader_set_vec4(gs_sparam_t *param, const struct vec4 *val)
@ GS_RG16F
Definition: graphics.h:68
EXPORT uint32_t gs_cubetexture_get_size(const gs_texture_t *cubetex)
EXPORT void gs_set_viewport(int x, int y, int width, int height)
EXPORT void gs_indexbuffer_flush_direct(gs_indexbuffer_t *indexbuffer, const void *data)
@ GS_DECR
Definition: graphics.h:133
EXPORT void gs_frustum(float left, float right, float top, float bottom, float znear, float zfar)
EXPORT void gs_load_swapchain(gs_swapchain_t *swapchain)
EXPORT void gs_enable_depth_test(bool enable)
@ GS_ADDRESS_MIRRORONCE
Definition: graphics.h:163
EXPORT void gs_matrix_translate3f(float x, float y, float z)
EXPORT uint32_t gs_texture_get_height(const gs_texture_t *tex)
@ GS_RG32F
Definition: graphics.h:69
gs_sample_filter
Definition: graphics.h:146
uint32_t border_color
Definition: graphics.h:229
gs_index_type
Definition: graphics.h:86
@ GS_GEQUAL
Definition: graphics.h:116
EXPORT void bfree(void *ptr)
EXPORT gs_sparam_t * gs_shader_get_param_by_idx(gs_shader_t *shader, uint32_t param)
#define EXPORT
Definition: c99defs.h:37
EXPORT void gs_shader_set_matrix3(gs_sparam_t *param, const struct matrix3 *val)
EXPORT void gs_vertexbuffer_flush(gs_vertbuffer_t *vertbuffer)
EXPORT gs_texture_t * gs_voltexture_create(uint32_t width, uint32_t height, uint32_t depth, enum gs_color_format color_format, uint32_t levels, const uint8_t **data, uint32_t flags)
@ GS_R8
Definition: graphics.h:59
EXPORT void gs_set_cube_render_target(gs_texture_t *cubetex, int side, gs_zstencil_t *zstencil)
@ GS_BLEND_INVSRCCOLOR
Definition: graphics.h:101
struct gs_timer gs_timer_t
Definition: graphics.h:273
EXPORT void gs_matrix_rotaa4f(float x, float y, float z, float angle)
@ GS_BLEND_SRCCOLOR
Definition: graphics.h:100
EXPORT void gs_blend_function_separate(enum gs_blend_type src_c, enum gs_blend_type dest_c, enum gs_blend_type src_a, enum gs_blend_type dest_a)
EXPORT void gs_normal3f(float x, float y, float z)
struct gs_shader gs_shader_t
Definition: graphics.h:276
EXPORT enum gs_texture_type gs_get_texture_type(const gs_texture_t *texture)
long cy
Definition: graphics.h:183
@ GS_TEXTURE_CUBE
Definition: graphics.h:169
Definition: graphics.h:178
EXPORT void gs_samplerstate_destroy(gs_samplerstate_t *samplerstate)
@ GS_DXT5
Definition: graphics.h:74
EXPORT void gs_zstencil_destroy(gs_zstencil_t *zstencil)
EXPORT gs_eparam_t * gs_param_get_annotation_by_idx(const gs_eparam_t *param, size_t annotation)
size_t num
Definition: graphics.h:192
EXPORT bool gs_timer_range_get_data(gs_timer_range_t *range, bool *disjoint, uint64_t *frequency)
@ GS_FILTER_ANISOTROPIC
Definition: graphics.h:149
EXPORT void gs_stencil_op(enum gs_stencil_side side, enum gs_stencil_op_type fail, enum gs_stencil_op_type zfail, enum gs_stencil_op_type zpass)
EXPORT size_t gs_indexbuffer_get_num_indices(const gs_indexbuffer_t *indexbuffer)
struct vec3 * normals
Definition: graphics.h:194
EXPORT void gs_reset_viewport(void)
EXPORT void gs_enable_color(bool red, bool green, bool blue, bool alpha)
EXPORT void gs_shader_set_vec2(gs_sparam_t *param, const struct vec2 *val)
@ GS_RGBA16F
Definition: graphics.h:66
@ GS_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR
Definition: graphics.h:154
@ GS_NEVER
Definition: graphics.h:112
struct gs_index_buffer gs_indexbuffer_t
Definition: graphics.h:270
EXPORT void gs_texture_set_image(gs_texture_t *tex, const uint8_t *data, uint32_t linesize, bool invert)
EXPORT void gs_projection_pop(void)
EXPORT void gs_swapchain_destroy(gs_swapchain_t *swapchain)
gs_shader_param_type
Definition: graphics.h:289
@ GS_SHADER_PARAM_BOOL
Definition: graphics.h:291
EXPORT bool gs_effect_loop(gs_effect_t *effect, const char *name)
EXPORT gs_eparam_t * gs_effect_get_param_by_idx(const gs_effect_t *effect, size_t param)
@ GS_KEEP
Definition: graphics.h:129
EXPORT void gs_begin_scene(void)
EXPORT void gs_set_render_target(gs_texture_t *tex, gs_zstencil_t *zstencil)
EXPORT void gs_timer_destroy(gs_timer_t *timer)
@ GS_SHADER_PARAM_UNKNOWN
Definition: graphics.h:290
EXPORT gs_texture_t * gs_texture_create(uint32_t width, uint32_t height, enum gs_color_format color_format, uint32_t levels, const uint8_t **data, uint32_t flags)
@ GS_SHADER_PARAM_VEC2
Definition: graphics.h:295
EXPORT void gs_present(void)
uint32_t * colors
Definition: graphics.h:196
EXPORT void * gs_indexbuffer_get_data(const gs_indexbuffer_t *indexbuffer)
uint32_t num_backbuffers
Definition: graphics.h:487
EXPORT void gs_shader_set_default(gs_sparam_t *param)
EXPORT gs_epass_t * gs_technique_get_pass_by_name(const gs_technique_t *technique, const char *name)
EXPORT void gs_matrix_rotquat(const struct quat *rot)
uint32_t height
Definition: graphics.h:234
@ GS_FILTER_POINT
Definition: graphics.h:147
EXPORT void gs_shader_get_param_info(const gs_sparam_t *param, struct gs_shader_param_info *info)
uint32_t bits
Definition: graphics.h:235
const char * name
Definition: graphics.h:308
EXPORT gs_shader_t * gs_pixelshader_create(const char *shader, const char *file, char **error_string)
EXPORT gs_texrender_t * gs_texrender_create(enum gs_color_format format, enum gs_zstencil_format zsformat)
Definition: graphics.h:359
enum gs_zstencil_format zsformat
Definition: graphics.h:489
struct gs_texture gs_texture_t
Definition: graphics.h:266
EXPORT gs_samplerstate_t * gs_samplerstate_create(const struct gs_sampler_info *info)
EXPORT void gs_copy_texture_region(gs_texture_t *dst, uint32_t dst_x, uint32_t dst_y, gs_texture_t *src, uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h)
EXPORT void gs_vertex2v(const struct vec2 *v)
enum gs_address_mode address_v
Definition: graphics.h:226
size_t width
Definition: graphics.h:187
@ GS_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT
Definition: graphics.h:151
EXPORT void gs_viewport_push(void)
enum gs_shader_param_type type
Definition: graphics.h:361
@ GS_GREATER
Definition: graphics.h:117
EXPORT void gs_effect_destroy(gs_effect_t *effect)
EXPORT void gs_effect_set_int(gs_eparam_t *param, int val)
EXPORT void gs_draw(enum gs_draw_mode draw_mode, uint32_t start_vert, uint32_t num_verts)
@ GS_ADDRESS_WRAP
Definition: graphics.h:160
@ GS_FRONT
Definition: graphics.h:93
gs_stencil_side
Definition: graphics.h:122
EXPORT gs_shader_t * gs_vertexshader_create_from_file(const char *file, char **error_string)
struct gs_window window
Definition: graphics.h:485
@ GS_SHADER_VERTEX
Definition: graphics.h:312
gs_draw_mode
Definition: graphics.h:48
EXPORT void gs_debug_marker_begin(const float color[4], const char *markername)
EXPORT int gs_shader_get_num_params(const gs_shader_t *shader)
@ GS_A8
Definition: graphics.h:58
EXPORT void gs_cubetexture_destroy(gs_texture_t *cubetex)
Definition: graphics-internal.h:329
EXPORT gs_effect_t * gs_get_effect(void)
EXPORT size_t gs_technique_begin(gs_technique_t *technique)
@ GS_R10G10B10A2
Definition: graphics.h:63
uint32_t adapter
Definition: graphics.h:490
EXPORT void gs_projection_push(void)
Definition: graphics.h:306
EXPORT gs_sparam_t * gs_shader_get_world_matrix(const gs_shader_t *shader)
enum gs_shader_param_type type
Definition: graphics.h:307
@ GS_Z16
Definition: graphics.h:80
EXPORT void gs_color4v(const struct vec4 *v)
EXPORT void gs_copy_texture(gs_texture_t *dst, gs_texture_t *src)
EXPORT void gs_normal3v(const struct vec3 *v)
EXPORT enum gs_index_type gs_indexbuffer_get_type(const gs_indexbuffer_t *indexbuffer)
EXPORT uint32_t gs_voltexture_get_width(const gs_texture_t *voltex)
EXPORT uint32_t gs_stagesurface_get_width(const gs_stagesurf_t *stagesurf)
@ GS_DXT1
Definition: graphics.h:72
EXPORT void gs_effect_set_vec3(gs_eparam_t *param, const struct vec3 *val)
EXPORT void gs_matrix_transpose(void)
struct gs_sampler_state gs_samplerstate_t
Definition: graphics.h:271
EXPORT gs_texture_t * gs_texrender_get_texture(const gs_texrender_t *texrender)
EXPORT void gs_indexbuffer_destroy(gs_indexbuffer_t *indexbuffer)
EXPORT uint32_t gs_voltexture_get_depth(const gs_texture_t *voltex)
EXPORT size_t gs_effect_get_val_size(gs_eparam_t *param)
EXPORT enum gs_color_format gs_voltexture_get_color_format(const gs_texture_t *voltex)
EXPORT void gs_matrix_get(struct matrix4 *dst)
EXPORT void gs_effect_set_matrix4(gs_eparam_t *param, const struct matrix4 *val)
@ GS_TRISTRIP
Definition: graphics.h:53
EXPORT bool gs_technique_begin_pass_by_name(gs_technique_t *technique, const char *name)
EXPORT void * gs_effect_get_default_val(gs_eparam_t *param)
@ GS_SHADER_PARAM_INT3
Definition: graphics.h:299
EXPORT void gs_clear(uint32_t clear_flags, const struct vec4 *color, float depth, uint8_t stencil)
Definition: graphics.h:223
EXPORT void gs_effect_set_default(gs_eparam_t *param)
EXPORT gs_texture_t * gs_get_render_target(void)
@ GS_ZS_NONE
Definition: graphics.h:79
EXPORT void gs_indexbuffer_flush(gs_indexbuffer_t *indexbuffer)
EXPORT void gs_matrix_mul(const struct matrix4 *matrix)
@ GS_POSITIVE_Z
Definition: graphics.h:142
@ GS_POINTS
Definition: graphics.h:49
@ GS_ADDRESS_MIRROR
Definition: graphics.h:161
@ GS_FILTER_LINEAR
Definition: graphics.h:148
EXPORT void gs_texture_destroy(gs_texture_t *tex)
Definition: graphics.h:191
EXPORT void gs_shader_set_bool(gs_sparam_t *param, bool val)
EXPORT void gs_set_2d_mode(void)
@ GS_LEQUAL
Definition: graphics.h:114
EXPORT void gs_matrix_scale3f(float x, float y, float z)
@ GS_DXT3
Definition: graphics.h:73
enum gs_address_mode address_w
Definition: graphics.h:227
EXPORT gs_shader_t * gs_get_vertex_shader(void)
@ GS_Z32F
Definition: graphics.h:82
EXPORT enum gs_color_format gs_cubetexture_get_color_format(const gs_texture_t *cubetex)
enum gs_color_format format
Definition: graphics.h:488
long x
Definition: graphics.h:180
EXPORT void gs_timer_begin(gs_timer_t *timer)
EXPORT void gs_enable_stencil_test(bool enable)
EXPORT void gs_texcoord2v(const struct vec2 *v, int unit)
@ GS_STENCIL_FRONT
Definition: graphics.h:123
EXPORT void gs_color(uint32_t color)
@ GS_BLEND_INVDSTALPHA
Definition: graphics.h:107
int x
Definition: graphics.h:240
@ GS_LINESTRIP
Definition: graphics.h:51
EXPORT gs_technique_t * gs_effect_get_current_technique(const gs_effect_t *effect)
EXPORT bool gs_stagesurface_map(gs_stagesurf_t *stagesurf, uint8_t **data, uint32_t *linesize)
@ GS_LESS
Definition: graphics.h:113
EXPORT void * gs_texture_get_obj(gs_texture_t *tex)
@ GS_SHADER_PARAM_MATRIX4X4
Definition: graphics.h:301
@ GS_STENCIL_BACK
Definition: graphics.h:124
gs_address_mode
Definition: graphics.h:158
@ GS_SHADER_PARAM_VEC3
Definition: graphics.h:296
EXPORT gs_shader_t * gs_get_pixel_shader(void)
EXPORT void gs_shader_set_val(gs_sparam_t *param, const void *val, size_t size)
EXPORT size_t gs_param_get_num_annotations(const gs_eparam_t *param)
gs_cull_mode
Definition: graphics.h:91
@ GS_NOTEQUAL
Definition: graphics.h:118
int rotation_degrees
Definition: graphics.h:179
EXPORT gs_sparam_t * gs_shader_get_param_by_name(gs_shader_t *shader, const char *name)
@ GS_FILTER_MIN_MAG_LINEAR_MIP_POINT
Definition: graphics.h:155
EXPORT void gs_destroy(graphics_t *graphics)
EXPORT uint32_t gs_stagesurface_get_height(const gs_stagesurf_t *stagesurf)
EXPORT bool gs_texture_is_rect(const gs_texture_t *tex)
EXPORT bool gs_timer_get_data(gs_timer_t *timer, uint64_t *ticks)
@ GS_EQUAL
Definition: graphics.h:115
@ GS_POSITIVE_Y
Definition: graphics.h:140
gs_cube_sides
Definition: graphics.h:137
EXPORT void gs_vertexbuffer_flush_direct(gs_vertbuffer_t *vertbuffer, const struct gs_vb_data *data)
struct vec3 * points
Definition: graphics.h:193
EXPORT void gs_shader_set_next_sampler(gs_sparam_t *param, gs_samplerstate_t *sampler)
EXPORT void gs_shader_set_matrix4(gs_sparam_t *param, const struct matrix4 *val)
@ GS_LINES
Definition: graphics.h:50
EXPORT void gs_shader_set_texture(gs_sparam_t *param, gs_texture_t *val)
EXPORT size_t gs_effect_get_num_params(const gs_effect_t *effect)
const char * name
Definition: graphics.h:360
Definition: graphics.h:172
gs_blend_type
Definition: graphics.h:97
EXPORT void gs_load_vertexshader(gs_shader_t *vertshader)
@ GS_RGBA
Definition: graphics.h:60
EXPORT void gs_effect_update_params(gs_effect_t *effect)
EXPORT gs_zstencil_t * gs_get_zstencil_target(void)
EXPORT gs_indexbuffer_t * gs_indexbuffer_create(enum gs_index_type type, void *indices, size_t num, uint32_t flags)
struct vec3 * tangents
Definition: graphics.h:195
EXPORT void gs_blend_state_push(void)
EXPORT void gs_get_viewport(struct gs_rect *rect)
EXPORT void gs_enter_context(graphics_t *graphics)
EXPORT gs_vertbuffer_t * gs_render_save(void)
EXPORT void gs_effect_set_color(gs_eparam_t *param, uint32_t argb)
gs_depth_test
Definition: graphics.h:111
EXPORT void gs_load_pixelshader(gs_shader_t *pixelshader)
@ GS_SHADER_PARAM_STRING
Definition: graphics.h:294
EXPORT void gs_get_size(uint32_t *x, uint32_t *y)
@ GS_BLEND_DSTALPHA
Definition: graphics.h:106
enum gs_sample_filter filter
Definition: graphics.h:224
EXPORT void gs_matrix_pop(void)
EXPORT void gs_matrix_identity(void)
EXPORT uint32_t gs_voltexture_get_height(const gs_texture_t *voltex)
EXPORT void gs_effect_set_val(gs_eparam_t *param, const void *val, size_t size)
@ GS_REPLACE
Definition: graphics.h:131
@ GS_BLEND_SRCALPHA
Definition: graphics.h:102
EXPORT uint32_t gs_texture_get_width(const gs_texture_t *tex)
EXPORT void gs_matrix_push(void)
@ GS_TRIS
Definition: graphics.h:52
EXPORT gs_eparam_t * gs_effect_get_param_by_name(const gs_effect_t *effect, const char *name)
@ GS_ADDRESS_BORDER
Definition: graphics.h:162
@ GS_TEXTURE_2D
Definition: graphics.h:167
enum gs_address_mode address_u
Definition: graphics.h:225
EXPORT gs_timer_t * gs_timer_create()
@ GS_UNKNOWN
Definition: graphics.h:57
@ GS_BLEND_INVDSTCOLOR
Definition: graphics.h:105
struct gs_texture_render gs_texrender_t
Definition: graphics.h:275
EXPORT void gs_enum_adapters(bool(*callback)(void *param, const char *name, uint32_t id), void *param)
EXPORT void gs_set_scissor_rect(const struct gs_rect *rect)
@ GS_UNSIGNED_LONG
Definition: graphics.h:88
struct gs_zstencil_buffer gs_zstencil_t
Definition: graphics.h:268
EXPORT gs_sparam_t * gs_shader_get_viewproj_matrix(const gs_shader_t *shader)
EXPORT input_t * gs_get_input(void)
gs_shader_type
Definition: graphics.h:311
EXPORT void gs_vertexbuffer_destroy(gs_vertbuffer_t *vertbuffer)
EXPORT gs_shader_t * gs_vertexshader_create(const char *shader, const char *file, char **error_string)
EXPORT void gs_effect_set_next_sampler(gs_eparam_t *param, gs_samplerstate_t *sampler)
EXPORT gs_shader_t * gs_pixelshader_create_from_file(const char *file, char **error_string)
EXPORT void gs_debug_marker_end(void)
struct gs_tvertarray * tvarray
Definition: graphics.h:199
EXPORT void gs_matrix_rotaa(const struct axisang *rot)
EXPORT void gs_effect_set_float(gs_eparam_t *param, float val)
gs_texture_type
Definition: graphics.h:166
EXPORT bool gs_nv12_available(void)
EXPORT bool gs_technique_begin_pass(gs_technique_t *technique, size_t pass)
@ GS_INCR
Definition: graphics.h:132
uint32_t freq
Definition: graphics.h:236
EXPORT int gs_get_device_type(void)
struct gs_swap_chain gs_swapchain_t
Definition: graphics.h:272
@ GS_SHADER_PARAM_INT
Definition: graphics.h:293
@ GS_NEGATIVE_Y
Definition: graphics.h:141
EXPORT enum gs_color_format gs_stagesurface_get_color_format(const gs_stagesurf_t *stagesurf)
EXPORT void gs_perspective(float fovy, float aspect, float znear, float zfar)
EXPORT void gs_ortho(float left, float right, float top, float bottom, float znear, float zfar)
EXPORT void gs_timer_range_end(gs_timer_range_t *range)
void(* device_loss_rebuild)(void *device, void *data)
Definition: graphics.h:174
EXPORT void gs_shader_set_float(gs_sparam_t *param, float val)
uint32_t cx
Definition: graphics.h:486
EXPORT gs_effect_t * gs_effect_create_from_file(const char *file, char **error_string)
Definition: graphics.h:472
void * data
Definition: graphics.h:175
EXPORT void gs_blend_function(enum gs_blend_type src, enum gs_blend_type dest)
EXPORT void gs_effect_set_vec4(gs_eparam_t *param, const struct vec4 *val)
EXPORT void gs_stagesurface_unmap(gs_stagesurf_t *stagesurf)
uint32_t cy
Definition: graphics.h:486
@ GS_ALWAYS
Definition: graphics.h:119
uint32_t width
Definition: graphics.h:233
void(* device_loss_release)(void *data)
Definition: graphics.h:173
@ GS_Z24_S8
Definition: graphics.h:81
@ GS_BGRX
Definition: graphics.h:61
EXPORT gs_eparam_t * gs_param_get_annotation_by_name(const gs_eparam_t *param, const char *name)
EXPORT void gs_shader_destroy(gs_shader_t *shader)
EXPORT void gs_flush(void)
@ GS_R32F
Definition: graphics.h:71
Definition: graphics.h:239
EXPORT void gs_vertex2f(float x, float y)
EXPORT gs_swapchain_t * gs_swapchain_create(const struct gs_init_data *data)
Definition: graphics.h:186
@ GS_SHADER_PARAM_INT4
Definition: graphics.h:300
EXPORT void gs_timer_range_destroy(gs_timer_range_t *timer)
const EXPORT char * gs_get_device_name(void)
EXPORT size_t gs_effect_get_default_val_size(gs_eparam_t *param)
@ GS_SHADER_PARAM_INT2
Definition: graphics.h:298
EXPORT void gs_load_indexbuffer(gs_indexbuffer_t *indexbuffer)
size_t num_tex
Definition: graphics.h:198
EXPORT void gs_leave_context(void)
long cx
Definition: graphics.h:182
EXPORT void * gs_get_device_obj(void)
EXPORT gs_zstencil_t * gs_zstencil_create(uint32_t width, uint32_t height, enum gs_zstencil_format format)
@ GS_FILTER_MIN_LINEAR_MAG_MIP_POINT
Definition: graphics.h:153
EXPORT void gs_effect_set_vec2(gs_eparam_t *param, const struct vec2 *val)
EXPORT gs_texture_t * gs_cubetexture_create(uint32_t size, enum gs_color_format color_format, uint32_t levels, const uint8_t **data, uint32_t flags)
@ GS_NEITHER
Definition: graphics.h:94
EXPORT void gs_blend_state_pop(void)
EXPORT void gs_timer_end(gs_timer_t *timer)
EXPORT void gs_begin_frame(void)
EXPORT enum gs_cull_mode gs_get_cull_mode(void)
@ GS_SHADER_PARAM_TEXTURE
Definition: graphics.h:302
@ GS_ADDRESS_CLAMP
Definition: graphics.h:159
EXPORT void gs_cubetexture_set_image(gs_texture_t *cubetex, uint32_t side, const void *data, uint32_t linesize, bool invert)
@ GS_R16
Definition: graphics.h:65
EXPORT gs_eparam_t * gs_effect_get_viewproj_matrix(const gs_effect_t *effect)
@ GS_FILTER_MIN_MAG_POINT_MIP_LINEAR
Definition: graphics.h:150
int y
Definition: graphics.h:241
EXPORT uint8_t * gs_create_texture_file_data(const char *file, enum gs_color_format *format, uint32_t *cx, uint32_t *cy)
@ GS_BLEND_ZERO
Definition: graphics.h:98
EXPORT void gs_effect_get_param_info(const gs_eparam_t *param, struct gs_effect_param_info *info)
EXPORT uint32_t gs_get_height(void)
EXPORT gs_texture_t * gs_texture_create_from_file(const char *file)
EXPORT void gs_end_scene(void)