mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
libobs-opengl: Fix viewport flip
Flip viewport in coordination with update_viewproj_matrix.
This commit is contained in:
parent
19c5da4645
commit
44ebde553d
|
@ -1264,7 +1264,6 @@ void device_set_viewport(gs_device_t *device, int x, int y, int width,
|
|||
int height)
|
||||
{
|
||||
uint32_t base_height = 0;
|
||||
int gl_y = 0;
|
||||
|
||||
/* GL uses bottom-up coordinates for viewports. We want top-down */
|
||||
if (device->cur_render_target) {
|
||||
|
@ -1274,7 +1273,8 @@ void device_set_viewport(gs_device_t *device, int x, int y, int width,
|
|||
gl_getclientsize(device->cur_swap, &dw, &base_height);
|
||||
}
|
||||
|
||||
if (base_height)
|
||||
GLint gl_y = y;
|
||||
if (base_height && !device->cur_fbo)
|
||||
gl_y = base_height - y - height;
|
||||
|
||||
glViewport(x, gl_y, width, height);
|
||||
|
|
Loading…
Reference in a new issue