7 Commits

Author SHA1 Message Date
PatTheMav
c8ec906844 frontend: Change overflow texture rendering to be sRGB-aware
Current code assumes that the overflow texture and the render target
always share the same color format including transfer function.

This assumption is incorrect however as OBS might use a 16-bit floating
point texture with a linear gamma transfer function when a high-bitrate
format is selected. On top of that OBS Studio wants rendering code to
ensure that linear color blending is used throughout the application.

The DrawOverflow function had not been updated to reflect this. This
change brings it in line with other functions involved in preview
rendering, which enable automatic sRGB conversion for the framebuffer
and the texture used in the fragment shader.
2025-08-24 15:29:33 -04:00
cg2121
d7cce79d7e frontend: Use static_cast when casting from void pointers
Using static_cast is preferred here, as it is safer to use than
reinterpret_cast.
2025-05-05 20:47:10 -04:00
Lain
9b0ac7c01c frontend/widgets: Optimize preview primitive rendering
Certain draw calls were creating/destroying vertex buffers. Every call.
That's kind of not a great thing to do, so instead use the new
gs_draw_quadf() function to optimize rendering and reduce the need for
swapping vertex buffers.

Also uses a shader for DrawStripedLine so it does not have to split it
up into separate draw calls.
2025-04-23 15:23:29 -04:00
Lain
7f09344989 frontend/widgets: Fix integer overflow
If the crop values combined are larger than the width or height of the
source, an integer overflow will occur.

This fix converts the width/height values to int, and then clamps
any negative values to 0.
2025-04-23 14:07:09 -04:00
cg2121
86f7475f14 frontend: Add preview zoom controls 2025-04-01 17:31:09 -04:00
cg2121
4e8b131509 frontend: Use OBSBasic::Get() in all places
This reduces duplicated code when getting the OBSBasic context.
2025-02-05 15:15:52 -05:00
PatTheMav
f813121bb9 frontend: Add renamed Qt UI Widgets 2025-01-08 17:33:12 +01:00