mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-06 15:46:13 -05:00
UI: Render previews in linear sRGB space
Necessary for correct alpha blending.
This commit is contained in:
@@ -148,10 +148,13 @@ void OBSBasicInteraction::DrawPreview(void *data, uint32_t cx, uint32_t cy)
|
||||
|
||||
gs_viewport_push();
|
||||
gs_projection_push();
|
||||
const bool previous = gs_set_linear_srgb(true);
|
||||
|
||||
gs_ortho(0.0f, float(sourceCX), 0.0f, float(sourceCY), -100.0f, 100.0f);
|
||||
gs_set_viewport(x, y, newCX, newCY);
|
||||
obs_source_video_render(window->source);
|
||||
|
||||
gs_set_linear_srgb(previous);
|
||||
gs_projection_pop();
|
||||
gs_viewport_pop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user