1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 18:35:18 +00:00
serenity/Userland/Libraries/LibGL/GLStencil.cpp
Luke Wilde 53d6e1600c LibGL: Stub glStencilMask
Xash3D requires this otherwise it will crash with a jump to nullptr,
but it doesn't use it for anything interesting and just sets a default
value of ~0 during initialization.
2022-01-13 10:07:45 +02:00

40 lines
950 B
C++

/*
* 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 glClearStencil(GLint s)
{
g_gl_context->gl_clear_stencil(s);
}
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);
}
void glStencilMask(GLuint mask)
{
dbgln("(STUBBED) glStencilMask(0x{:08x})", mask);
}