0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

161 Commits

Author SHA1 Message Date
James Park
cb67192077 libobs: Fix invalid max_anisotropy value
max_anisotropy is initialized to zero, but the minimum value is 1.
2019-03-19 01:26:28 -07:00
Dmitry-Me
b835d7ec05 libobs: Fix effect parsing log specifiers
Closes #1649
2019-03-14 00:04:15 -05:00
jp9000
a776a6cf07 libobs/graphics: Add memory usage member to image file
Allows estimating the required memory usage of an image.
2019-03-13 01:11:18 -07:00
jp9000
93fc61fa82 libobs/graphics: Add NV12 texture support 2019-02-07 17:00:46 -08:00
jp9000
b64d7d71d0 libobs/graphics: Add texture sharing functions 2019-02-07 17:00:46 -08:00
Alex Anderson
fc97512f71 libobs: Fix crash when pixel or vertex shader are missing
Checks that the token is not null while looping. Logs errors when pixel
or vertex shader are missing.
2018-12-03 15:02:20 -08:00
Jim
118dbf9e67
Merge pull request #1481 from Andersama/patch-26
libobs: Export image-file to c
2018-09-12 02:05:26 -07:00
Alex Anderson
b30c843622
libobs: Export image-file to c
Wraps image-file.h in extern "C" like rest of libobs api.

Prevents unresolved external errors when using in c++.
2018-09-11 13:31:45 -07:00
Alex Anderson
e0cd45be9b libobs: Add additional gs_effect_get_ functions
Adds api functions to extract gs_eparam_t values, including
gs_effect_get_val(), gs_effect_get_val_size(),
gs_effect_get_default_val() and gs_effect_get_default_val_size()
2018-09-08 05:22:12 -07:00
Alex Anderson
af67086912 libobs: Add HLSL annotation parsing
Gives the ability to retrieve param annotations. Blocks wrapped in <>
following a parameter.

For example:
float slider < float max_value = 10.0; float min_value = 0.0; >;

These blocks are not for shading purposes but to help describe the
shader's gui as in the example above.

Adds graphics api functions for retrieving annotations:
size_t gs_param_get_num_annotations(const gs_eparam_t *param);

gs_eparam_t *gs_param_get_annotation_by_idx(const gs_eparam_t *param,
		size_t annotation);

gs_eparam_t *gs_param_get_annotation_by_name(const gs_eparam_t *param,
		const char *name);
2018-09-08 05:22:12 -07:00
nleseul
5a111cf073 libobs: Handle 'in', 'out', and 'inout' keywords in shader parsers 2018-05-28 12:07:20 -04:00
jp9000
66f993d214 libobs: Exclude certain declarations from SWIG processing
Prevents SWIG from being able to process certain declarations that would
cause binding generation errors/warnings.
2018-01-03 17:04:04 -08:00
jp9000
b56c33a260 libobs/util: Add THREAD_LOCAL macro
Adds a thread local storage macro to declare thread local storage
independent of platform.
2018-01-03 17:04:02 -08:00
jp9000
0497095f97 Fix a number of GCC warnings 2017-12-06 16:42:45 -08:00
jp9000
0d6204c8af Fix a number of MSVC warnings
Fixes a number of warnings with all modules
2017-12-05 13:53:44 -08:00
jp9000
78411de75e libobs/graphics: Add gs_effect_set_color
Convenience function for setting a color (in hex format, e.g.
0xAARRGGBB)
2017-12-01 12:05:52 -08:00
jp9000
c111fa68b8 libobs: Add vertex/index buffer "direct" flush functions
(Note: This commit also modifies libobs-d3d11 and libobs-opengl)

Allows the ability to flush data directly without having to use the
buffer's internal data.

