mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
LibGL: Implement glStencil*
functions
This implements the context state for stencil testing functions and operations. No rasterization is implemented.
This commit is contained in:
parent
729349ce78
commit
ea6bcda79c
7 changed files with 135 additions and 1 deletions
30
Userland/Libraries/LibGL/GLStencil.cpp
Normal file
30
Userland/Libraries/LibGL/GLStencil.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Jelle Raaijmakers <jelle@gmta.nl>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "GL/gl.h"
|
||||
#include "GLContext.h"
|
||||
|
||||
extern GL::GLContext* g_gl_context;
|
||||
|
||||
void glStencilFunc(GLenum func, GLint ref, GLuint mask)
|
||||
{
|
||||
g_gl_context->gl_stencil_func_separate(GL_FRONT_AND_BACK, func, ref, mask);
|
||||
}
|
||||
|
||||
void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
|
||||
{
|
||||
g_gl_context->gl_stencil_func_separate(face, func, ref, mask);
|
||||
}
|
||||
|
||||
void glStencilOp(GLenum sfail, GLenum dpfail, GLenum dppass)
|
||||
{
|
||||
g_gl_context->gl_stencil_op_separate(GL_FRONT_AND_BACK, sfail, dpfail, dppass);
|
||||
}
|
||||
|
||||
void glStencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)
|
||||
{
|
||||
g_gl_context->gl_stencil_op_separate(face, sfail, dpfail, dppass);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue