Shaolin
d8a4c4cd52
libobs-opengl: Request at least 8 bits for alpha
...
10bpc support is under active development all over the linux stack
so while we wait for it to mature, request an alpha size of 8.
2018-03-12 22:36:50 -03:00
Ryan Foster
bfed33aa77
libobs-opengl: Log OpenGL version on all systems
...
This commit logs the OpenGL version on all operating systems and brings
the OpenGL subsystem's initialization logging more in line with the
D3D11 logging to make logs more uniform.
2017-04-23 19:42:24 -04:00
Lasse Dalegaard
ebd837d605
libobs-opengl: Add xcb message poll to empty out the queue
...
The xcb message queue is not currently emptied. If errors are generated
by any void requests the message queue will simply fill up and messages
will never be deleted.
Due to a (currently unknown) other problem this happens for me, and
results in OBS using up all memory with a queue that will never be
emptied.
Here we add a poll loop that will empty the xcb message queue and
discard the messages. While this means that errors are still not
handled, OBS wont end up crashing either.
Closes jp9000/obs-studio#675
2016-11-24 12:55:51 -08:00
jp9000
9cded466dc
libobs-opengl: Disable v-sync when drawing on linux
...
Prevents glXSwapBuffers from stalling. It would have to stall and wait
for the next frame for each and every single additional swap chain.
2016-01-25 17:29:09 -08:00
repeat
f7e4a79517
libobs-opengl: Terminate visual attribs with None
...
(Jim) The documentation for glXChooseFBConfig states that the last value
of the visual attributes array must be 'None'. Fixes potential
initialization issues with certain drivers.
Closes jp9000/obs-studio#486
2015-10-18 01:04:12 -07:00
michael bishop
cd7a648ba4
libobs-opengl: Use bfree instead of free
...
The variable is allocated with a bmalloc -- not a malloc.
Closes jp9000/obs-studio#473
2015-09-11 16:07:00 -07:00
jp9000
09a18b6f6d
libobs-opengl: Use windowless context (X11)
...
(Non-compiling commit: windowless-context branch)
In the land of X11, life is suffering.
Suffering aside, X11 is capable of a hardware-accelerated windowless
context by using a GLXPbuffer in conjunction with glXMakeContextCurrent.
2015-08-05 01:07:20 -07:00
jp9000
ec69bcb15e
libobs-opengl: Add X11 error handler (for logging)
2015-07-30 18:41:46 -07:00
Zachary Lund
de6e997264
Move from libX11/GLX to XCB/libX11/GLX.
2014-12-19 19:23:08 -08:00
jp9000
41fad2d1a4
(API Change) Use const params where applicable
...
This Fixes a minor flaw with the API where data had to always be mutable
to be usable by the API.
Functions that do not modify the fundamental underlying data of a
structure should be marked as constant, both for safety and to signify
that the parameter is input only and will not be modified by the
function using it.
2014-09-26 17:23:07 -07:00
jp9000
c9df41c1e2
(API Change) Remove pointers from all typedefs
...
Typedef pointers are unsafe. If you do:
typedef struct bla *bla_t;
then you cannot use it as a constant, such as: const bla_t, because
that constant will be to the pointer itself rather than to the
underlying data. I admit this was a fundamental mistake that must
be corrected.
All typedefs that were pointer types will now have their pointers
removed from the type itself, and the pointers will be used when they
are actually used as variables/parameters/returns instead.
This does not break ABI though, which is pretty nice.
2014-09-25 21:48:11 -07:00
jp9000
5780f3f177
(API Change) Improve graphics API consistency
...
Summary:
- Prefix all graphics subsystem names with gs_ or GS_
- Unsquish funciton names (for example _setfloat to _set_float)
- Changed create functions to be more consistent with the rest of the
API elsewhere. For exmaple, instead of
gs_create_texture/gs_texture_destroy, it's now
gs_texture_create/gs_texture_destroy
- Renamed gs_stencil_op enum to gs_stencil_op_type
From: To:
-----------------------------------------------------------
tvertarray gs_tvertarray
vb_data gs_vb_data
vbdata_create gs_vbdata_create
vbdata_destroy gs_vbdata_destroy
shader_param gs_shader_param
gs_effect gs_effect
effect_technique gs_effect_technique
effect_pass gs_effect_pass
effect_param gs_effect_param
texture_t gs_texture_t
stagesurf_t gs_stagesurf_t
zstencil_t gs_zstencil_t
vertbuffer_t gs_vertbuffer_t
indexbuffer_t gs_indexbuffer_t
samplerstate_t gs_samplerstate_t
swapchain_t gs_swapchain_t
texrender_t gs_texrender_t
shader_t gs_shader_t
sparam_t gs_sparam_t
effect_t gs_effect_t
technique_t gs_technique_t
eparam_t gs_eparam_t
device_t gs_device_t
graphics_t graphics_t
shader_param_type gs_shader_param_type
SHADER_PARAM_UNKNOWN GS_SHADER_PARAM_UNKNOWN
SHADER_PARAM_BOOL GS_SHADER_PARAM_BOOL
SHADER_PARAM_FLOAT GS_SHADER_PARAM_FLOAT
SHADER_PARAM_INT GS_SHADER_PARAM_INT
SHADER_PARAM_STRING GS_SHADER_PARAM_STRING
SHADER_PARAM_VEC2 GS_SHADER_PARAM_VEC2
SHADER_PARAM_VEC3 GS_SHADER_PARAM_VEC3
SHADER_PARAM_VEC4 GS_SHADER_PARAM_VEC4
SHADER_PARAM_MATRIX4X4 GS_SHADER_PARAM_MATRIX4X4
SHADER_PARAM_TEXTURE GS_SHADER_PARAM_TEXTURE
shader_param_info gs_shader_param_info
shader_type gs_shader_type
SHADER_VERTEX GS_SHADER_VERTEX
SHADER_PIXEL GS_SHADER_PIXEL
shader_destroy gs_shader_destroy
shader_numparams gs_shader_get_num_params
shader_getparambyidx gs_shader_get_param_by_idx
shader_getparambyname gs_shader_get_param_by_name
shader_getviewprojmatrix gs_shader_get_viewproj_matrix
shader_getworldmatrix gs_shader_get_world_matrix
shader_getparaminfo gs_shader_get_param_info
shader_setbool gs_shader_set_bool
shader_setfloat gs_shader_set_float
shader_setint gs_shader_set_int
shader_setmatrix3 gs_shader_setmatrix3
shader_setmatrix4 gs_shader_set_matrix4
shader_setvec2 gs_shader_set_vec2
shader_setvec3 gs_shader_set_vec3
shader_setvec4 gs_shader_set_vec4
shader_settexture gs_shader_set_texture
shader_setval gs_shader_set_val
shader_setdefault gs_shader_set_default
effect_property_type gs_effect_property_type
EFFECT_NONE GS_EFFECT_NONE
EFFECT_BOOL GS_EFFECT_BOOL
EFFECT_FLOAT GS_EFFECT_FLOAT
EFFECT_COLOR GS_EFFECT_COLOR
EFFECT_TEXTURE GS_EFFECT_TEXTURE
effect_param_info gs_effect_param_info
effect_destroy gs_effect_destroy
effect_gettechnique gs_effect_get_technique
technique_begin gs_technique_begin
technique_end gs_technique_end
technique_beginpass gs_technique_begin_pass
technique_beginpassbyname gs_technique_begin_pass_by_name
technique_endpass gs_technique_end_pass
effect_numparams gs_effect_get_num_params
effect_getparambyidx gs_effect_get_param_by_idx
effect_getparambyname gs_effect_get_param_by_name
effect_updateparams gs_effect_update_params
effect_getviewprojmatrix gs_effect_get_viewproj_matrix
effect_getworldmatrix gs_effect_get_world_matrix
effect_getparaminfo gs_effect_get_param_info
effect_setbool gs_effect_set_bool
effect_setfloat gs_effect_set_float
effect_setint gs_effect_set_int
effect_setmatrix4 gs_effect_set_matrix4
effect_setvec2 gs_effect_set_vec2
effect_setvec3 gs_effect_set_vec3
effect_setvec4 gs_effect_set_vec4
effect_settexture gs_effect_set_texture
effect_setval gs_effect_set_val
effect_setdefault gs_effect_set_default
texrender_create gs_texrender_create
texrender_destroy gs_texrender_destroy
texrender_begin gs_texrender_begin
texrender_end gs_texrender_end
texrender_reset gs_texrender_reset
texrender_gettexture gs_texrender_get_texture
GS_BUILDMIPMAPS GS_BUILD_MIPMAPS
GS_RENDERTARGET GS_RENDER_TARGET
gs_device_name gs_get_device_name
gs_device_type gs_get_device_type
gs_entercontext gs_enter_context
gs_leavecontext gs_leave_context
gs_getcontext gs_get_context
gs_renderstart gs_render_start
gs_renderstop gs_render_stop
gs_rendersave gs_render_save
gs_getinput gs_get_input
gs_geteffect gs_get_effect
gs_create_effect_from_file gs_effect_create_from_file
gs_create_effect gs_effect_create
gs_create_vertexshader_from_file gs_vertexshader_create_from_file
gs_create_pixelshader_from_file gs_pixelshader_create_from_file
gs_create_texture_from_file gs_texture_create_from_file
gs_resetviewport gs_reset_viewport
gs_set2dmode gs_set_2d_mode
gs_set3dmode gs_set_3d_mode
gs_create_swapchain gs_swapchain_create
gs_getsize gs_get_size
gs_getwidth gs_get_width
gs_getheight gs_get_height
gs_create_texture gs_texture_create
gs_create_cubetexture gs_cubetexture_create
gs_create_volumetexture gs_voltexture_create
gs_create_zstencil gs_zstencil_create
gs_create_stagesurface gs_stagesurface_create
gs_create_samplerstate gs_samplerstate_create
gs_create_vertexshader gs_vertexshader_create
gs_create_pixelshader gs_pixelshader_create
gs_create_vertexbuffer gs_vertexbuffer_create
gs_create_indexbuffer gs_indexbuffer_create
gs_gettexturetype gs_get_texture_type
gs_load_defaultsamplerstate gs_load_default_samplerstate
gs_getvertexshader gs_get_vertex_shader
gs_getpixelshader gs_get_pixel_shader
gs_getrendertarget gs_get_render_target
gs_getzstenciltarget gs_get_zstencil_target
gs_setrendertarget gs_set_render_target
gs_setcuberendertarget gs_set_cube_render_target
gs_beginscene gs_begin_scene
gs_draw gs_draw
gs_endscene gs_end_scene
gs_setcullmode gs_set_cull_mode
gs_getcullmode gs_get_cull_mode
gs_enable_depthtest gs_enable_depth_test
gs_enable_stenciltest gs_enable_stencil_test
gs_enable_stencilwrite gs_enable_stencil_write
gs_blendfunction gs_blend_function
gs_depthfunction gs_depth_function
gs_stencilfunction gs_stencil_function
gs_stencilop gs_stencil_op
gs_setviewport gs_set_viewport
gs_getviewport gs_get_viewport
gs_setscissorrect gs_set_scissor_rect
gs_create_texture_from_iosurface gs_texture_create_from_iosurface
gs_create_gdi_texture gs_texture_create_gdi
gs_is_compressed_format gs_is_compressed_format
gs_num_total_levels gs_get_total_levels
texture_setimage gs_texture_set_image
cubetexture_setimage gs_cubetexture_set_image
swapchain_destroy gs_swapchain_destroy
texture_destroy gs_texture_destroy
texture_getwidth gs_texture_get_width
texture_getheight gs_texture_get_height
texture_getcolorformat gs_texture_get_color_format
texture_map gs_texture_map
texture_unmap gs_texture_unmap
texture_isrect gs_texture_is_rect
texture_getobj gs_texture_get_obj
cubetexture_destroy gs_cubetexture_destroy
cubetexture_getsize gs_cubetexture_get_size
cubetexture_getcolorformat gs_cubetexture_get_color_format
volumetexture_destroy gs_voltexture_destroy
volumetexture_getwidth gs_voltexture_get_width
volumetexture_getheight gs_voltexture_get_height
volumetexture_getdepth gs_voltexture_getdepth
volumetexture_getcolorformat gs_voltexture_get_color_format
stagesurface_destroy gs_stagesurface_destroy
stagesurface_getwidth gs_stagesurface_get_width
stagesurface_getheight gs_stagesurface_get_height
stagesurface_getcolorformat gs_stagesurface_get_color_format
stagesurface_map gs_stagesurface_map
stagesurface_unmap gs_stagesurface_unmap
zstencil_destroy gs_zstencil_destroy
samplerstate_destroy gs_samplerstate_destroy
vertexbuffer_destroy gs_vertexbuffer_destroy
vertexbuffer_flush gs_vertexbuffer_flush
vertexbuffer_getdata gs_vertexbuffer_get_data
indexbuffer_destroy gs_indexbuffer_destroy
indexbuffer_flush gs_indexbuffer_flush
indexbuffer_getdata gs_indexbuffer_get_data
indexbuffer_numindices gs_indexbuffer_get_num_indices
indexbuffer_gettype gs_indexbuffer_get_type
texture_rebind_iosurface gs_texture_rebind_iosurface
texture_get_dc gs_texture_get_dc
texture_release_dc gs_texture_release_dc
2014-08-09 11:57:38 -07:00
fryshorts
944c2dc9f7
Destroy swapchain before removing the window info
...
This fixes an issue reported by valgrind where cleaning up the
swapchain fails because the window info is destroyed before.
2014-05-16 20:32:30 +02:00
Thomas McGrew
59328d86ce
Added a version to the X11 GL context request
...
This enables the application to start on Intel graphics under Mesa 10.2
2014-05-12 02:31:15 -04:00
BtbN
e50201cad1
Move from glLoadGen to GLAD
2014-04-15 22:19:40 +02:00
jp9000
0e9b13fcf9
Fix style errors (please don't make me do this)
2014-04-12 11:21:47 -07:00
BtbN
0f9c6e5503
Create sub window for rendering, to avoid visual mismatch issues
2014-04-12 16:24:38 +02:00
Zachary Lund
e5b90accb9
Removed no longer valid comment
2014-04-03 19:24:03 -05:00
Zachary Lund
b4d2146861
This commit contains more than I intended. Read below for more info.
...
1) Fixed the preview window. It now correctly displays the source.
2) The GLX backend now correctly uses the devices current swap.
3) We now set device->cur_swap to a default so we don't have to check it in every function.
4) Minor syntactical cleanups and perhaps some messiness added.
2014-04-03 19:21:24 -05:00
Zachary Lund
ee9ff9cfb9
Use Qt provided display with GLX functions for consistency.
...
Remove unneeded assignment from previous code.
2014-04-03 17:36:01 -05:00
BtbN
a31e938c2b
Fix getting the X11 display with the Qt ui
2014-04-03 23:41:22 +02:00
jp9000
8b8217f68e
Fix a some more linux/GCC specific warnings
2014-02-14 15:56:01 -07:00
jp9000
b067440f73
Use bzalloc instead of bmalloc then memset
...
Reduces needless code repetition and still allows for proper memory
alignment. Cleans up the code a bit.
2014-02-09 12:34:07 -07:00
Zachary Lund
cd9c4b39d0
We only really require GLX 1.3. Also fixed version check to be more appropriate.
2014-02-08 02:52:55 -06:00
jp9000
021d9522ea
Eliminate more trailing whitespace from gl-x11.c
2014-02-05 21:33:55 -07:00
jp9000
8219a64958
Remove trailing whitespace from gl-x11.c (OCD)
2014-02-05 21:31:03 -07:00
Zachary Lund
1c48834cb5
Fixed signedness issue on GLX
2014-01-25 22:27:02 -06:00
Zachary Lund
74ab96a3ad
I removed GLEW, added glLoadGen (renamed to GL here), and added implementations for all platforms. Hopefully this goes better than GLAD did.
2014-01-25 22:26:43 -06:00
Zachary Lund
e3299d5662
Added rudimentary support for Qt on Linux
2014-01-24 21:55:10 -06:00
Zachary Lund
bb24591d48
Add copyright and name to files it applies to.
2014-01-11 18:09:48 -06:00
Zachary Lund
78aa456a7b
Added comments on why some code is disabled
2014-01-09 21:04:52 -06:00
Zachary Lund
d283f24cbb
A few changes concerning wxGTK.
...
For one, I added a new member gs_window for future use.
The member is "display" which represents our connection to X11.
Ideally, we should use this specific connection to deal with our Window.
For now, it's disabled. Read comment for more information.
Secondly, wxGTK apparently doesn't map our window in some cases.
This causes the window ID passed to be bad and will stop (or segfault)
our program. This might be related to the first commit above.
For now, all this commit does is realize the window manually.
2014-01-09 21:04:52 -06:00
Ján Mlynek
ecadb4faae
Use XGetErrorText() instead of our own table
...
This fixes segfaults when the error code is not in the table
2014-01-07 20:35:19 +01:00
Zachary Lund
840c1cfd65
I removed GL-specific extension checking to a platform independent file.
...
I also fixed autoconf to find wxWidgets 2.9 without user intervention
Removed unused code and added more organization
2014-01-05 23:50:32 -06:00
Zachary Lund
8df5293be1
Added GLX version check and assures context is set to none on failure.
...
Fixed the location glewExperimental was being set to just before glewInit() (where it should be).
2014-01-04 01:29:37 -06:00
Zachary Lund
ffd80449d3
Added gl_update (does nothing for now).
...
Fix previous commit..
2014-01-04 00:50:40 -06:00
Zachary Lund
3dc2024c8f
Remove enable statements. This should be done in platform-independent code using GLEW.
2014-01-04 00:42:23 -06:00
Zachary Lund
94f88c82cf
Added OpenGL debug callback support and context changes.
...
1. We no longer hardcode a 3.2 profile. It chooses the latest profile that fits out description.
2. I added three tables and macros to help with the offsets compared to the variables to help reading. Read comments for more info.
3. I added glewExperimental being set. What a dumb "feature". It doesn't help anything...
2014-01-03 23:14:35 -06:00
Zachary Lund
9b882768be
Fixed memory leak by calling gl_windowinfo_destroy in platform destruction.
2014-01-02 18:35:10 -06:00
Zachary Lund
80b8176e29
GLX implementation and *nix-specific file handling implementation
...
I added gl-x11 which allows compatibility with X11 (Xlib-based) and GLX.
I also added various functions to handle file finding based on FHS.
Various changes to autotools to both install files correctly and to configure correctly.
2014-01-02 18:20:58 -06:00