Open Broadcaster Software
Free, open source software for live streaming and recording
graphics.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/bmem.h"
21 #include "input.h"
22 #ifdef __APPLE__
23 #include <objc/objc-runtime.h>
24 #endif
25 
26 /*
27  * This is an API-independent graphics subsystem wrapper.
28  *
29  * This allows the use of OpenGL and different Direct3D versions through
30  * one shared interface.
31  */
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #define GS_MAX_TEXTURES 8
38 
39 struct vec2;
40 struct vec3;
41 struct vec4;
42 struct quat;
43 struct axisang;
44 struct plane;
45 struct matrix3;
46 struct matrix4;
47 
54 };
55 
76 };
77 
84 };
85 
89 };
90 
95 };
96 
109 };
110 
120 };
121 
126 };
127 
135 };
136 
144 };
145 
156 };
157 
164 };
165 
170 };
171 
173  void (*device_loss_release)(void *data);
174  void (*device_loss_rebuild)(void *device, void *data);
175  void *data;
176 };
177 
180  long x;
181  long y;
182  long cx;
183  long cy;
184 };
185 
187  size_t width;
188  void *array;
189 };
190 
191 struct gs_vb_data {
192  size_t num;
193  struct vec3 *points;
194  struct vec3 *normals;
195  struct vec3 *tangents;
196  uint32_t *colors;
197 
198  size_t num_tex;
200 };
201 
202 static inline struct gs_vb_data *gs_vbdata_create(void)
203 {
204  return (struct gs_vb_data *)bzalloc(sizeof(struct gs_vb_data));
205 }
206 
207 static inline void gs_vbdata_destroy(struct gs_vb_data *data)
208 {
209  uint32_t i;
210  if (!data)
211  return;
212 
213  bfree(data->points);
214  bfree(data->normals);
215  bfree(data->tangents);
216  bfree(data->colors);
217  for (i = 0; i < data->num_tex; i++)
218  bfree(data->tvarray[i].array);
219  bfree(data->tvarray);
220  bfree(data);
221 }
222 
229  uint32_t border_color;
230 };
231 
233  uint32_t width;
234  uint32_t height;
235  uint32_t bits;
236  uint32_t freq;
237 };
238 
239 struct gs_rect {
240  int x;
241  int y;
242  int cx;
243  int cy;
244 };
245 
246 /* wrapped opaque data types */
247 
248 struct gs_texture;
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;
254 struct gs_shader;
255 struct gs_swap_chain;
256 struct gs_timer;
257 struct gs_texrender;
258 struct gs_shader_param;
259 struct gs_effect;
260 struct gs_effect_technique;
261 struct gs_effect_pass;
262 struct gs_effect_param;
263 struct gs_device;
264 struct graphics_subsystem;
265 
266 typedef struct gs_texture gs_texture_t;
267 typedef struct gs_stage_surface gs_stagesurf_t;
268 typedef struct gs_zstencil_buffer gs_zstencil_t;
269 typedef struct gs_vertex_buffer gs_vertbuffer_t;
270 typedef struct gs_index_buffer gs_indexbuffer_t;
271 typedef struct gs_sampler_state gs_samplerstate_t;
272 typedef struct gs_swap_chain gs_swapchain_t;
273 typedef struct gs_timer gs_timer_t;
274 typedef struct gs_timer_range gs_timer_range_t;
275 typedef struct gs_texture_render gs_texrender_t;
276 typedef struct gs_shader gs_shader_t;
277 typedef struct gs_shader_param gs_sparam_t;
278 typedef struct gs_effect gs_effect_t;
279 typedef struct gs_effect_technique gs_technique_t;
280 typedef struct gs_effect_pass gs_epass_t;
281 typedef struct gs_effect_param gs_eparam_t;
282 typedef struct gs_device gs_device_t;
283 typedef struct graphics_subsystem graphics_t;
284 
285 /* ---------------------------------------------------
286  * shader functions
287  * --------------------------------------------------- */
288 
303 };
304 
305 #ifndef SWIG
308  const char *name;
309 };
310 
314 };
315 
317 
320  uint32_t param);
322  const char *name);
323 
326 
328  struct gs_shader_param_info *info);
329 EXPORT void gs_shader_set_bool(gs_sparam_t *param, bool val);
330 EXPORT void gs_shader_set_float(gs_sparam_t *param, float val);
331 EXPORT void gs_shader_set_int(gs_sparam_t *param, int val);
333  const struct matrix3 *val);
335  const struct matrix4 *val);
336 EXPORT void gs_shader_set_vec2(gs_sparam_t *param, const struct vec2 *val);
337 EXPORT void gs_shader_set_vec3(gs_sparam_t *param, const struct vec3 *val);
338 EXPORT void gs_shader_set_vec4(gs_sparam_t *param, const struct vec4 *val);
340 EXPORT void gs_shader_set_val(gs_sparam_t *param, const void *val, size_t size);
343  gs_samplerstate_t *sampler);
344 #endif
345 
346 /* ---------------------------------------------------
347  * effect functions
348  * --------------------------------------------------- */
349 
350 /*enum gs_effect_property_type {
351  GS_EFFECT_NONE,
352  GS_EFFECT_BOOL,
353  GS_EFFECT_FLOAT,
354  GS_EFFECT_COLOR,
355  GS_EFFECT_TEXTURE
356 };*/
357 
358 #ifndef SWIG
360  const char *name;
362 
363  /* const char *full_name;
364  enum gs_effect_property_type prop_type;
365 
366  float min, max, inc, mul; */
367 };
368 #endif
369 
371 
373  const char *name);
374 
377 
380 EXPORT bool gs_technique_begin_pass(gs_technique_t *technique, size_t pass);
382  const char *name);
385  size_t pass);
388  const char *name);
389 
392  size_t param);
394  const char *name);
397  size_t annotation);
399  const char *name);
400 
404 EXPORT bool gs_effect_loop(gs_effect_t *effect, const char *name);
405 
408 
411 
412 #ifndef SWIG
414  struct gs_effect_param_info *info);
415 #endif
416 
417 EXPORT void gs_effect_set_bool(gs_eparam_t *param, bool val);
418 EXPORT void gs_effect_set_float(gs_eparam_t *param, float val);
419 EXPORT void gs_effect_set_int(gs_eparam_t *param, int val);
421  const struct matrix4 *val);
422 EXPORT void gs_effect_set_vec2(gs_eparam_t *param, const struct vec2 *val);
423 EXPORT void gs_effect_set_vec3(gs_eparam_t *param, const struct vec3 *val);
424 EXPORT void gs_effect_set_vec4(gs_eparam_t *param, const struct vec4 *val);
426 EXPORT void gs_effect_set_val(gs_eparam_t *param, const void *val, size_t size);
433  gs_samplerstate_t *sampler);
434 
435 EXPORT void gs_effect_set_color(gs_eparam_t *param, uint32_t argb);
436 
437 /* ---------------------------------------------------
438  * texture render helper functions
439  * --------------------------------------------------- */
440 
442  enum gs_zstencil_format zsformat);
444 EXPORT bool gs_texrender_begin(gs_texrender_t *texrender, uint32_t cx,
445  uint32_t cy);
449 
450 /* ---------------------------------------------------
451  * graphics subsystem
452  * --------------------------------------------------- */
453 
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 \
459  (1 << 4)
461 #define GS_SHARED_TEX (1 << 5)
462 #define GS_SHARED_KM_TEX (1 << 6)
463 
464 /* ---------------- */
465 /* global functions */
466 
467 #define GS_SUCCESS 0
468 #define GS_ERROR_FAIL -1
469 #define GS_ERROR_MODULE_NOT_FOUND -2
470 #define GS_ERROR_NOT_SUPPORTED -3
471 
472 struct gs_window {
473 #if defined(_WIN32)
474  void *hwnd;
475 #elif defined(__APPLE__)
476  __unsafe_unretained id view;
477 #elif defined(__linux__) || defined(__FreeBSD__)
478  /* I'm not sure how portable defining id to uint32_t is. */
479  uint32_t id;
480  void *display;
481 #endif
482 };
483 
484 struct gs_init_data {
485  struct gs_window window;
486  uint32_t cx, cy;
487  uint32_t num_backbuffers;
488  enum gs_color_format format;
490  uint32_t adapter;
491 };
492 
493 #define GS_DEVICE_OPENGL 1
494 #define GS_DEVICE_DIRECT3D_11 2
495 
496 EXPORT const char *gs_get_device_name(void);
498 EXPORT void gs_enum_adapters(bool (*callback)(void *param, const char *name,
499  uint32_t id),
500  void *param);
501 
502 EXPORT int gs_create(graphics_t **graphics, const char *module,
503  uint32_t adapter);
504 EXPORT void gs_destroy(graphics_t *graphics);
505 
510 
515 EXPORT void gs_matrix_set(const struct matrix4 *matrix);
516 EXPORT void gs_matrix_get(struct matrix4 *dst);
517 EXPORT void gs_matrix_mul(const struct matrix4 *matrix);
518 EXPORT void gs_matrix_rotquat(const struct quat *rot);
519 EXPORT void gs_matrix_rotaa(const struct axisang *rot);
520 EXPORT void gs_matrix_translate(const struct vec3 *pos);
521 EXPORT void gs_matrix_scale(const struct vec3 *scale);
522 EXPORT void gs_matrix_rotaa4f(float x, float y, float z, float angle);
523 EXPORT void gs_matrix_translate3f(float x, float y, float z);
524 EXPORT void gs_matrix_scale3f(float x, float y, float z);
525 
526 EXPORT void gs_render_start(bool b_new);
529 EXPORT void gs_vertex2f(float x, float y);
530 EXPORT void gs_vertex3f(float x, float y, float z);
531 EXPORT void gs_normal3f(float x, float y, float z);
532 EXPORT void gs_color(uint32_t color);
533 EXPORT void gs_texcoord(float x, float y, int unit);
534 EXPORT void gs_vertex2v(const struct vec2 *v);
535 EXPORT void gs_vertex3v(const struct vec3 *v);
536 EXPORT void gs_normal3v(const struct vec3 *v);
537 EXPORT void gs_color4v(const struct vec4 *v);
538 EXPORT void gs_texcoord2v(const struct vec2 *v, int unit);
539 
542 
544  char **error_string);
545 EXPORT gs_effect_t *gs_effect_create(const char *effect_string,
546  const char *filename, char **error_string);
547 
549  char **error_string);
551  char **error_string);
552 
554 EXPORT uint8_t *gs_create_texture_file_data(const char *file,
555  enum gs_color_format *format,
556  uint32_t *cx, uint32_t *cy);
557 
558 #define GS_FLIP_U (1 << 0)
559 #define GS_FLIP_V (1 << 1)
560 
568 EXPORT void gs_draw_sprite(gs_texture_t *tex, uint32_t flip, uint32_t width,
569  uint32_t height);
570 
572  uint32_t x, uint32_t y, uint32_t cx,
573  uint32_t cy);
574 
575 EXPORT void gs_draw_cube_backdrop(gs_texture_t *cubetex, const struct quat *rot,
576  float left, float right, float top,
577  float bottom, float znear);
578 
581 
585 EXPORT void gs_set_3d_mode(double fovy, double znear, double zvar);
586 
589 
590 EXPORT void gs_texture_set_image(gs_texture_t *tex, const uint8_t *data,
591  uint32_t linesize, bool invert);
592 EXPORT void gs_cubetexture_set_image(gs_texture_t *cubetex, uint32_t side,
593  const void *data, uint32_t linesize,
594  bool invert);
595 
596 EXPORT void gs_perspective(float fovy, float aspect, float znear, float zfar);
597 
601 
602 /* -------------------------- */
603 /* library-specific functions */
604 
606 
607 EXPORT void gs_resize(uint32_t x, uint32_t y);
608 EXPORT void gs_get_size(uint32_t *x, uint32_t *y);
609 EXPORT uint32_t gs_get_width(void);
610 EXPORT uint32_t gs_get_height(void);
611 
612 EXPORT gs_texture_t *gs_texture_create(uint32_t width, uint32_t height,
613  enum gs_color_format color_format,
614  uint32_t levels, const uint8_t **data,
615  uint32_t flags);
617 gs_cubetexture_create(uint32_t size, enum gs_color_format color_format,
618  uint32_t levels, const uint8_t **data, uint32_t flags);
619 EXPORT gs_texture_t *gs_voltexture_create(uint32_t width, uint32_t height,
620  uint32_t depth,
621  enum gs_color_format color_format,
622  uint32_t levels, const uint8_t **data,
623  uint32_t flags);
624 
625 EXPORT gs_zstencil_t *gs_zstencil_create(uint32_t width, uint32_t height,
626  enum gs_zstencil_format format);
627 
629 gs_stagesurface_create(uint32_t width, uint32_t height,
630  enum gs_color_format color_format);
631 
634 
635 EXPORT gs_shader_t *gs_vertexshader_create(const char *shader, const char *file,
636  char **error_string);
637 EXPORT gs_shader_t *gs_pixelshader_create(const char *shader, const char *file,
638  char **error_string);
639 
641  uint32_t flags);
643  void *indices, size_t num,
644  uint32_t flags);
645 
648 
650 
653 EXPORT void gs_load_texture(gs_texture_t *tex, int unit);
654 EXPORT void gs_load_samplerstate(gs_samplerstate_t *samplerstate, int unit);
657 
658 EXPORT void gs_load_default_samplerstate(bool b_3d, int unit);
659 
662 
665 
668  gs_zstencil_t *zstencil);
669 
671 EXPORT void gs_copy_texture_region(gs_texture_t *dst, uint32_t dst_x,
672  uint32_t dst_y, gs_texture_t *src,
673  uint32_t src_x, uint32_t src_y,
674  uint32_t src_w, uint32_t src_h);
676 
679 EXPORT void gs_draw(enum gs_draw_mode draw_mode, uint32_t start_vert,
680  uint32_t num_verts);
681 EXPORT void gs_end_scene(void);
682 
683 #define GS_CLEAR_COLOR (1 << 0)
684 #define GS_CLEAR_DEPTH (1 << 1)
685 #define GS_CLEAR_STENCIL (1 << 2)
686 
688 EXPORT void gs_clear(uint32_t clear_flags, const struct vec4 *color,
689  float depth, uint8_t stencil);
690 EXPORT void gs_present(void);
691 EXPORT void gs_flush(void);
692 
695 
696 EXPORT void gs_enable_blending(bool enable);
697 EXPORT void gs_enable_depth_test(bool enable);
698 EXPORT void gs_enable_stencil_test(bool enable);
699 EXPORT void gs_enable_stencil_write(bool enable);
700 EXPORT void gs_enable_color(bool red, bool green, bool blue, bool alpha);
701 
704  enum gs_blend_type dest_c,
705  enum gs_blend_type src_a,
706  enum gs_blend_type dest_a);
708 
710  enum gs_depth_test test);
712  enum gs_stencil_op_type fail,
713  enum gs_stencil_op_type zfail,
714  enum gs_stencil_op_type zpass);
715 
716 EXPORT void gs_set_viewport(int x, int y, int width, int height);
717 EXPORT void gs_get_viewport(struct gs_rect *rect);
718 EXPORT void gs_set_scissor_rect(const struct gs_rect *rect);
719 
720 EXPORT void gs_ortho(float left, float right, float top, float bottom,
721  float znear, float zfar);
722 EXPORT void gs_frustum(float left, float right, float top, float bottom,
723  float znear, float zfar);
724 
727 
729 
735 EXPORT bool gs_texture_map(gs_texture_t *tex, uint8_t **ptr,
736  uint32_t *linesize);
747 
749 EXPORT uint32_t gs_cubetexture_get_size(const gs_texture_t *cubetex);
752 
759 
765 EXPORT bool gs_stagesurface_map(gs_stagesurf_t *stagesurf, uint8_t **data,
766  uint32_t *linesize);
768 
770 
772 
776  const struct gs_vb_data *data);
777 EXPORT struct gs_vb_data *
779 
783  const void *data);
785 EXPORT size_t
788 gs_indexbuffer_get_type(const gs_indexbuffer_t *indexbuffer);
789 
793 EXPORT bool gs_timer_get_data(gs_timer_t *timer, uint64_t *ticks);
797 EXPORT bool gs_timer_range_get_data(gs_timer_range_t *range, bool *disjoint,
798  uint64_t *frequency);
799 
801 
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()
817 #else
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)
821 #endif
822 
823 EXPORT void gs_debug_marker_begin(const float color[4], const char *markername);
824 EXPORT void gs_debug_marker_begin_format(const float color[4],
825  const char *format, ...);
827 
828 #ifdef __APPLE__
829 
832 EXPORT gs_texture_t *gs_texture_create_from_iosurface(void *iosurf);
833 EXPORT bool gs_texture_rebind_iosurface(gs_texture_t *texture, void *iosurf);
834 
835 #elif _WIN32
836 
837 EXPORT bool gs_gdi_texture_available(void);
838 EXPORT bool gs_shared_texture_available(void);
839 
840 struct gs_duplicator;
841 typedef struct gs_duplicator gs_duplicator_t;
842 
847 EXPORT bool
848 gs_get_duplicator_monitor_info(int monitor_idx,
849  struct gs_monitor_info *monitor_info);
850 
852 EXPORT gs_duplicator_t *gs_duplicator_create(int monitor_idx);
853 EXPORT void gs_duplicator_destroy(gs_duplicator_t *duplicator);
854 
855 EXPORT bool gs_duplicator_update_frame(gs_duplicator_t *duplicator);
856 EXPORT gs_texture_t *gs_duplicator_get_texture(gs_duplicator_t *duplicator);
857 
859 EXPORT gs_texture_t *gs_texture_create_gdi(uint32_t width, uint32_t height);
860 
861 EXPORT void *gs_texture_get_dc(gs_texture_t *gdi_tex);
862 EXPORT void gs_texture_release_dc(gs_texture_t *gdi_tex);
863 
865 EXPORT gs_texture_t *gs_texture_open_shared(uint32_t handle);
866 
867 #define GS_INVALID_HANDLE (uint32_t) - 1
868 EXPORT uint32_t gs_texture_get_shared_handle(gs_texture_t *tex);
869 
870 #define GS_WAIT_INFINITE (uint32_t) - 1
871 
876 EXPORT int gs_texture_acquire_sync(gs_texture_t *tex, uint64_t key,
877  uint32_t ms);
878 
883 EXPORT int gs_texture_release_sync(gs_texture_t *tex, uint64_t key);
884 
885 EXPORT bool gs_texture_create_nv12(gs_texture_t **tex_y, gs_texture_t **tex_uv,
886  uint32_t width, uint32_t height,
887  uint32_t flags);
888 
889 EXPORT gs_stagesurf_t *gs_stagesurface_create_nv12(uint32_t width,
890  uint32_t height);
891 
892 EXPORT void gs_register_loss_callbacks(const struct gs_device_loss *callbacks);
893 EXPORT void gs_unregister_loss_callbacks(void *data);
894 
895 #endif
896 
897 /* inline functions used by modules */
898 
899 static inline uint32_t gs_get_format_bpp(enum gs_color_format format)
900 {
901  switch (format) {
902  case GS_A8:
903  return 8;
904  case GS_R8:
905  return 8;
906  case GS_RGBA:
907  return 32;
908  case GS_BGRX:
909  return 32;
910  case GS_BGRA:
911  return 32;
912  case GS_R10G10B10A2:
913  return 32;
914  case GS_RGBA16:
915  return 64;
916  case GS_R16:
917  return 16;
918  case GS_RGBA16F:
919  return 64;
920  case GS_RGBA32F:
921  return 128;
922  case GS_RG16F:
923  return 32;
924  case GS_RG32F:
925  return 64;
926  case GS_R16F:
927  return 16;
928  case GS_R32F:
929  return 32;
930  case GS_DXT1:
931  return 4;
932  case GS_DXT3:
933  return 8;
934  case GS_DXT5:
935  return 8;
936  case GS_R8G8:
937  return 16;
938  case GS_UNKNOWN:
939  return 0;
940  }
941 
942  return 0;
943 }
944 
945 static inline bool gs_is_compressed_format(enum gs_color_format format)
946 {
947  return (format == GS_DXT1 || format == GS_DXT3 || format == GS_DXT5);
948 }
949 
950 static inline uint32_t gs_get_total_levels(uint32_t width, uint32_t height,
951  uint32_t depth)
952 {
953  uint32_t size = width > height ? width : height;
954  size = size > depth ? size : depth;
955  uint32_t num_levels = 1;
956 
957  while (size > 1) {
958  size /= 2;
959  num_levels++;
960  }
961 
962  return num_levels;
963 }
964 
965 #ifdef __cplusplus
966 }
967 #endif
GS_R8G8
@ GS_R8G8
Definition: graphics.h:75
GS_FILTER_MIN_POINT_MAG_MIP_LINEAR
@ GS_FILTER_MIN_POINT_MAG_MIP_LINEAR
Definition: graphics.h:152
gs_effect_pass
Definition: effect.h:98
gs_display_mode
Definition: graphics.h:232
gs_get_context
EXPORT graphics_t * gs_get_context(void)
gs_vertbuffer_t
struct gs_vertex_buffer gs_vertbuffer_t
Definition: graphics.h:269
gs_stage_texture
EXPORT void gs_stage_texture(gs_stagesurf_t *dst, gs_texture_t *src)
gs_technique_end
EXPORT void gs_technique_end(gs_technique_t *technique)
gs_stencil_function
EXPORT void gs_stencil_function(enum gs_stencil_side side, enum gs_depth_test test)
gs_depth_function
EXPORT void gs_depth_function(enum gs_depth_test test)
gs_enable_stencil_write
EXPORT void gs_enable_stencil_write(bool enable)
GS_BLEND_ONE
@ GS_BLEND_ONE
Definition: graphics.h:99
gs_timer_range_begin
EXPORT void gs_timer_range_begin(gs_timer_range_t *range)
gs_stagesurf_t
struct gs_stage_surface gs_stagesurf_t
Definition: graphics.h:267
gs_technique_end_pass
EXPORT void gs_technique_end_pass(gs_technique_t *technique)
gs_device_t
struct gs_device gs_device_t
Definition: graphics.h:282
gs_texrender_begin
EXPORT bool gs_texrender_begin(gs_texrender_t *texrender, uint32_t cx, uint32_t cy)
gs_zstencil_format
gs_zstencil_format
Definition: graphics.h:78
gs_set_3d_mode
EXPORT void gs_set_3d_mode(double fovy, double znear, double zvar)
gs_rect::cy
int cy
Definition: graphics.h:243
gs_debug_marker_begin_format
EXPORT void gs_debug_marker_begin_format(const float color[4], const char *format,...)
GS_BLEND_INVSRCALPHA
@ GS_BLEND_INVSRCALPHA
Definition: graphics.h:103
GS_RGBA16
@ GS_RGBA16
Definition: graphics.h:64
GS_SHADER_PARAM_VEC4
@ GS_SHADER_PARAM_VEC4
Definition: graphics.h:297
gs_effect
Definition: effect.h:150
gs_monitor_info::y
long y
Definition: graphics.h:181
GS_SHADER_PIXEL
@ GS_SHADER_PIXEL
Definition: graphics.h:313
gs_texrender_destroy
EXPORT void gs_texrender_destroy(gs_texrender_t *texrender)
gs_resize
EXPORT void gs_resize(uint32_t x, uint32_t y)
GS_SHADER_PARAM_FLOAT
@ GS_SHADER_PARAM_FLOAT
Definition: graphics.h:292
gs_stagesurface_create
EXPORT gs_stagesurf_t * gs_stagesurface_create(uint32_t width, uint32_t height, enum gs_color_format color_format)
gs_create
EXPORT int gs_create(graphics_t **graphics, const char *module, uint32_t adapter)
gs_rect::cx
int cx
Definition: graphics.h:242
gs_texrender_end
EXPORT void gs_texrender_end(gs_texrender_t *texrender)
gs_draw_cube_backdrop
EXPORT void gs_draw_cube_backdrop(gs_texture_t *cubetex, const struct quat *rot, float left, float right, float top, float bottom, float znear)
gs_vertex3f
EXPORT void gs_vertex3f(float x, float y, float z)
GS_ZERO
@ GS_ZERO
Definition: graphics.h:130
gs_load_texture
EXPORT void gs_load_texture(gs_texture_t *tex, int unit)
gs_texrender_reset
EXPORT void gs_texrender_reset(gs_texrender_t *texrender)
gs_load_default_samplerstate
EXPORT void gs_load_default_samplerstate(bool b_3d, int unit)
gs_effect_create
EXPORT gs_effect_t * gs_effect_create(const char *effect_string, const char *filename, char **error_string)
GS_INVERT
@ GS_INVERT
Definition: graphics.h:134
gs_sparam_t
struct gs_shader_param gs_sparam_t
Definition: graphics.h:277
gs_get_width
EXPORT uint32_t gs_get_width(void)
GS_UNSIGNED_SHORT
@ GS_UNSIGNED_SHORT
Definition: graphics.h:87
GS_POSITIVE_X
@ GS_POSITIVE_X
Definition: graphics.h:138
gs_sampler_info::max_anisotropy
int max_anisotropy
Definition: graphics.h:228
gs_load_vertexbuffer
EXPORT void gs_load_vertexbuffer(gs_vertbuffer_t *vertbuffer)
gs_enable_blending
EXPORT void gs_enable_blending(bool enable)
gs_color_format
gs_color_format
Definition: graphics.h:56
gs_load_samplerstate
EXPORT void gs_load_samplerstate(gs_samplerstate_t *samplerstate, int unit)
gs_matrix_set
EXPORT void gs_matrix_set(const struct matrix4 *matrix)
gs_render_start
EXPORT void gs_render_start(bool b_new)
gs_effect_get_val
EXPORT void * gs_effect_get_val(gs_eparam_t *param)
gs_effect_set_bool
EXPORT void gs_effect_set_bool(gs_eparam_t *param, bool val)
gs_technique_get_pass_by_idx
EXPORT gs_epass_t * gs_technique_get_pass_by_idx(const gs_technique_t *technique, size_t pass)
gs_matrix_scale
EXPORT void gs_matrix_scale(const struct vec3 *scale)
gs_draw_sprite
EXPORT void gs_draw_sprite(gs_texture_t *tex, uint32_t flip, uint32_t width, uint32_t height)
gs_effect_get_technique
EXPORT gs_technique_t * gs_effect_get_technique(const gs_effect_t *effect, const char *name)
gs_texcoord
EXPORT void gs_texcoord(float x, float y, int unit)
gs_matrix_translate
EXPORT void gs_matrix_translate(const struct vec3 *pos)
gs_timer_range_create
EXPORT gs_timer_range_t * gs_timer_range_create()
GS_RGBA32F
@ GS_RGBA32F
Definition: graphics.h:67
GS_TEXTURE_3D
@ GS_TEXTURE_3D
Definition: graphics.h:168
gs_vertex3v
EXPORT void gs_vertex3v(const struct vec3 *v)
gs_shader_set_int
EXPORT void gs_shader_set_int(gs_sparam_t *param, int val)
gs_viewport_pop
EXPORT void gs_viewport_pop(void)
gs_voltexture_destroy
EXPORT void gs_voltexture_destroy(gs_texture_t *voltex)
gs_draw_sprite_subregion
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)
gs_texture_map
EXPORT bool gs_texture_map(gs_texture_t *tex, uint8_t **ptr, uint32_t *linesize)
gs_timer_range_t
struct gs_timer_range gs_timer_range_t
Definition: graphics.h:274
gs_vertexbuffer_get_data
EXPORT struct gs_vb_data * gs_vertexbuffer_get_data(const gs_vertbuffer_t *vertbuffer)
gs_texture_get_color_format
EXPORT enum gs_color_format gs_texture_get_color_format(const gs_texture_t *tex)
gs_reset_blend_state
EXPORT void gs_reset_blend_state(void)
GS_BGRA
@ GS_BGRA
Definition: graphics.h:62
GS_R16F
@ GS_R16F
Definition: graphics.h:70
GS_NEGATIVE_Z
@ GS_NEGATIVE_Z
Definition: graphics.h:143
gs_effect_set_texture
EXPORT void gs_effect_set_texture(gs_eparam_t *param, gs_texture_t *val)
gs_stencil_op_type
gs_stencil_op_type
Definition: graphics.h:128
GS_STENCIL_BOTH
@ GS_STENCIL_BOTH
Definition: graphics.h:125
matrix4
Definition: matrix4.h:32
gs_render_stop
EXPORT void gs_render_stop(enum gs_draw_mode mode)
GS_Z32F_S8X24
@ GS_Z32F_S8X24
Definition: graphics.h:83
gs_effect_get_world_matrix
EXPORT gs_eparam_t * gs_effect_get_world_matrix(const gs_effect_t *effect)
gs_shader_set_vec3
EXPORT void gs_shader_set_vec3(gs_sparam_t *param, const struct vec3 *val)
gs_init_data
Definition: graphics.h:484
gs_tvertarray::array
void * array
Definition: graphics.h:188
GS_NEGATIVE_X
@ GS_NEGATIVE_X
Definition: graphics.h:139
GS_BLEND_SRCALPHASAT
@ GS_BLEND_SRCALPHASAT
Definition: graphics.h:108
GS_BACK
@ GS_BACK
Definition: graphics.h:92
gs_vertexbuffer_create
EXPORT gs_vertbuffer_t * gs_vertexbuffer_create(struct gs_vb_data *data, uint32_t flags)
gs_texture_unmap
EXPORT void gs_texture_unmap(gs_texture_t *tex)
gs_set_cull_mode
EXPORT void gs_set_cull_mode(enum gs_cull_mode mode)
gs_stagesurface_destroy
EXPORT void gs_stagesurface_destroy(gs_stagesurf_t *stagesurf)
GS_BLEND_DSTCOLOR
@ GS_BLEND_DSTCOLOR
Definition: graphics.h:104
gs_shader_set_vec4
EXPORT void gs_shader_set_vec4(gs_sparam_t *param, const struct vec4 *val)
GS_RG16F
@ GS_RG16F
Definition: graphics.h:68
gs_cubetexture_get_size
EXPORT uint32_t gs_cubetexture_get_size(const gs_texture_t *cubetex)
gs_set_viewport
EXPORT void gs_set_viewport(int x, int y, int width, int height)
gs_indexbuffer_flush_direct
EXPORT void gs_indexbuffer_flush_direct(gs_indexbuffer_t *indexbuffer, const void *data)
GS_DECR
@ GS_DECR
Definition: graphics.h:133
gs_frustum
EXPORT void gs_frustum(float left, float right, float top, float bottom, float znear, float zfar)
gs_load_swapchain
EXPORT void gs_load_swapchain(gs_swapchain_t *swapchain)
gs_enable_depth_test
EXPORT void gs_enable_depth_test(bool enable)
GS_ADDRESS_MIRRORONCE
@ GS_ADDRESS_MIRRORONCE
Definition: graphics.h:163
gs_matrix_translate3f
EXPORT void gs_matrix_translate3f(float x, float y, float z)
gs_texture_get_height
EXPORT uint32_t gs_texture_get_height(const gs_texture_t *tex)
GS_RG32F
@ GS_RG32F
Definition: graphics.h:69
gs_sample_filter
gs_sample_filter
Definition: graphics.h:146
gs_sampler_info::border_color
uint32_t border_color
Definition: graphics.h:229
gs_index_type
gs_index_type
Definition: graphics.h:86
GS_GEQUAL
@ GS_GEQUAL
Definition: graphics.h:116
bfree
EXPORT void bfree(void *ptr)
gs_shader_get_param_by_idx
EXPORT gs_sparam_t * gs_shader_get_param_by_idx(gs_shader_t *shader, uint32_t param)
EXPORT
#define EXPORT
Definition: c99defs.h:37
gs_shader_set_matrix3
EXPORT void gs_shader_set_matrix3(gs_sparam_t *param, const struct matrix3 *val)
gs_vertexbuffer_flush
EXPORT void gs_vertexbuffer_flush(gs_vertbuffer_t *vertbuffer)
gs_voltexture_create
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
@ GS_R8
Definition: graphics.h:59
gs_set_cube_render_target
EXPORT void gs_set_cube_render_target(gs_texture_t *cubetex, int side, gs_zstencil_t *zstencil)
GS_BLEND_INVSRCCOLOR
@ GS_BLEND_INVSRCCOLOR
Definition: graphics.h:101
gs_timer_t
struct gs_timer gs_timer_t
Definition: graphics.h:273
gs_matrix_rotaa4f
EXPORT void gs_matrix_rotaa4f(float x, float y, float z, float angle)
GS_BLEND_SRCCOLOR
@ GS_BLEND_SRCCOLOR
Definition: graphics.h:100
gs_blend_function_separate
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)
gs_normal3f
EXPORT void gs_normal3f(float x, float y, float z)
gs_shader_t
struct gs_shader gs_shader_t
Definition: graphics.h:276
gs_get_texture_type
EXPORT enum gs_texture_type gs_get_texture_type(const gs_texture_t *texture)
gs_monitor_info::cy
long cy
Definition: graphics.h:183
GS_TEXTURE_CUBE
@ GS_TEXTURE_CUBE
Definition: graphics.h:169
gs_monitor_info
Definition: graphics.h:178
gs_samplerstate_destroy
EXPORT void gs_samplerstate_destroy(gs_samplerstate_t *samplerstate)
GS_DXT5
@ GS_DXT5
Definition: graphics.h:74
gs_zstencil_destroy
EXPORT void gs_zstencil_destroy(gs_zstencil_t *zstencil)
gs_param_get_annotation_by_idx
EXPORT gs_eparam_t * gs_param_get_annotation_by_idx(const gs_eparam_t *param, size_t annotation)
gs_vb_data::num
size_t num
Definition: graphics.h:192
gs_timer_range_get_data
EXPORT bool gs_timer_range_get_data(gs_timer_range_t *range, bool *disjoint, uint64_t *frequency)
GS_FILTER_ANISOTROPIC
@ GS_FILTER_ANISOTROPIC
Definition: graphics.h:149
gs_stencil_op
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)
gs_indexbuffer_get_num_indices
EXPORT size_t gs_indexbuffer_get_num_indices(const gs_indexbuffer_t *indexbuffer)
gs_vb_data::normals
struct vec3 * normals
Definition: graphics.h:194
gs_reset_viewport
EXPORT void gs_reset_viewport(void)
gs_enable_color
EXPORT void gs_enable_color(bool red, bool green, bool blue, bool alpha)
gs_shader_set_vec2
EXPORT void gs_shader_set_vec2(gs_sparam_t *param, const struct vec2 *val)
GS_RGBA16F
@ GS_RGBA16F
Definition: graphics.h:66
GS_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR
@ GS_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR
Definition: graphics.h:154
GS_NEVER
@ GS_NEVER
Definition: graphics.h:112
gs_indexbuffer_t
struct gs_index_buffer gs_indexbuffer_t
Definition: graphics.h:270
gs_texture_set_image
EXPORT void gs_texture_set_image(gs_texture_t *tex, const uint8_t *data, uint32_t linesize, bool invert)
gs_projection_pop
EXPORT void gs_projection_pop(void)
gs_swapchain_destroy
EXPORT void gs_swapchain_destroy(gs_swapchain_t *swapchain)
gs_shader_param_type
gs_shader_param_type
Definition: graphics.h:289
GS_SHADER_PARAM_BOOL
@ GS_SHADER_PARAM_BOOL
Definition: graphics.h:291
gs_effect_loop
EXPORT bool gs_effect_loop(gs_effect_t *effect, const char *name)
gs_effect_get_param_by_idx
EXPORT gs_eparam_t * gs_effect_get_param_by_idx(const gs_effect_t *effect, size_t param)
GS_KEEP
@ GS_KEEP
Definition: graphics.h:129
gs_begin_scene
EXPORT void gs_begin_scene(void)
gs_set_render_target
EXPORT void gs_set_render_target(gs_texture_t *tex, gs_zstencil_t *zstencil)
gs_timer_destroy
EXPORT void gs_timer_destroy(gs_timer_t *timer)
GS_SHADER_PARAM_UNKNOWN
@ GS_SHADER_PARAM_UNKNOWN
Definition: graphics.h:290
gs_texture_create
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
@ GS_SHADER_PARAM_VEC2
Definition: graphics.h:295
gs_present
EXPORT void gs_present(void)
gs_vb_data::colors
uint32_t * colors
Definition: graphics.h:196
gs_indexbuffer_get_data
EXPORT void * gs_indexbuffer_get_data(const gs_indexbuffer_t *indexbuffer)
gs_init_data::num_backbuffers
uint32_t num_backbuffers
Definition: graphics.h:487
gs_shader_set_default
EXPORT void gs_shader_set_default(gs_sparam_t *param)
gs_technique_get_pass_by_name
EXPORT gs_epass_t * gs_technique_get_pass_by_name(const gs_technique_t *technique, const char *name)
gs_matrix_rotquat
EXPORT void gs_matrix_rotquat(const struct quat *rot)
input_t
struct input_subsystem input_t
Definition: input.h:146
gs_display_mode::height
uint32_t height
Definition: graphics.h:234
GS_FILTER_POINT
@ GS_FILTER_POINT
Definition: graphics.h:147
gs_shader_get_param_info
EXPORT void gs_shader_get_param_info(const gs_sparam_t *param, struct gs_shader_param_info *info)
gs_display_mode::bits
uint32_t bits
Definition: graphics.h:235
gs_shader_param_info::name
const char * name
Definition: graphics.h:308
gs_pixelshader_create
EXPORT gs_shader_t * gs_pixelshader_create(const char *shader, const char *file, char **error_string)
gs_texrender_create
EXPORT gs_texrender_t * gs_texrender_create(enum gs_color_format format, enum gs_zstencil_format zsformat)
gs_effect_param_info
Definition: graphics.h:359
axisang
Definition: axisang.h:28
gs_init_data::zsformat
enum gs_zstencil_format zsformat
Definition: graphics.h:489
gs_texture_t
struct gs_texture gs_texture_t
Definition: graphics.h:266
gs_effect_technique
Definition: effect.h:125
gs_samplerstate_create
EXPORT gs_samplerstate_t * gs_samplerstate_create(const struct gs_sampler_info *info)
gs_copy_texture_region
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)
gs_vertex2v
EXPORT void gs_vertex2v(const struct vec2 *v)
gs_effect_param
Definition: effect.h:50
gs_sampler_info::address_v
enum gs_address_mode address_v
Definition: graphics.h:226
gs_tvertarray::width
size_t width
Definition: graphics.h:187
GS_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT
@ GS_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT
Definition: graphics.h:151
gs_viewport_push
EXPORT void gs_viewport_push(void)
gs_effect_param_info::type
enum gs_shader_param_type type
Definition: graphics.h:361
GS_GREATER
@ GS_GREATER
Definition: graphics.h:117
gs_effect_destroy
EXPORT void gs_effect_destroy(gs_effect_t *effect)
gs_effect_set_int
EXPORT void gs_effect_set_int(gs_eparam_t *param, int val)
gs_draw
EXPORT void gs_draw(enum gs_draw_mode draw_mode, uint32_t start_vert, uint32_t num_verts)
GS_ADDRESS_WRAP
@ GS_ADDRESS_WRAP
Definition: graphics.h:160
GS_FRONT
@ GS_FRONT
Definition: graphics.h:93
gs_stencil_side
gs_stencil_side
Definition: graphics.h:122
gs_vertexshader_create_from_file
EXPORT gs_shader_t * gs_vertexshader_create_from_file(const char *file, char **error_string)
gs_init_data::window
struct gs_window window
Definition: graphics.h:485
GS_SHADER_VERTEX
@ GS_SHADER_VERTEX
Definition: graphics.h:312
gs_draw_mode
gs_draw_mode
Definition: graphics.h:48
gs_debug_marker_begin
EXPORT void gs_debug_marker_begin(const float color[4], const char *markername)
gs_get_device_name
EXPORT const char * gs_get_device_name(void)
gs_shader_get_num_params
EXPORT int gs_shader_get_num_params(const gs_shader_t *shader)
GS_A8
@ GS_A8
Definition: graphics.h:58
gs_cubetexture_destroy
EXPORT void gs_cubetexture_destroy(gs_texture_t *cubetex)
graphics_subsystem
Definition: graphics-internal.h:329
gs_get_effect
EXPORT gs_effect_t * gs_get_effect(void)
gs_technique_begin
EXPORT size_t gs_technique_begin(gs_technique_t *technique)
GS_R10G10B10A2
@ GS_R10G10B10A2
Definition: graphics.h:63
gs_init_data::adapter
uint32_t adapter
Definition: graphics.h:490
gs_projection_push
EXPORT void gs_projection_push(void)
gs_shader_param_info
Definition: graphics.h:306
gs_shader_get_world_matrix
EXPORT gs_sparam_t * gs_shader_get_world_matrix(const gs_shader_t *shader)
gs_shader_param_info::type
enum gs_shader_param_type type
Definition: graphics.h:307
GS_Z16
@ GS_Z16
Definition: graphics.h:80
gs_color4v
EXPORT void gs_color4v(const struct vec4 *v)
gs_copy_texture
EXPORT void gs_copy_texture(gs_texture_t *dst, gs_texture_t *src)
gs_normal3v
EXPORT void gs_normal3v(const struct vec3 *v)
gs_indexbuffer_get_type
EXPORT enum gs_index_type gs_indexbuffer_get_type(const gs_indexbuffer_t *indexbuffer)
gs_voltexture_get_width
EXPORT uint32_t gs_voltexture_get_width(const gs_texture_t *voltex)
gs_stagesurface_get_width
EXPORT uint32_t gs_stagesurface_get_width(const gs_stagesurf_t *stagesurf)
GS_DXT1
@ GS_DXT1
Definition: graphics.h:72
gs_effect_set_vec3
EXPORT void gs_effect_set_vec3(gs_eparam_t *param, const struct vec3 *val)
gs_matrix_transpose
EXPORT void gs_matrix_transpose(void)
gs_samplerstate_t
struct gs_sampler_state gs_samplerstate_t
Definition: graphics.h:271
gs_texrender_get_texture
EXPORT gs_texture_t * gs_texrender_get_texture(const gs_texrender_t *texrender)
gs_indexbuffer_destroy
EXPORT void gs_indexbuffer_destroy(gs_indexbuffer_t *indexbuffer)
gs_voltexture_get_depth
EXPORT uint32_t gs_voltexture_get_depth(const gs_texture_t *voltex)
gs_effect_get_val_size
EXPORT size_t gs_effect_get_val_size(gs_eparam_t *param)
gs_voltexture_get_color_format
EXPORT enum gs_color_format gs_voltexture_get_color_format(const gs_texture_t *voltex)
gs_matrix_get
EXPORT void gs_matrix_get(struct matrix4 *dst)
gs_effect_set_matrix4
EXPORT void gs_effect_set_matrix4(gs_eparam_t *param, const struct matrix4 *val)
GS_TRISTRIP
@ GS_TRISTRIP
Definition: graphics.h:53
gs_technique_begin_pass_by_name
EXPORT bool gs_technique_begin_pass_by_name(gs_technique_t *technique, const char *name)
vec3
Definition: vec3.h:34
gs_effect_get_default_val
EXPORT void * gs_effect_get_default_val(gs_eparam_t *param)
GS_SHADER_PARAM_INT3
@ GS_SHADER_PARAM_INT3
Definition: graphics.h:299
gs_clear
EXPORT void gs_clear(uint32_t clear_flags, const struct vec4 *color, float depth, uint8_t stencil)
gs_sampler_info
Definition: graphics.h:223
gs_effect_set_default
EXPORT void gs_effect_set_default(gs_eparam_t *param)
gs_get_render_target
EXPORT gs_texture_t * gs_get_render_target(void)
GS_ZS_NONE
@ GS_ZS_NONE
Definition: graphics.h:79
gs_indexbuffer_flush
EXPORT void gs_indexbuffer_flush(gs_indexbuffer_t *indexbuffer)
gs_matrix_mul
EXPORT void gs_matrix_mul(const struct matrix4 *matrix)
GS_POSITIVE_Z
@ GS_POSITIVE_Z
Definition: graphics.h:142
GS_POINTS
@ GS_POINTS
Definition: graphics.h:49
GS_ADDRESS_MIRROR
@ GS_ADDRESS_MIRROR
Definition: graphics.h:161
GS_FILTER_LINEAR
@ GS_FILTER_LINEAR
Definition: graphics.h:148
gs_texture_destroy
EXPORT void gs_texture_destroy(gs_texture_t *tex)
gs_vb_data
Definition: graphics.h:191
gs_shader_set_bool
EXPORT void gs_shader_set_bool(gs_sparam_t *param, bool val)
gs_set_2d_mode
EXPORT void gs_set_2d_mode(void)
GS_LEQUAL
@ GS_LEQUAL
Definition: graphics.h:114
gs_matrix_scale3f
EXPORT void gs_matrix_scale3f(float x, float y, float z)
GS_DXT3
@ GS_DXT3
Definition: graphics.h:73
vec2
Definition: vec2.h:27
gs_sampler_info::address_w
enum gs_address_mode address_w
Definition: graphics.h:227
gs_get_vertex_shader
EXPORT gs_shader_t * gs_get_vertex_shader(void)
GS_Z32F
@ GS_Z32F
Definition: graphics.h:82
gs_cubetexture_get_color_format
EXPORT enum gs_color_format gs_cubetexture_get_color_format(const gs_texture_t *cubetex)
gs_init_data::format
enum gs_color_format format
Definition: graphics.h:488
gs_monitor_info::x
long x
Definition: graphics.h:180
gs_timer_begin
EXPORT void gs_timer_begin(gs_timer_t *timer)
gs_enable_stencil_test
EXPORT void gs_enable_stencil_test(bool enable)
gs_texcoord2v
EXPORT void gs_texcoord2v(const struct vec2 *v, int unit)
GS_STENCIL_FRONT
@ GS_STENCIL_FRONT
Definition: graphics.h:123
gs_color
EXPORT void gs_color(uint32_t color)
GS_BLEND_INVDSTALPHA
@ GS_BLEND_INVDSTALPHA
Definition: graphics.h:107
gs_rect::x
int x
Definition: graphics.h:240
GS_LINESTRIP
@ GS_LINESTRIP
Definition: graphics.h:51
gs_effect_get_current_technique
EXPORT gs_technique_t * gs_effect_get_current_technique(const gs_effect_t *effect)
gs_stagesurface_map
EXPORT bool gs_stagesurface_map(gs_stagesurf_t *stagesurf, uint8_t **data, uint32_t *linesize)
GS_LESS
@ GS_LESS
Definition: graphics.h:113
gs_texture_get_obj
EXPORT void * gs_texture_get_obj(gs_texture_t *tex)
GS_SHADER_PARAM_MATRIX4X4
@ GS_SHADER_PARAM_MATRIX4X4
Definition: graphics.h:301
GS_STENCIL_BACK
@ GS_STENCIL_BACK
Definition: graphics.h:124
gs_address_mode
gs_address_mode
Definition: graphics.h:158
GS_SHADER_PARAM_VEC3
@ GS_SHADER_PARAM_VEC3
Definition: graphics.h:296
gs_get_pixel_shader
EXPORT gs_shader_t * gs_get_pixel_shader(void)
gs_shader_set_val
EXPORT void gs_shader_set_val(gs_sparam_t *param, const void *val, size_t size)
gs_param_get_num_annotations
EXPORT size_t gs_param_get_num_annotations(const gs_eparam_t *param)
gs_cull_mode
gs_cull_mode
Definition: graphics.h:91
GS_NOTEQUAL
@ GS_NOTEQUAL
Definition: graphics.h:118
gs_monitor_info::rotation_degrees
int rotation_degrees
Definition: graphics.h:179
gs_shader_get_param_by_name
EXPORT gs_sparam_t * gs_shader_get_param_by_name(gs_shader_t *shader, const char *name)
GS_FILTER_MIN_MAG_LINEAR_MIP_POINT
@ GS_FILTER_MIN_MAG_LINEAR_MIP_POINT
Definition: graphics.h:155
gs_destroy
EXPORT void gs_destroy(graphics_t *graphics)
gs_stagesurface_get_height
EXPORT uint32_t gs_stagesurface_get_height(const gs_stagesurf_t *stagesurf)
gs_texture_is_rect
EXPORT bool gs_texture_is_rect(const gs_texture_t *tex)
gs_timer_get_data
EXPORT bool gs_timer_get_data(gs_timer_t *timer, uint64_t *ticks)
GS_EQUAL
@ GS_EQUAL
Definition: graphics.h:115
GS_POSITIVE_Y
@ GS_POSITIVE_Y
Definition: graphics.h:140
gs_cube_sides
gs_cube_sides
Definition: graphics.h:137
gs_vertexbuffer_flush_direct
EXPORT void gs_vertexbuffer_flush_direct(gs_vertbuffer_t *vertbuffer, const struct gs_vb_data *data)
gs_vb_data::points
struct vec3 * points
Definition: graphics.h:193
gs_shader_set_next_sampler
EXPORT void gs_shader_set_next_sampler(gs_sparam_t *param, gs_samplerstate_t *sampler)
gs_shader_set_matrix4
EXPORT void gs_shader_set_matrix4(gs_sparam_t *param, const struct matrix4 *val)
GS_LINES
@ GS_LINES
Definition: graphics.h:50
gs_shader_set_texture
EXPORT void gs_shader_set_texture(gs_sparam_t *param, gs_texture_t *val)
gs_effect_get_num_params
EXPORT size_t gs_effect_get_num_params(const gs_effect_t *effect)
gs_effect_param_info::name
const char * name
Definition: graphics.h:360
gs_device_loss
Definition: graphics.h:172
gs_blend_type
gs_blend_type
Definition: graphics.h:97
gs_load_vertexshader
EXPORT void gs_load_vertexshader(gs_shader_t *vertshader)
GS_RGBA
@ GS_RGBA
Definition: graphics.h:60
gs_effect_update_params
EXPORT void gs_effect_update_params(gs_effect_t *effect)
gs_get_zstencil_target
EXPORT gs_zstencil_t * gs_get_zstencil_target(void)
gs_indexbuffer_create
EXPORT gs_indexbuffer_t * gs_indexbuffer_create(enum gs_index_type type, void *indices, size_t num, uint32_t flags)
gs_vb_data::tangents
struct vec3 * tangents
Definition: graphics.h:195
gs_blend_state_push
EXPORT void gs_blend_state_push(void)
gs_get_viewport
EXPORT void gs_get_viewport(struct gs_rect *rect)
gs_enter_context
EXPORT void gs_enter_context(graphics_t *graphics)
gs_render_save
EXPORT gs_vertbuffer_t * gs_render_save(void)
gs_effect_set_color
EXPORT void gs_effect_set_color(gs_eparam_t *param, uint32_t argb)
gs_depth_test
gs_depth_test
Definition: graphics.h:111
gs_load_pixelshader
EXPORT void gs_load_pixelshader(gs_shader_t *pixelshader)
GS_SHADER_PARAM_STRING
@ GS_SHADER_PARAM_STRING
Definition: graphics.h:294
gs_get_size
EXPORT void gs_get_size(uint32_t *x, uint32_t *y)
GS_BLEND_DSTALPHA
@ GS_BLEND_DSTALPHA
Definition: graphics.h:106
gs_sampler_info::filter
enum gs_sample_filter filter
Definition: graphics.h:224
gs_matrix_pop
EXPORT void gs_matrix_pop(void)
gs_matrix_identity
EXPORT void gs_matrix_identity(void)
gs_voltexture_get_height
EXPORT uint32_t gs_voltexture_get_height(const gs_texture_t *voltex)
gs_effect_set_val
EXPORT void gs_effect_set_val(gs_eparam_t *param, const void *val, size_t size)
GS_REPLACE
@ GS_REPLACE
Definition: graphics.h:131
GS_BLEND_SRCALPHA
@ GS_BLEND_SRCALPHA
Definition: graphics.h:102
gs_texture_get_width
EXPORT uint32_t gs_texture_get_width(const gs_texture_t *tex)
gs_matrix_push
EXPORT void gs_matrix_push(void)
GS_TRIS
@ GS_TRIS
Definition: graphics.h:52
gs_effect_get_param_by_name
EXPORT gs_eparam_t * gs_effect_get_param_by_name(const gs_effect_t *effect, const char *name)
GS_ADDRESS_BORDER
@ GS_ADDRESS_BORDER
Definition: graphics.h:162
vec4
Definition: vec4.h:31
GS_TEXTURE_2D
@ GS_TEXTURE_2D
Definition: graphics.h:167
gs_sampler_info::address_u
enum gs_address_mode address_u
Definition: graphics.h:225
gs_timer_create
EXPORT gs_timer_t * gs_timer_create()
GS_UNKNOWN
@ GS_UNKNOWN
Definition: graphics.h:57
GS_BLEND_INVDSTCOLOR
@ GS_BLEND_INVDSTCOLOR
Definition: graphics.h:105
gs_texrender_t
struct gs_texture_render gs_texrender_t
Definition: graphics.h:275
gs_enum_adapters
EXPORT void gs_enum_adapters(bool(*callback)(void *param, const char *name, uint32_t id), void *param)
gs_set_scissor_rect
EXPORT void gs_set_scissor_rect(const struct gs_rect *rect)
GS_UNSIGNED_LONG
@ GS_UNSIGNED_LONG
Definition: graphics.h:88
gs_zstencil_t
struct gs_zstencil_buffer gs_zstencil_t
Definition: graphics.h:268
gs_shader_get_viewproj_matrix
EXPORT gs_sparam_t * gs_shader_get_viewproj_matrix(const gs_shader_t *shader)
gs_get_input
EXPORT input_t * gs_get_input(void)
gs_shader_type
gs_shader_type
Definition: graphics.h:311
gs_vertexbuffer_destroy
EXPORT void gs_vertexbuffer_destroy(gs_vertbuffer_t *vertbuffer)
gs_vertexshader_create
EXPORT gs_shader_t * gs_vertexshader_create(const char *shader, const char *file, char **error_string)
gs_effect_set_next_sampler
EXPORT void gs_effect_set_next_sampler(gs_eparam_t *param, gs_samplerstate_t *sampler)
gs_pixelshader_create_from_file
EXPORT gs_shader_t * gs_pixelshader_create_from_file(const char *file, char **error_string)
gs_debug_marker_end
EXPORT void gs_debug_marker_end(void)
gs_vb_data::tvarray
struct gs_tvertarray * tvarray
Definition: graphics.h:199
gs_matrix_rotaa
EXPORT void gs_matrix_rotaa(const struct axisang *rot)
gs_effect_set_float
EXPORT void gs_effect_set_float(gs_eparam_t *param, float val)
gs_texture_type
gs_texture_type
Definition: graphics.h:166
gs_nv12_available
EXPORT bool gs_nv12_available(void)
gs_technique_begin_pass
EXPORT bool gs_technique_begin_pass(gs_technique_t *technique, size_t pass)
GS_INCR
@ GS_INCR
Definition: graphics.h:132
gs_display_mode::freq
uint32_t freq
Definition: graphics.h:236
gs_get_device_type
EXPORT int gs_get_device_type(void)
gs_swapchain_t
struct gs_swap_chain gs_swapchain_t
Definition: graphics.h:272
GS_SHADER_PARAM_INT
@ GS_SHADER_PARAM_INT
Definition: graphics.h:293
GS_NEGATIVE_Y
@ GS_NEGATIVE_Y
Definition: graphics.h:141
gs_stagesurface_get_color_format
EXPORT enum gs_color_format gs_stagesurface_get_color_format(const gs_stagesurf_t *stagesurf)
gs_perspective
EXPORT void gs_perspective(float fovy, float aspect, float znear, float zfar)
gs_ortho
EXPORT void gs_ortho(float left, float right, float top, float bottom, float znear, float zfar)
gs_timer_range_end
EXPORT void gs_timer_range_end(gs_timer_range_t *range)
gs_device_loss::device_loss_rebuild
void(* device_loss_rebuild)(void *device, void *data)
Definition: graphics.h:174
gs_shader_set_float
EXPORT void gs_shader_set_float(gs_sparam_t *param, float val)
gs_init_data::cx
uint32_t cx
Definition: graphics.h:486
gs_effect_create_from_file
EXPORT gs_effect_t * gs_effect_create_from_file(const char *file, char **error_string)
gs_window
Definition: graphics.h:472
gs_device_loss::data
void * data
Definition: graphics.h:175
gs_blend_function
EXPORT void gs_blend_function(enum gs_blend_type src, enum gs_blend_type dest)
gs_effect_set_vec4
EXPORT void gs_effect_set_vec4(gs_eparam_t *param, const struct vec4 *val)
gs_stagesurface_unmap
EXPORT void gs_stagesurface_unmap(gs_stagesurf_t *stagesurf)
gs_init_data::cy
uint32_t cy
Definition: graphics.h:486
GS_ALWAYS
@ GS_ALWAYS
Definition: graphics.h:119
gs_display_mode::width
uint32_t width
Definition: graphics.h:233
gs_device_loss::device_loss_release
void(* device_loss_release)(void *data)
Definition: graphics.h:173
GS_Z24_S8
@ GS_Z24_S8
Definition: graphics.h:81
GS_BGRX
@ GS_BGRX
Definition: graphics.h:61
gs_param_get_annotation_by_name
EXPORT gs_eparam_t * gs_param_get_annotation_by_name(const gs_eparam_t *param, const char *name)
gs_shader_destroy
EXPORT void gs_shader_destroy(gs_shader_t *shader)
gs_flush
EXPORT void gs_flush(void)
GS_R32F
@ GS_R32F
Definition: graphics.h:71
gs_rect
Definition: graphics.h:239
gs_vertex2f
EXPORT void gs_vertex2f(float x, float y)
gs_swapchain_create
EXPORT gs_swapchain_t * gs_swapchain_create(const struct gs_init_data *data)
gs_tvertarray
Definition: graphics.h:186
GS_SHADER_PARAM_INT4
@ GS_SHADER_PARAM_INT4
Definition: graphics.h:300
gs_timer_range_destroy
EXPORT void gs_timer_range_destroy(gs_timer_range_t *timer)
gs_effect_get_default_val_size
EXPORT size_t gs_effect_get_default_val_size(gs_eparam_t *param)
GS_SHADER_PARAM_INT2
@ GS_SHADER_PARAM_INT2
Definition: graphics.h:298
gs_load_indexbuffer
EXPORT void gs_load_indexbuffer(gs_indexbuffer_t *indexbuffer)
gs_vb_data::num_tex
size_t num_tex
Definition: graphics.h:198
input.h
plane
Definition: plane.h:30
gs_leave_context
EXPORT void gs_leave_context(void)
gs_monitor_info::cx
long cx
Definition: graphics.h:182
gs_get_device_obj
EXPORT void * gs_get_device_obj(void)
gs_zstencil_create
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
@ GS_FILTER_MIN_LINEAR_MAG_MIP_POINT
Definition: graphics.h:153
gs_effect_set_vec2
EXPORT void gs_effect_set_vec2(gs_eparam_t *param, const struct vec2 *val)
gs_cubetexture_create
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
@ GS_NEITHER
Definition: graphics.h:94
gs_blend_state_pop
EXPORT void gs_blend_state_pop(void)
gs_timer_end
EXPORT void gs_timer_end(gs_timer_t *timer)
gs_begin_frame
EXPORT void gs_begin_frame(void)
gs_get_cull_mode
EXPORT enum gs_cull_mode gs_get_cull_mode(void)
GS_SHADER_PARAM_TEXTURE
@ GS_SHADER_PARAM_TEXTURE
Definition: graphics.h:302
GS_ADDRESS_CLAMP
@ GS_ADDRESS_CLAMP
Definition: graphics.h:159
matrix3
Definition: matrix3.h:31
gs_cubetexture_set_image
EXPORT void gs_cubetexture_set_image(gs_texture_t *cubetex, uint32_t side, const void *data, uint32_t linesize, bool invert)
GS_R16
@ GS_R16
Definition: graphics.h:65
gs_effect_get_viewproj_matrix
EXPORT gs_eparam_t * gs_effect_get_viewproj_matrix(const gs_effect_t *effect)
GS_FILTER_MIN_MAG_POINT_MIP_LINEAR
@ GS_FILTER_MIN_MAG_POINT_MIP_LINEAR
Definition: graphics.h:150
gs_rect::y
int y
Definition: graphics.h:241
quat
Definition: quat.h:42
gs_create_texture_file_data
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
@ GS_BLEND_ZERO
Definition: graphics.h:98
gs_effect_get_param_info
EXPORT void gs_effect_get_param_info(const gs_eparam_t *param, struct gs_effect_param_info *info)
gs_get_height
EXPORT uint32_t gs_get_height(void)
gs_texture_create_from_file
EXPORT gs_texture_t * gs_texture_create_from_file(const char *file)
gs_end_scene
EXPORT void gs_end_scene(void)