Allows the caller to manage his/her own vertex/index buffer data if
desired, working around the design flaw of having to rely on a
vertex/index buffer's internal data.
2017-11-27 03:00:20 -08:00
jp9000
a46f0b4808 libobs: Add option to duplicate vertex/index buffer data
Prevents from having to pass ownership of buffer data from caller when
using gs_vertexbuffer_create() or gs_indexbuffer_create() (which is a
design flaw).
2017-11-27 02:45:33 -08:00
Jimi Huotari
fef71c4b7c libobs: Fix ImageMagick header path
Since ImageMagick 7, the header path has been changed.  This commit
implements a check for the version being used, and includes the
header as is appropriate.

Special thanks to Hu.

Mantis-Bug: https://obsproject.com/mantis/view.php?id=966

Gentoo-Bug: https://bugs.gentoo.org/627520

Closes jp9000/obs-studio#1018
2017-09-15 08:23:32 -07:00
Shaolin
cb9f767e45 libobs/plugins/UI: Suppress -Wimplicit-fallthrough introduced by GCC 7
Signed-off-by: Shaolin <admshao@gmail.com>
2017-05-29 21:05:18 -03:00
Ryan Foster
be98cee2a0 Fix various typos across multiple modules 2017-04-25 22:39:42 -04:00
Autumin
0ff4feab02 libobs/graphics: Fix the 2D vector dot product func
The operators were unintentionally reversed.

Closes jp9000/obs-studio#724
2016-12-18 06:20:24 -08:00
jp9000
0bc0db1207 libobs/graphics: Add gs_draw_sprite_subregion function
Allows rendering only a subregion of a specific sprite.
2016-09-19 07:03:57 -07:00
jp9000
4dc0024198 libobs/graphics: Add ability to set shader texture sampler
(Note: This also modifies libobs-d3d11 and libobs-opengl)

Allows overriding the sampler for a specific shader parameter.
2016-06-29 04:15:38 -07:00
jp9000
a90c37987f libobs/graphics: Change BorderColor to just use number
Instead of prefixing the color with the '#' character, just take it as
an actual integer.
2016-06-28 02:46:35 -07:00
hwdro
e3847109be libobs/graphics: Add SSE intrinsics for matrix4_transpose 2016-05-26 22:13:01 -07:00
hwdro
017d77b399 libobs/graphics: Remove redundant variable assignment 2016-05-26 22:12:54 -07:00
jp9000
0c5fd7a0fb libobs/graphics: Always load gif frame if needed
Under certain circumstances it's necessary to seek, but if the frame
isn't loaded for the position that's being seeked to, it won't update
the texture.  This just ensures the texture will update when seeking.
2016-05-26 08:13:21 -07:00
Richard Stanway
65094eefe4
libobs: Don't try to keep rendering if a texture wasn't allocated
Fixes issues with invalid textures causing huge output or large black
regions to be rendered.
2016-04-21 00:21:07 +02:00
Anthony Super
1fe0743256 libobs: Remove duplicated determinant calculation 2016-04-12 14:31:52 -06:00
John Bradley
431a02459d libobs/graphics: Add int vector support to shaders 2016-03-21 21:22:28 -07:00
jp9000
85ffa10d3f libobs/graphics: Fix vec4_to_(rgba/bgra) functions
These functions were not properly shifting the bits when calculating the
output.
2016-02-22 10:47:49 -08:00
jp9000
f6728189f5 libobs: Implement BorderColor sampler state value 2016-02-21 12:06:19 -08:00
jp9000
876cc94d51 libobs: Fix bug where bool constant size would be 1
(This commit also modifies libobs-d3d11)

