TINYGL: Added stencil buffer implementation
This commit is contained in:
parent
da3c4bacd5
commit
6a591146c8
22 changed files with 572 additions and 195 deletions
|
@ -199,6 +199,15 @@ void tglDepthMask(int enableWrite) {
|
|||
c->gl_add_op(p);
|
||||
}
|
||||
|
||||
void tglStencilMask(TGLuint mask) {
|
||||
TinyGL::GLContext *c = TinyGL::gl_get_context();
|
||||
TinyGL::GLParam p[2];
|
||||
p[0].op = TinyGL::OP_StencilMask;
|
||||
p[1].i = mask;
|
||||
|
||||
c->gl_add_op(p);
|
||||
}
|
||||
|
||||
void tglBlendFunc(TGLenum sfactor, TGLenum dfactor) {
|
||||
TinyGL::GLContext *c = TinyGL::gl_get_context();
|
||||
TinyGL::GLParam p[3];
|
||||
|
@ -230,6 +239,28 @@ void tglDepthFunc(TGLenum func) {
|
|||
c->gl_add_op(p);
|
||||
}
|
||||
|
||||
void tglStencilFunc(TGLenum func, TGLint ref, TGLuint mask) {
|
||||
TinyGL::GLContext *c = TinyGL::gl_get_context();
|
||||
TinyGL::GLParam p[4];
|
||||
p[0].op = TinyGL::OP_StencilFunc;
|
||||
p[1].i = func;
|
||||
p[2].i = ref;
|
||||
p[3].i = mask;
|
||||
|
||||
c->gl_add_op(p);
|
||||
}
|
||||
|
||||
void tglStencilOp(TGLenum sfail, TGLenum dpfail, TGLenum dppass) {
|
||||
TinyGL::GLContext *c = TinyGL::gl_get_context();
|
||||
TinyGL::GLParam p[4];
|
||||
p[0].op = TinyGL::OP_StencilOp;
|
||||
p[1].i = sfail;
|
||||
p[2].i = dpfail;
|
||||
p[3].i = dppass;
|
||||
|
||||
c->gl_add_op(p);
|
||||
}
|
||||
|
||||
void tglPolygonMode(int face, int mode) {
|
||||
TinyGL::GLContext *c = TinyGL::gl_get_context();
|
||||
TinyGL::GLParam p[3];
|
||||
|
@ -569,6 +600,16 @@ void tglClearDepth(double depth) {
|
|||
c->gl_add_op(p);
|
||||
}
|
||||
|
||||
void tglClearStencil(TGLint s) {
|
||||
TinyGL::GLContext *c = TinyGL::gl_get_context();
|
||||
TinyGL::GLParam p[2];
|
||||
|
||||
p[0].op = TinyGL::OP_ClearStencil;
|
||||
p[1].i = s;
|
||||
|
||||
c->gl_add_op(p);
|
||||
}
|
||||
|
||||
// textures
|
||||
|
||||
void tglTexImage2D(int target, int level, int components, int width, int height, int border, int format, int type, void *pixels) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue