TINYGL: Eliminate passing context where possible

This commit is contained in:
Paweł Kołodziejski 2021-12-07 00:58:14 +01:00
parent 88dd98204d
commit c1512a5c40
No known key found for this signature in database
GPG key ID: 0BDADC9E74440FF7
16 changed files with 542 additions and 550 deletions

View file

@ -32,19 +32,19 @@
namespace TinyGL {
void GLContext::glopClearColor(GLContext *c, GLParam *p) {
c->clear_color = Vector4(p[1].f, p[2].f, p[3].f, p[4].f);
clear_color = Vector4(p[1].f, p[2].f, p[3].f, p[4].f);
}
void GLContext::glopClearDepth(GLContext *c, GLParam *p) {
c->clear_depth = p[1].f;
clear_depth = p[1].f;
}
void GLContext::glopClear(GLContext *c, GLParam *p) {
int mask = p[1].i;
int z = (int)(c->clear_depth * ((1 << ZB_Z_BITS) - 1));
int r = (int)(c->clear_color.X * 255);
int g = (int)(c->clear_color.Y * 255);
int b = (int)(c->clear_color.Z * 255);
int z = (int)(clear_depth * ((1 << ZB_Z_BITS) - 1));
int r = (int)(clear_color.X * 255);
int g = (int)(clear_color.Y * 255);
int b = (int)(clear_color.Z * 255);
issueDrawCall(new ClearBufferDrawCall(mask & TGL_DEPTH_BUFFER_BIT, z, mask & TGL_COLOR_BUFFER_BIT, r, g, b));
}