Open Broadcaster Software
Free, open source software for live streaming and recording
graphics-internal.h
Go to the documentation of this file.
1 /******************************************************************************
2  Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
17 
18 #pragma once
19 
20 #include "../util/threading.h"
21 #include "../util/darray.h"
22 #include "graphics.h"
23 #include "matrix3.h"
24 #include "matrix4.h"
25 
26 struct gs_exports {
27  const char *(*device_get_name)(void);
28  int (*device_get_type)(void);
29  bool (*device_enum_adapters)(bool (*callback)(void *, const char *,
30  uint32_t),
31  void *);
32  const char *(*device_preprocessor_name)(void);
33  int (*device_create)(gs_device_t **device, uint32_t adapter);
34  void (*device_destroy)(gs_device_t *device);
35  void (*device_enter_context)(gs_device_t *device);
36  void (*device_leave_context)(gs_device_t *device);
37  void *(*device_get_device_obj)(gs_device_t *device);
38  gs_swapchain_t *(*device_swapchain_create)(
39  gs_device_t *device, const struct gs_init_data *data);
40  void (*device_resize)(gs_device_t *device, uint32_t x, uint32_t y);
41  void (*device_get_size)(const gs_device_t *device, uint32_t *x,
42  uint32_t *y);
43  uint32_t (*device_get_width)(const gs_device_t *device);
44  uint32_t (*device_get_height)(const gs_device_t *device);
45  gs_texture_t *(*device_texture_create)(
46  gs_device_t *device, uint32_t width, uint32_t height,
47  enum gs_color_format color_format, uint32_t levels,
48  const uint8_t **data, uint32_t flags);
49  gs_texture_t *(*device_cubetexture_create)(
50  gs_device_t *device, uint32_t size,
51  enum gs_color_format color_format, uint32_t levels,
52  const uint8_t **data, uint32_t flags);
53  gs_texture_t *(*device_voltexture_create)(
54  gs_device_t *device, uint32_t width, uint32_t height,
55  uint32_t depth, enum gs_color_format color_format,
56  uint32_t levels, const uint8_t *const *data, uint32_t flags);
57  gs_zstencil_t *(*device_zstencil_create)(
58  gs_device_t *device, uint32_t width, uint32_t height,
60  gs_stagesurf_t *(*device_stagesurface_create)(
61  gs_device_t *device, uint32_t width, uint32_t height,
62  enum gs_color_format color_format);
63  gs_samplerstate_t *(*device_samplerstate_create)(
64  gs_device_t *device, const struct gs_sampler_info *info);
65  gs_shader_t *(*device_vertexshader_create)(gs_device_t *device,
66  const char *shader,
67  const char *file,
68  char **error_string);
69  gs_shader_t *(*device_pixelshader_create)(gs_device_t *device,
70  const char *shader,
71  const char *file,
72  char **error_string);
73  gs_vertbuffer_t *(*device_vertexbuffer_create)(gs_device_t *device,
74  struct gs_vb_data *data,
75  uint32_t flags);
76  gs_indexbuffer_t *(*device_indexbuffer_create)(gs_device_t *device,
77  enum gs_index_type type,
78  void *indices,
79  size_t num,
80  uint32_t flags);
81  gs_timer_t *(*device_timer_create)(gs_device_t *device);
82  gs_timer_range_t *(*device_timer_range_create)(gs_device_t *device);
84  const gs_texture_t *texture);
85  void (*device_load_vertexbuffer)(gs_device_t *device,
86  gs_vertbuffer_t *vertbuffer);
87  void (*device_load_indexbuffer)(gs_device_t *device,
88  gs_indexbuffer_t *indexbuffer);
89  void (*device_load_texture)(gs_device_t *device, gs_texture_t *tex,
90  int unit);
92  gs_samplerstate_t *samplerstate,
93  int unit);
94  void (*device_load_vertexshader)(gs_device_t *device,
95  gs_shader_t *vertshader);
97  gs_shader_t *pixelshader);
98  void (*device_load_default_samplerstate)(gs_device_t *device, bool b_3d,
99  int unit);
100  gs_shader_t *(*device_get_vertex_shader)(const gs_device_t *device);
101  gs_shader_t *(*device_get_pixel_shader)(const gs_device_t *device);
102  gs_texture_t *(*device_get_render_target)(const gs_device_t *device);
103  gs_zstencil_t *(*device_get_zstencil_target)(const gs_device_t *device);
105  gs_zstencil_t *zstencil);
107  gs_texture_t *cubetex, int side,
108  gs_zstencil_t *zstencil);
110  gs_texture_t *src);
112  gs_texture_t *dst, uint32_t dst_x,
113  uint32_t dst_y, gs_texture_t *src,
114  uint32_t src_x, uint32_t src_y,
115  uint32_t src_w, uint32_t src_h);
118  void (*device_begin_frame)(gs_device_t *device);
119  void (*device_begin_scene)(gs_device_t *device);
120  void (*device_draw)(gs_device_t *device, enum gs_draw_mode draw_mode,
121  uint32_t start_vert, uint32_t num_verts);
122  void (*device_end_scene)(gs_device_t *device);
123  void (*device_load_swapchain)(gs_device_t *device,
124  gs_swapchain_t *swaphchain);
125  void (*device_clear)(gs_device_t *device, uint32_t clear_flags,
126  const struct vec4 *color, float depth,
127  uint8_t stencil);
128  void (*device_present)(gs_device_t *device);
129  void (*device_flush)(gs_device_t *device);
130  void (*device_set_cull_mode)(gs_device_t *device,
131  enum gs_cull_mode mode);
132  enum gs_cull_mode (*device_get_cull_mode)(const gs_device_t *device);
133  void (*device_enable_blending)(gs_device_t *device, bool enable);
134  void (*device_enable_depth_test)(gs_device_t *device, bool enable);
135  void (*device_enable_stencil_test)(gs_device_t *device, bool enable);
136  void (*device_enable_stencil_write)(gs_device_t *device, bool enable);
137  void (*device_enable_color)(gs_device_t *device, bool red, bool green,
138  bool blue, bool alpha);
139  void (*device_blend_function)(gs_device_t *device,
140  enum gs_blend_type src,
141  enum gs_blend_type dest);
143  enum gs_blend_type src_c,
144  enum gs_blend_type dest_c,
145  enum gs_blend_type src_a,
146  enum gs_blend_type dest_a);
148  enum gs_depth_test test);
150  enum gs_stencil_side side,
151  enum gs_depth_test test);
153  enum gs_stencil_side side,
155  enum gs_stencil_op_type zfail,
156  enum gs_stencil_op_type zpass);
157  void (*device_set_viewport)(gs_device_t *device, int x, int y,
158  int width, int height);
159  void (*device_get_viewport)(const gs_device_t *device,
160  struct gs_rect *rect);
161  void (*device_set_scissor_rect)(gs_device_t *device,
162  const struct gs_rect *rect);
163  void (*device_ortho)(gs_device_t *device, float left, float right,
164  float top, float bottom, float znear, float zfar);
165  void (*device_frustum)(gs_device_t *device, float left, float right,
166  float top, float bottom, float znear,
167  float zfar);
168  void (*device_projection_push)(gs_device_t *device);
169  void (*device_projection_pop)(gs_device_t *device);
170 
171  void (*gs_swapchain_destroy)(gs_swapchain_t *swapchain);
172 
173  void (*gs_texture_destroy)(gs_texture_t *tex);
174  uint32_t (*gs_texture_get_width)(const gs_texture_t *tex);
175  uint32_t (*gs_texture_get_height)(const gs_texture_t *tex);
177  const gs_texture_t *tex);
178  bool (*gs_texture_map)(gs_texture_t *tex, uint8_t **ptr,
179  uint32_t *linesize);
181  bool (*gs_texture_is_rect)(const gs_texture_t *tex);
182  void *(*gs_texture_get_obj)(const gs_texture_t *tex);
183 
185  uint32_t (*gs_cubetexture_get_size)(const gs_texture_t *cubetex);
187  const gs_texture_t *cubetex);
188 
190  uint32_t (*gs_voltexture_get_width)(const gs_texture_t *voltex);
191  uint32_t (*gs_voltexture_get_height)(const gs_texture_t *voltex);
192  uint32_t (*gs_voltexture_get_depth)(const gs_texture_t *voltex);
194  const gs_texture_t *voltex);
195 
197  uint32_t (*gs_stagesurface_get_width)(const gs_stagesurf_t *stagesurf);
198  uint32_t (*gs_stagesurface_get_height)(const gs_stagesurf_t *stagesurf);
200  const gs_stagesurf_t *stagesurf);
201  bool (*gs_stagesurface_map)(gs_stagesurf_t *stagesurf, uint8_t **data,
202  uint32_t *linesize);
203  void (*gs_stagesurface_unmap)(gs_stagesurf_t *stagesurf);
204 
205  void (*gs_zstencil_destroy)(gs_zstencil_t *zstencil);
206 
208 
209  void (*gs_vertexbuffer_destroy)(gs_vertbuffer_t *vertbuffer);
210  void (*gs_vertexbuffer_flush)(gs_vertbuffer_t *vertbuffer);
212  const struct gs_vb_data *data);
213  struct gs_vb_data *(*gs_vertexbuffer_get_data)(
214  const gs_vertbuffer_t *vertbuffer);
215 
217  void (*gs_indexbuffer_flush)(gs_indexbuffer_t *indexbuffer);
219  const void *data);
220  void *(*gs_indexbuffer_get_data)(const gs_indexbuffer_t *indexbuffer);
222  const gs_indexbuffer_t *indexbuffer);
224  const gs_indexbuffer_t *indexbuffer);
225 
226  void (*gs_timer_destroy)(gs_timer_t *timer);
227  void (*gs_timer_begin)(gs_timer_t *timer);
228  void (*gs_timer_end)(gs_timer_t *timer);
229  bool (*gs_timer_get_data)(gs_timer_t *timer, uint64_t *ticks);
233  bool (*gs_timer_range_get_data)(gs_timer_range_t *range, bool *disjoint,
234  uint64_t *frequency);
235 
236  void (*gs_shader_destroy)(gs_shader_t *shader);
237  int (*gs_shader_get_num_params)(const gs_shader_t *shader);
238  gs_sparam_t *(*gs_shader_get_param_by_idx)(gs_shader_t *shader,
239  uint32_t param);
240  gs_sparam_t *(*gs_shader_get_param_by_name)(gs_shader_t *shader,
241  const char *name);
242  gs_sparam_t *(*gs_shader_get_viewproj_matrix)(const gs_shader_t *shader);
243  gs_sparam_t *(*gs_shader_get_world_matrix)(const gs_shader_t *shader);
244  void (*gs_shader_get_param_info)(const gs_sparam_t *param,
245  struct gs_shader_param_info *info);
246  void (*gs_shader_set_bool)(gs_sparam_t *param, bool val);
247  void (*gs_shader_set_float)(gs_sparam_t *param, float val);
248  void (*gs_shader_set_int)(gs_sparam_t *param, int val);
249  void (*gs_shader_set_matrix3)(gs_sparam_t *param,
250  const struct matrix3 *val);
252  const struct matrix4 *val);
253  void (*gs_shader_set_vec2)(gs_sparam_t *param, const struct vec2 *val);
254  void (*gs_shader_set_vec3)(gs_sparam_t *param, const struct vec3 *val);
255  void (*gs_shader_set_vec4)(gs_sparam_t *param, const struct vec4 *val);
256  void (*gs_shader_set_texture)(gs_sparam_t *param, gs_texture_t *val);
257  void (*gs_shader_set_val)(gs_sparam_t *param, const void *val,
258  size_t size);
261  gs_samplerstate_t *sampler);
262 
264 
265  void (*device_debug_marker_begin)(gs_device_t *device,
266  const char *markername,
267  const float color[4]);
269 
270 #ifdef __APPLE__
271  /* OSX/Cocoa specific functions */
272  gs_texture_t *(*device_texture_create_from_iosurface)(gs_device_t *dev,
273  void *iosurf);
274  bool (*gs_texture_rebind_iosurface)(gs_texture_t *texture,
275  void *iosurf);
276 
277 #elif _WIN32
278  bool (*device_gdi_texture_available)(void);
279  bool (*device_shared_texture_available)(void);
280 
281  bool (*device_get_duplicator_monitor_info)(
282  gs_device_t *device, int monitor_idx,
283  struct gs_monitor_info *monitor_info);
284 
285  gs_duplicator_t *(*device_duplicator_create)(gs_device_t *device,
286  int monitor_idx);
287  void (*gs_duplicator_destroy)(gs_duplicator_t *duplicator);
288 
289  bool (*gs_duplicator_update_frame)(gs_duplicator_t *duplicator);
290  gs_texture_t *(*gs_duplicator_get_texture)(gs_duplicator_t *duplicator);
291 
292  gs_texture_t *(*device_texture_create_gdi)(gs_device_t *device,
293  uint32_t width,
294  uint32_t height);
295 
296  void *(*gs_texture_get_dc)(gs_texture_t *gdi_tex);
297  void (*gs_texture_release_dc)(gs_texture_t *gdi_tex);
298 
299  gs_texture_t *(*device_texture_open_shared)(gs_device_t *device,
300  uint32_t handle);
301  uint32_t (*device_texture_get_shared_handle)(gs_texture_t *tex);
302  int (*device_texture_acquire_sync)(gs_texture_t *tex, uint64_t key,
303  uint32_t ms);
304  int (*device_texture_release_sync)(gs_texture_t *tex, uint64_t key);
305  bool (*device_texture_create_nv12)(gs_device_t *device,
306  gs_texture_t **tex_y,
307  gs_texture_t **tex_uv,
308  uint32_t width, uint32_t height,
309  uint32_t flags);
310 
311  gs_stagesurf_t *(*device_stagesurface_create_nv12)(gs_device_t *device,
312  uint32_t width,
313  uint32_t height);
314  void (*device_register_loss_callbacks)(
315  gs_device_t *device, const struct gs_device_loss *callbacks);
316  void (*device_unregister_loss_callbacks)(gs_device_t *device,
317  void *data);
318 #endif
319 };
320 
321 struct blend_state {
322  bool enabled;
327 };
328 
330  void *module;
333 
334  DARRAY(struct gs_rect) viewport_stack;
335 
336  DARRAY(struct matrix4) matrix_stack;
337  size_t cur_matrix;
338 
341 
343 
345  struct gs_vb_data *vbd;
347  DARRAY(struct vec3) verts;
348  DARRAY(struct vec3) norms;
349  DARRAY(uint32_t) colors;
350  DARRAY(struct vec2) texverts[16];
351 
352  pthread_mutex_t effect_mutex;
354 
355  pthread_mutex_t mutex;
356  volatile long ref;
357 
359  DARRAY(struct blend_state) blend_state_stack;
360 };
graphics_subsystem::ref
volatile long ref
Definition: graphics-internal.h:356
gs_vertbuffer_t
struct gs_vertex_buffer gs_vertbuffer_t
Definition: graphics.h:269
blend_state::src_c
enum gs_blend_type src_c
Definition: graphics-internal.h:323
gs_exports::gs_stagesurface_get_width
uint32_t(* gs_stagesurface_get_width)(const gs_stagesurf_t *stagesurf)
Definition: graphics-internal.h:212
graphics_subsystem::cur_matrix
size_t cur_matrix
Definition: graphics-internal.h:337
gs_exports::gs_voltexture_get_width
uint32_t(* gs_voltexture_get_width)(const gs_texture_t *voltex)
Definition: graphics-internal.h:205
gs_stagesurf_t
struct gs_stage_surface gs_stagesurf_t
Definition: graphics.h:267
gs_device_t
struct gs_device gs_device_t
Definition: graphics.h:282
graphics.h
gs_zstencil_format
gs_zstencil_format
Definition: graphics.h:78
gs_exports::device_flush
void(* device_flush)(gs_device_t *device)
Definition: graphics-internal.h:144
gs_exports::gs_vertexbuffer_flush_direct
void(* gs_vertexbuffer_flush_direct)(gs_vertbuffer_t *vertbuffer, const struct gs_vb_data *data)
Definition: graphics-internal.h:226
graphics_subsystem::module
void * module
Definition: graphics-internal.h:330
gs_exports::device_ortho
void(* device_ortho)(gs_device_t *device, float left, float right, float top, float bottom, float znear, float zfar)
Definition: graphics-internal.h:178
gs_effect
Definition: effect.h:150
gs_exports::device_begin_scene
void(* device_begin_scene)(gs_device_t *device)
Definition: graphics-internal.h:134
gs_exports::device_end_scene
void(* device_end_scene)(gs_device_t *device)
Definition: graphics-internal.h:137
gs_exports::gs_shader_get_param_info
void(* gs_shader_get_param_info)(const gs_sparam_t *param, struct gs_shader_param_info *info)
Definition: graphics-internal.h:259
gs_exports::gs_timer_range_begin
bool(* gs_timer_range_begin)(gs_timer_range_t *range)
Definition: graphics-internal.h:246
gs_sparam_t
struct gs_shader_param gs_sparam_t
Definition: graphics.h:277
gs_color_format
gs_color_format
Definition: graphics.h:56
gs_exports::device_get_height
uint32_t(* device_get_height)(const gs_device_t *device)
Definition: graphics-internal.h:59
gs_exports::device_projection_pop
void(* device_projection_pop)(gs_device_t *device)
Definition: graphics-internal.h:184
gs_exports::gs_indexbuffer_destroy
void(* gs_indexbuffer_destroy)(gs_indexbuffer_t *indexbuffer)
Definition: graphics-internal.h:231
gs_timer_range_t
struct gs_timer_range gs_timer_range_t
Definition: graphics.h:274
gs_exports::gs_voltexture_destroy
void(* gs_voltexture_destroy)(gs_texture_t *voltex)
Definition: graphics-internal.h:204
gs_exports::device_projection_push
void(* device_projection_push)(gs_device_t *device)
Definition: graphics-internal.h:183
gs_stencil_op_type
gs_stencil_op_type
Definition: graphics.h:128
matrix4
Definition: matrix4.h:32
gs_exports::device_enable_blending
void(* device_enable_blending)(gs_device_t *device, bool enable)
Definition: graphics-internal.h:148
graphics_subsystem::using_immediate
bool using_immediate
Definition: graphics-internal.h:344
gs_init_data
Definition: graphics.h:484
gs_exports::device_enable_depth_test
void(* device_enable_depth_test)(gs_device_t *device, bool enable)
Definition: graphics-internal.h:149
gs_exports::gs_vertexbuffer_destroy
void(* gs_vertexbuffer_destroy)(gs_vertbuffer_t *vertbuffer)
Definition: graphics-internal.h:224
gs_exports::device_depth_function
void(* device_depth_function)(gs_device_t *device, enum gs_depth_test test)
Definition: graphics-internal.h:162
blend_state::src_a
enum gs_blend_type src_a
Definition: graphics-internal.h:325
gs_index_type
gs_index_type
Definition: graphics.h:86
graphics_subsystem::cur_effect
struct gs_effect * cur_effect
Definition: graphics-internal.h:340
gs_timer_t
struct gs_timer gs_timer_t
Definition: graphics.h:273
graphics_subsystem::projection
struct matrix4 projection
Definition: graphics-internal.h:339
matrix4.h
gs_shader_t
struct gs_shader gs_shader_t
Definition: graphics.h:276
gs_exports::gs_stagesurface_map
bool(* gs_stagesurface_map)(gs_stagesurf_t *stagesurf, uint8_t **data, uint32_t *linesize)
Definition: graphics-internal.h:216
gs_monitor_info
Definition: graphics.h:178
gs_vb_data::num
size_t num
Definition: graphics.h:192
graphics_subsystem::sprite_buffer
gs_vertbuffer_t * sprite_buffer
Definition: graphics-internal.h:342
gs_exports::device_get_width
uint32_t(* device_get_width)(const gs_device_t *device)
Definition: graphics-internal.h:58
gs_exports::gs_timer_destroy
void(* gs_timer_destroy)(gs_timer_t *timer)
Definition: graphics-internal.h:241
gs_exports::gs_timer_end
void(* gs_timer_end)(gs_timer_t *timer)
Definition: graphics-internal.h:243
gs_exports::gs_texture_get_width
uint32_t(* gs_texture_get_width)(const gs_texture_t *tex)
Definition: graphics-internal.h:189
gs_indexbuffer_t
struct gs_index_buffer gs_indexbuffer_t
Definition: graphics.h:270
gs_exports::device_resize
void(* device_resize)(gs_device_t *device, uint32_t x, uint32_t y)
Definition: graphics-internal.h:55
gs_exports
Definition: graphics-internal.h:26
gs_exports::device_stage_texture
void(* device_stage_texture)(gs_device_t *device, gs_stagesurf_t *dst, gs_texture_t *src)
Definition: graphics-internal.h:131
gs_exports::device_enable_stencil_test
void(* device_enable_stencil_test)(gs_device_t *device, bool enable)
Definition: graphics-internal.h:150
gs_exports::device_leave_context
void(* device_leave_context)(gs_device_t *device)
Definition: graphics-internal.h:51
blend_state::enabled
bool enabled
Definition: graphics-internal.h:322
gs_vb_data::colors
uint32_t * colors
Definition: graphics.h:196
gs_exports::device_get_viewport
void(* device_get_viewport)(const gs_device_t *device, struct gs_rect *rect)
Definition: graphics-internal.h:174
gs_exports::device_load_swapchain
void(* device_load_swapchain)(gs_device_t *device, gs_swapchain_t *swaphchain)
Definition: graphics-internal.h:138
gs_exports::device_present
void(* device_present)(gs_device_t *device)
Definition: graphics-internal.h:143
gs_texture_t
struct gs_texture gs_texture_t
Definition: graphics.h:266
gs_exports::gs_shader_set_matrix4
void(* gs_shader_set_matrix4)(gs_sparam_t *param, const struct matrix4 *val)
Definition: graphics-internal.h:266
matrix3.h
gs_exports::gs_voltexture_get_height
uint32_t(* gs_voltexture_get_height)(const gs_texture_t *voltex)
Definition: graphics-internal.h:206
gs_exports::device_load_vertexbuffer
void(* device_load_vertexbuffer)(gs_device_t *device, gs_vertbuffer_t *vertbuffer)
Definition: graphics-internal.h:100
graphics_subsystem::DARRAY
DARRAY(struct gs_rect) viewport_stack
gs_exports::gs_vertexbuffer_flush
void(* gs_vertexbuffer_flush)(gs_vertbuffer_t *vertbuffer)
Definition: graphics-internal.h:225
gs_stencil_side
gs_stencil_side
Definition: graphics.h:122
gs_exports::device_debug_marker_end
void(* device_debug_marker_end)(gs_device_t *device)
Definition: graphics-internal.h:283
gs_exports::gs_timer_range_destroy
void(* gs_timer_range_destroy)(gs_timer_range_t *range)
Definition: graphics-internal.h:245
gs_exports::gs_timer_begin
void(* gs_timer_begin)(gs_timer_t *timer)
Definition: graphics-internal.h:242
gs_draw_mode
gs_draw_mode
Definition: graphics.h:48
graphics_subsystem
Definition: graphics-internal.h:329
gs_exports::gs_indexbuffer_get_num_indices
size_t(* gs_indexbuffer_get_num_indices)(const gs_indexbuffer_t *indexbuffer)
Definition: graphics-internal.h:236
gs_exports::gs_timer_get_data
bool(* gs_timer_get_data)(gs_timer_t *timer, uint64_t *ticks)
Definition: graphics-internal.h:244
gs_shader_param_info
Definition: graphics.h:306
gs_exports::device_stencil_function
void(* device_stencil_function)(gs_device_t *device, enum gs_stencil_side side, enum gs_depth_test test)
Definition: graphics-internal.h:164
gs_exports::device_set_viewport
void(* device_set_viewport)(gs_device_t *device, int x, int y, int width, int height)
Definition: graphics-internal.h:172
gs_exports::device_debug_marker_begin
void(* device_debug_marker_begin)(gs_device_t *device, const char *markername, const float color[4])
Definition: graphics-internal.h:280
gs_exports::device_clear
void(* device_clear)(gs_device_t *device, uint32_t clear_flags, const struct vec4 *color, float depth, uint8_t stencil)
Definition: graphics-internal.h:140
gs_samplerstate_t
struct gs_sampler_state gs_samplerstate_t
Definition: graphics.h:271
gs_exports::gs_samplerstate_destroy
void(* gs_samplerstate_destroy)(gs_samplerstate_t *samplerstate)
Definition: graphics-internal.h:222
graphics_subsystem::device
gs_device_t * device
Definition: graphics-internal.h:331
gs_exports::gs_shader_set_vec4
void(* gs_shader_set_vec4)(gs_sparam_t *param, const struct vec4 *val)
Definition: graphics-internal.h:270
vec3
Definition: vec3.h:34
gs_exports::device_enable_color
void(* device_enable_color)(gs_device_t *device, bool red, bool green, bool blue, bool alpha)
Definition: graphics-internal.h:152
gs_exports::gs_texture_is_rect
bool(* gs_texture_is_rect)(const gs_texture_t *tex)
Definition: graphics-internal.h:196
gs_exports::gs_shader_set_int
void(* gs_shader_set_int)(gs_sparam_t *param, int val)
Definition: graphics-internal.h:263
gs_exports::device_get_cull_mode
enum gs_cull_mode(* device_get_cull_mode)(const gs_device_t *device)
Definition: graphics-internal.h:147
gs_sampler_info
Definition: graphics.h:223
gs_exports::gs_stagesurface_get_height
uint32_t(* gs_stagesurface_get_height)(const gs_stagesurf_t *stagesurf)
Definition: graphics-internal.h:213
gs_exports::gs_cubetexture_destroy
void(* gs_cubetexture_destroy)(gs_texture_t *cubetex)
Definition: graphics-internal.h:199
gs_exports::device_load_pixelshader
void(* device_load_pixelshader)(gs_device_t *device, gs_shader_t *pixelshader)
Definition: graphics-internal.h:111
blend_state
Definition: graphics-internal.h:321
gs_exports::device_enable_stencil_write
void(* device_enable_stencil_write)(gs_device_t *device, bool enable)
Definition: graphics-internal.h:151
blend_state::dest_a
enum gs_blend_type dest_a
Definition: graphics-internal.h:326
gs_exports::device_destroy
void(* device_destroy)(gs_device_t *device)
Definition: graphics-internal.h:49
gs_exports::device_load_vertexshader
void(* device_load_vertexshader)(gs_device_t *device, gs_shader_t *vertshader)
Definition: graphics-internal.h:109
gs_vb_data
Definition: graphics.h:191
gs_exports::device_stencil_op
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)
Definition: graphics-internal.h:167
graphics_subsystem::first_effect
struct gs_effect * first_effect
Definition: graphics-internal.h:353
gs_exports::device_load_indexbuffer
void(* device_load_indexbuffer)(gs_device_t *device, gs_indexbuffer_t *indexbuffer)
Definition: graphics-internal.h:102
gs_exports::gs_shader_set_default
void(* gs_shader_set_default)(gs_sparam_t *param)
Definition: graphics-internal.h:274
vec2
Definition: vec2.h:27
graphics_subsystem::immediate_vertbuffer
gs_vertbuffer_t * immediate_vertbuffer
Definition: graphics-internal.h:346
gs_exports::gs_shader_set_matrix3
void(* gs_shader_set_matrix3)(gs_sparam_t *param, const struct matrix3 *val)
Definition: graphics-internal.h:264
gs_exports::gs_texture_get_color_format
enum gs_color_format(* gs_texture_get_color_format)(const gs_texture_t *tex)
Definition: graphics-internal.h:191
gs_init_data::format
enum gs_color_format format
Definition: graphics.h:488
gs_exports::gs_indexbuffer_flush
void(* gs_indexbuffer_flush)(gs_indexbuffer_t *indexbuffer)
Definition: graphics-internal.h:232
gs_exports::device_set_scissor_rect
void(* device_set_scissor_rect)(gs_device_t *device, const struct gs_rect *rect)
Definition: graphics-internal.h:176
gs_exports::gs_shader_set_float
void(* gs_shader_set_float)(gs_sparam_t *param, float val)
Definition: graphics-internal.h:262
gs_exports::gs_voltexture_get_depth
uint32_t(* gs_voltexture_get_depth)(const gs_texture_t *voltex)
Definition: graphics-internal.h:207
gs_cull_mode
gs_cull_mode
Definition: graphics.h:91
gs_exports::gs_texture_unmap
void(* gs_texture_unmap)(gs_texture_t *tex)
Definition: graphics-internal.h:195
graphics_subsystem::cur_blend_state
struct blend_state cur_blend_state
Definition: graphics-internal.h:358
gs_exports::device_enum_adapters
bool(* device_enum_adapters)(bool(*callback)(void *, const char *, uint32_t), void *)
Definition: graphics-internal.h:44
gs_exports::device_enter_context
void(* device_enter_context)(gs_device_t *device)
Definition: graphics-internal.h:50
gs_exports::gs_shader_destroy
void(* gs_shader_destroy)(gs_shader_t *shader)
Definition: graphics-internal.h:251
gs_exports::device_get_size
void(* device_get_size)(const gs_device_t *device, uint32_t *x, uint32_t *y)
Definition: graphics-internal.h:56
gs_exports::gs_timer_range_get_data
bool(* gs_timer_range_get_data)(gs_timer_range_t *range, bool *disjoint, uint64_t *frequency)
Definition: graphics-internal.h:248
gs_device_loss
Definition: graphics.h:172
gs_blend_type
gs_blend_type
Definition: graphics.h:97
gs_exports::gs_shader_set_texture
void(* gs_shader_set_texture)(gs_sparam_t *param, gs_texture_t *val)
Definition: graphics-internal.h:271
gs_exports::device_set_cube_render_target
void(* device_set_cube_render_target)(gs_device_t *device, gs_texture_t *cubetex, int side, gs_zstencil_t *zstencil)
Definition: graphics-internal.h:121
gs_depth_test
gs_depth_test
Definition: graphics.h:111
gs_exports::gs_shader_set_vec3
void(* gs_shader_set_vec3)(gs_sparam_t *param, const struct vec3 *val)
Definition: graphics-internal.h:269
gs_exports::gs_zstencil_destroy
void(* gs_zstencil_destroy)(gs_zstencil_t *zstencil)
Definition: graphics-internal.h:220
blend_state::dest_c
enum gs_blend_type dest_c
Definition: graphics-internal.h:324
gs_exports::device_nv12_available
bool(* device_nv12_available)(gs_device_t *device)
Definition: graphics-internal.h:278
gs_exports::gs_texture_get_height
uint32_t(* gs_texture_get_height)(const gs_texture_t *tex)
Definition: graphics-internal.h:190
gs_exports::gs_shader_set_bool
void(* gs_shader_set_bool)(gs_sparam_t *param, bool val)
Definition: graphics-internal.h:261
gs_exports::device_draw
void(* device_draw)(gs_device_t *device, enum gs_draw_mode draw_mode, uint32_t start_vert, uint32_t num_verts)
Definition: graphics-internal.h:135
gs_exports::gs_indexbuffer_get_type
enum gs_index_type(* gs_indexbuffer_get_type)(const gs_indexbuffer_t *indexbuffer)
Definition: graphics-internal.h:238
gs_exports::device_create
int(* device_create)(gs_device_t **device, uint32_t adapter)
Definition: graphics-internal.h:48
graphics_subsystem::effect_mutex
pthread_mutex_t effect_mutex
Definition: graphics-internal.h:352
graphics_subsystem::vbd
struct gs_vb_data * vbd
Definition: graphics-internal.h:345
vec4
Definition: vec4.h:31
gs_exports::device_blend_function
void(* device_blend_function)(gs_device_t *device, enum gs_blend_type src, enum gs_blend_type dest)
Definition: graphics-internal.h:154
gs_exports::gs_cubetexture_get_color_format
enum gs_color_format(* gs_cubetexture_get_color_format)(const gs_texture_t *cubetex)
Definition: graphics-internal.h:201
gs_exports::gs_texture_map
bool(* gs_texture_map)(gs_texture_t *tex, uint8_t **ptr, uint32_t *linesize)
Definition: graphics-internal.h:193
vec4::y
float y
Definition: vec4.h:34
gs_exports::device_set_render_target
void(* device_set_render_target)(gs_device_t *device, gs_texture_t *tex, gs_zstencil_t *zstencil)
Definition: graphics-internal.h:119
gs_exports::device_load_texture
void(* device_load_texture)(gs_device_t *device, gs_texture_t *tex, int unit)
Definition: graphics-internal.h:104
gs_exports::gs_stagesurface_unmap
void(* gs_stagesurface_unmap)(gs_stagesurf_t *stagesurf)
Definition: graphics-internal.h:218
gs_zstencil_t
struct gs_zstencil_buffer gs_zstencil_t
Definition: graphics.h:268
graphics_subsystem::mutex
pthread_mutex_t mutex
Definition: graphics-internal.h:355
gs_texture_type
gs_texture_type
Definition: graphics.h:166
gs_swapchain_t
struct gs_swap_chain gs_swapchain_t
Definition: graphics.h:272
gs_exports::gs_shader_get_num_params
int(* gs_shader_get_num_params)(const gs_shader_t *shader)
Definition: graphics-internal.h:252
gs_exports::gs_voltexture_get_color_format
enum gs_color_format(* gs_voltexture_get_color_format)(const gs_texture_t *voltex)
Definition: graphics-internal.h:208
gs_exports::device_load_default_samplerstate
void(* device_load_default_samplerstate)(gs_device_t *device, bool b_3d, int unit)
Definition: graphics-internal.h:113
gs_exports::gs_timer_range_end
bool(* gs_timer_range_end)(gs_timer_range_t *range)
Definition: graphics-internal.h:247
gs_device_loss::data
void * data
Definition: graphics.h:175
gs_exports::gs_shader_set_vec2
void(* gs_shader_set_vec2)(gs_sparam_t *param, const struct vec2 *val)
Definition: graphics-internal.h:268
gs_exports::device_set_cull_mode
void(* device_set_cull_mode)(gs_device_t *device, enum gs_cull_mode mode)
Definition: graphics-internal.h:145
gs_exports::gs_texture_destroy
void(* gs_texture_destroy)(gs_texture_t *tex)
Definition: graphics-internal.h:188
gs_exports::gs_stagesurface_get_color_format
enum gs_color_format(* gs_stagesurface_get_color_format)(const gs_stagesurf_t *stagesurf)
Definition: graphics-internal.h:214
graphics_subsystem::exports
struct gs_exports exports
Definition: graphics-internal.h:332
gs_exports::gs_swapchain_destroy
void(* gs_swapchain_destroy)(gs_swapchain_t *swapchain)
Definition: graphics-internal.h:186
gs_rect
Definition: graphics.h:239
gs_exports::device_copy_texture_region
void(* device_copy_texture_region)(gs_device_t *device, 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)
Definition: graphics-internal.h:126
gs_exports::device_blend_function_separate
void(* device_blend_function_separate)(gs_device_t *device, enum gs_blend_type src_c, enum gs_blend_type dest_c, enum gs_blend_type src_a, enum gs_blend_type dest_a)
Definition: graphics-internal.h:157
gs_exports::device_get_texture_type
enum gs_texture_type(* device_get_texture_type)(const gs_texture_t *texture)
Definition: graphics-internal.h:98
gs_exports::device_begin_frame
void(* device_begin_frame)(gs_device_t *device)
Definition: graphics-internal.h:133
gs_exports::gs_stagesurface_destroy
void(* gs_stagesurface_destroy)(gs_stagesurf_t *stagesurf)
Definition: graphics-internal.h:211
gs_exports::device_frustum
void(* device_frustum)(gs_device_t *device, float left, float right, float top, float bottom, float znear, float zfar)
Definition: graphics-internal.h:180
vec4::x
float x
Definition: vec4.h:34
gs_exports::gs_shader_set_next_sampler
void(* gs_shader_set_next_sampler)(gs_sparam_t *param, gs_samplerstate_t *sampler)
Definition: graphics-internal.h:275
gs_exports::gs_shader_set_val
void(* gs_shader_set_val)(gs_sparam_t *param, const void *val, size_t size)
Definition: graphics-internal.h:272
matrix3
Definition: matrix3.h:31
gs_exports::gs_indexbuffer_flush_direct
void(* gs_indexbuffer_flush_direct)(gs_indexbuffer_t *indexbuffer, const void *data)
Definition: graphics-internal.h:233
gs_exports::gs_cubetexture_get_size
uint32_t(* gs_cubetexture_get_size)(const gs_texture_t *cubetex)
Definition: graphics-internal.h:200
gs_exports::device_get_type
int(* device_get_type)(void)
Definition: graphics-internal.h:43
gs_exports::device_load_samplerstate
void(* device_load_samplerstate)(gs_device_t *device, gs_samplerstate_t *samplerstate, int unit)
Definition: graphics-internal.h:106
gs_exports::device_copy_texture
void(* device_copy_texture)(gs_device_t *device, gs_texture_t *dst, gs_texture_t *src)
Definition: graphics-internal.h:124