Replaced glScissor and glViewport with gl_state functions

This commit is contained in:
korenkonder
2024-06-16 11:53:49 +03:00
parent d230255af6
commit 0ce40e326d
13 changed files with 135 additions and 59 deletions
+6 -7
View File
@@ -774,8 +774,7 @@ namespace spr {
if (index == 2 && resolution_mode != RESOLUTION_MODE_MAX)
res_window_get()->resolution_mode = resolution_mode;
GLint v43[4];
glGetIntegerv(GL_VIEWPORT, v43);
gl_state_rect viewport_rect = gl_state_get_viewport();
for (int32_t i = 0; i < 2; i++) {
auto reqlist = this->reqlist[index][i];
@@ -815,15 +814,15 @@ namespace spr {
y_min = (int32_t)min.y;
x_max = (int32_t)(max.x - min.x);
y_max = (int32_t)(max.y - min.y);
glViewport(x_min, y_min, x_max, y_max);
gl_state_set_viewport(x_min, y_min, x_max, y_max);
}
else {
view_projection = vp;
x_min = v43[0];
y_min = v43[1];
x_max = v43[2];
y_max = v43[3];
x_min = viewport_rect.x;
y_min = viewport_rect.y;
x_max = viewport_rect.width;
y_max = viewport_rect.height;
}
float_t v23 = (float_t)x_max * 0.5f;