Boolean constant size should be 4
2016-02-21 12:05:04 -08:00
jp9000
a6c8a923e9 libobs: Remove trailing whitespace 2016-02-04 15:45:58 -08:00
jp9000
13890a46e6 libobs/graphics: Add gs_image_file_* functions (w/animated gifs)
These functions allow animated gifs and management of image files.  Uses
libnsgif to load animated gifs.
2016-01-25 17:29:08 -08:00
jp9000
9f63554e69 libobs: Add gs_create_texture_file_data function
Allows loading the file to memory first so the graphics subsystem
doesn't necessarily have to be locked when loading image files.
2016-01-23 07:17:48 -08:00
jp9000
46feac7f8f libobs/graphics: Allow gs_render_sprite use without texture
Allows gs_render_sprite to be used without a texture as long as cx/cy
are set.  There's no reason why it shouldn't be able to do this.
2016-01-23 07:17:45 -08:00
jp9000
83630fa14a libobs/graphics: Safely fail gs_texrender_begin with 0,0 size
Passing 0,0 texture size should be considered legal, and safely return
false to indicate that rendering can't begin.  Also there's no need to
try to use the current swap chain's width/height if either of the sizes
are 0, there's no need try try to "force" success here anymore.
2015-10-22 17:42:44 -07:00
jp9000
0be0eedc81 libobs/graphics: Allow NULL *_destroy parameters
Passing null pointer values to the destroy functions should be
considered legal and simply ignored.
2015-10-22 17:37:59 -07:00
jp9000
ccfd57d100 libobs/graphics: Rename inconsistent function names
Renames functions:
gs_shader_setmatrix3 -> gs_shader_set_matrix3
gs_voltexture_getdepth -> gs_voltexture_get_depth
2015-10-21 07:46:43 -07:00
jp9000
d242004bee libobs/graphics: Add null/context warnings
Adds warnings for graphics functions to ensure that graphics functions
are called within an active graphics context, and add warnings if
required pointer parameters are null.
2015-10-21 07:46:39 -07:00
jp9000
cf9f21e422 (API Change) libobs/graphics: Change gs_create param
(Non-compiling commit: windowless-context branch)

Changes API from:
---------------------
EXPORT int gs_create(graphics_t **graphics, const char *module,
		const struct gs_init_data *data);

To:
---------------------
EXPORT int gs_create(graphics_t **graphics, const char *module,
		uint32_t adapter);

Summary:
---------------------
Changes the gs_create function to use an adapter parameter instead of
requiring a gs_init_data with window/color/etc information.
2015-08-05 01:07:08 -07:00
Palana
4a22f314d6 libobs/graphics: Fix printf format warning
Added cast to unsigned and the assert because microsoft's compiler
doesn't support "%zu"

Actual warning:
libobs/graphics/effect-parser.c:1387:4: warning: format specifies type
'unsigned int' but the argument has type 'size_t' (aka 'unsigned long')
[-Wformat]
2015-07-19 06:30:35 +02:00
Palana
f9eeb049fa libobs: (Re-)Move (duplicate) graphics mutex init
This probably fixes the crash from "libobs: Check effect mutex exists
before destroying it" (c2c47b1169)
2015-05-16 22:16:43 +02:00
Palana
f981b58b43 Revert "libobs: Check effect mutex exists before destroying it"
This reverts commit c2c47b1169.
2015-05-16 22:10:15 +02:00
Richard Stanway
c2c47b1169 libobs: Check effect mutex exists before destroying it
Fixes a crash if graphics system didn't finish intializing.
2015-05-16 18:44:25 +02:00
Kris Moore
9c483aae10 libobs: Add support for FreeBSD to gs_window
Enable the X11 specific members in the gs_window struct when on FreeBSD.
2015-05-04 21:08:17 +02:00
jp9000
ea8327ce5b libobs: Always free effect if not cached
Fix an issue where effects that fail to compile will not properly free
their data if they cannot not be parsed or compiled.
2015-04-10 09:48:55 -07:00
jp9000
be52fa26f9 Add gs_blend_function_separate
This allows the ability to separate the blend states of color and alpha.

The default blend state has also changed so that alpha is always added
together to ensure that the destination image always gets an alpha value
that is actually usable after the operation (for render targets).

Old default state:
  color source: GS_BLEND_SRCALPHA, color dest: GS_BLEND_INVSRCALPHA
  alpha source: GS_BLEND_SRCALPHA, alpha dest: GS_BLEND_INVSRCALPHA

New default state:
  color source: GS_BLEND_SRCALPHA, color dest: GS_BLEND_INVSRCALPHA
  alpha source: GS_BLEND_ONE,      alpha dest: GS_BLEND_ONE
2015-03-27 11:18:02 -07:00