gfx: drop viewport and scissor_box
parent
66a2d1ff6d
commit
7b67f29611
|
@ -1059,7 +1059,6 @@ typedef struct renderstate_t {
|
|||
unsigned polygon_mode_face;
|
||||
unsigned polygon_mode_mode;
|
||||
bool scissor_test_enabled;
|
||||
int scissor_box[4];
|
||||
} renderstate_t;
|
||||
renderstate_t renderstate();
|
||||
bool renderstate_compare(const renderstate_t *stateA, const renderstate_t *stateB);
|
||||
|
|
|
@ -17082,7 +17082,6 @@ typedef struct renderstate_t {
|
|||
|
||||
// Scissor test
|
||||
bool scissor_test_enabled;
|
||||
int scissor_box[4];
|
||||
} renderstate_t;
|
||||
|
||||
API renderstate_t renderstate();
|
||||
|
@ -363545,10 +363544,7 @@ void font_draw_cmd(font_t *f, const float *glyph_data, int glyph_idx, float fact
|
|||
glActiveTexture(GL_TEXTURE2);
|
||||
glGetIntegerv(GL_TEXTURE_BINDING_1D, &last_texture2);
|
||||
|
||||
f->rs.scissor_box[0] = rect.x;
|
||||
f->rs.scissor_box[1] = window_height() - (rect.y+rect.w);
|
||||
f->rs.scissor_box[2] = rect.z;
|
||||
f->rs.scissor_box[3] = rect.w;
|
||||
glScissor(rect.x, window_height() - (rect.y+rect.w), rect.z, rect.w);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, f->texture_fontdata);
|
||||
|
@ -370131,12 +370127,6 @@ void glCopyBackbufferToTexture( texture_t *tex ) { // unused
|
|||
renderstate_t renderstate() {
|
||||
renderstate_t state = {0};
|
||||
|
||||
// Set default viewport parameters
|
||||
state.viewport_x = 0;
|
||||
state.viewport_y = 0;
|
||||
state.viewport_width = window_width();
|
||||
state.viewport_height = window_height();
|
||||
|
||||
// Set default clear color to black
|
||||
state.clear_color[0] = 0.0f; // Red
|
||||
state.clear_color[1] = 0.0f; // Green
|
||||
|
@ -370183,10 +370173,6 @@ renderstate_t renderstate() {
|
|||
|
||||
// Disable scissor test by default
|
||||
state.scissor_test_enabled = GL_FALSE;
|
||||
state.scissor_box[0] = 0;
|
||||
state.scissor_box[1] = 0;
|
||||
state.scissor_box[2] = window_width();
|
||||
state.scissor_box[3] = window_height();
|
||||
|
||||
return state;
|
||||
}
|
||||
|
@ -370197,9 +370183,6 @@ bool renderstate_compare(const renderstate_t *stateA, const renderstate_t *state
|
|||
|
||||
void renderstate_apply(const renderstate_t *state) {
|
||||
if (state != NULL) {
|
||||
// Apply viewport parameters @fixme
|
||||
// glViewport(state->viewport_x, state->viewport_y, state->viewport_width, state->viewport_height);
|
||||
|
||||
// Apply clear color
|
||||
glClearColor(state->clear_color[0], state->clear_color[1], state->clear_color[2], state->clear_color[3]);
|
||||
|
||||
|
@ -370266,7 +370249,6 @@ void renderstate_apply(const renderstate_t *state) {
|
|||
// Apply scissor test
|
||||
if (state->scissor_test_enabled) {
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
glScissor(state->scissor_box[0], state->scissor_box[1], state->scissor_box[2], state->scissor_box[3]);
|
||||
} else {
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
|
|
@ -1935,10 +1935,7 @@ void font_draw_cmd(font_t *f, const float *glyph_data, int glyph_idx, float fact
|
|||
glActiveTexture(GL_TEXTURE2);
|
||||
glGetIntegerv(GL_TEXTURE_BINDING_1D, &last_texture2);
|
||||
|
||||
f->rs.scissor_box[0] = rect.x;
|
||||
f->rs.scissor_box[1] = window_height() - (rect.y+rect.w);
|
||||
f->rs.scissor_box[2] = rect.z;
|
||||
f->rs.scissor_box[3] = rect.w;
|
||||
glScissor(rect.x, window_height() - (rect.y+rect.w), rect.z, rect.w);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, f->texture_fontdata);
|
||||
|
|
|
@ -56,12 +56,6 @@ void glCopyBackbufferToTexture( texture_t *tex ) { // unused
|
|||
renderstate_t renderstate() {
|
||||
renderstate_t state = {0};
|
||||
|
||||
// Set default viewport parameters
|
||||
state.viewport_x = 0;
|
||||
state.viewport_y = 0;
|
||||
state.viewport_width = window_width();
|
||||
state.viewport_height = window_height();
|
||||
|
||||
// Set default clear color to black
|
||||
state.clear_color[0] = 0.0f; // Red
|
||||
state.clear_color[1] = 0.0f; // Green
|
||||
|
@ -108,10 +102,6 @@ renderstate_t renderstate() {
|
|||
|
||||
// Disable scissor test by default
|
||||
state.scissor_test_enabled = GL_FALSE;
|
||||
state.scissor_box[0] = 0;
|
||||
state.scissor_box[1] = 0;
|
||||
state.scissor_box[2] = window_width();
|
||||
state.scissor_box[3] = window_height();
|
||||
|
||||
return state;
|
||||
}
|
||||
|
@ -122,9 +112,6 @@ bool renderstate_compare(const renderstate_t *stateA, const renderstate_t *state
|
|||
|
||||
void renderstate_apply(const renderstate_t *state) {
|
||||
if (state != NULL) {
|
||||
// Apply viewport parameters @fixme
|
||||
// glViewport(state->viewport_x, state->viewport_y, state->viewport_width, state->viewport_height);
|
||||
|
||||
// Apply clear color
|
||||
glClearColor(state->clear_color[0], state->clear_color[1], state->clear_color[2], state->clear_color[3]);
|
||||
|
||||
|
@ -191,7 +178,6 @@ void renderstate_apply(const renderstate_t *state) {
|
|||
// Apply scissor test
|
||||
if (state->scissor_test_enabled) {
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
glScissor(state->scissor_box[0], state->scissor_box[1], state->scissor_box[2], state->scissor_box[3]);
|
||||
} else {
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,6 @@ typedef struct renderstate_t {
|
|||
|
||||
// Scissor test
|
||||
bool scissor_test_enabled;
|
||||
int scissor_box[4];
|
||||
} renderstate_t;
|
||||
|
||||
API renderstate_t renderstate();
|
||||
|
|
19
engine/v4k.c
19
engine/v4k.c
|
@ -10637,10 +10637,7 @@ void font_draw_cmd(font_t *f, const float *glyph_data, int glyph_idx, float fact
|
|||
glActiveTexture(GL_TEXTURE2);
|
||||
glGetIntegerv(GL_TEXTURE_BINDING_1D, &last_texture2);
|
||||
|
||||
f->rs.scissor_box[0] = rect.x;
|
||||
f->rs.scissor_box[1] = window_height() - (rect.y+rect.w);
|
||||
f->rs.scissor_box[2] = rect.z;
|
||||
f->rs.scissor_box[3] = rect.w;
|
||||
glScissor(rect.x, window_height() - (rect.y+rect.w), rect.z, rect.w);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, f->texture_fontdata);
|
||||
|
@ -17223,12 +17220,6 @@ void glCopyBackbufferToTexture( texture_t *tex ) { // unused
|
|||
renderstate_t renderstate() {
|
||||
renderstate_t state = {0};
|
||||
|
||||
// Set default viewport parameters
|
||||
state.viewport_x = 0;
|
||||
state.viewport_y = 0;
|
||||
state.viewport_width = window_width();
|
||||
state.viewport_height = window_height();
|
||||
|
||||
// Set default clear color to black
|
||||
state.clear_color[0] = 0.0f; // Red
|
||||
state.clear_color[1] = 0.0f; // Green
|
||||
|
@ -17275,10 +17266,6 @@ renderstate_t renderstate() {
|
|||
|
||||
// Disable scissor test by default
|
||||
state.scissor_test_enabled = GL_FALSE;
|
||||
state.scissor_box[0] = 0;
|
||||
state.scissor_box[1] = 0;
|
||||
state.scissor_box[2] = window_width();
|
||||
state.scissor_box[3] = window_height();
|
||||
|
||||
return state;
|
||||
}
|
||||
|
@ -17289,9 +17276,6 @@ bool renderstate_compare(const renderstate_t *stateA, const renderstate_t *state
|
|||
|
||||
void renderstate_apply(const renderstate_t *state) {
|
||||
if (state != NULL) {
|
||||
// Apply viewport parameters @fixme
|
||||
// glViewport(state->viewport_x, state->viewport_y, state->viewport_width, state->viewport_height);
|
||||
|
||||
// Apply clear color
|
||||
glClearColor(state->clear_color[0], state->clear_color[1], state->clear_color[2], state->clear_color[3]);
|
||||
|
||||
|
@ -17358,7 +17342,6 @@ void renderstate_apply(const renderstate_t *state) {
|
|||
// Apply scissor test
|
||||
if (state->scissor_test_enabled) {
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
glScissor(state->scissor_box[0], state->scissor_box[1], state->scissor_box[2], state->scissor_box[3]);
|
||||
} else {
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
|
|
@ -3149,7 +3149,6 @@ typedef struct renderstate_t {
|
|||
|
||||
// Scissor test
|
||||
bool scissor_test_enabled;
|
||||
int scissor_box[4];
|
||||
} renderstate_t;
|
||||
|
||||
API renderstate_t renderstate();
|
||||
|
|
Loading…
Reference in New Issue