mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 20:57:41 +00:00
LibWeb/WebGL: Implement WebGLRenderingContextBase.depthRange()
This commit is contained in:
parent
d9ef228c76
commit
0805911a93
3 changed files with 15 additions and 0 deletions
|
@ -199,6 +199,19 @@ void WebGLRenderingContextBase::depth_mask(GLboolean mask)
|
||||||
m_context->gl_depth_mask(mask);
|
m_context->gl_depth_mask(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WebGLRenderingContextBase::depth_range(GLclampf z_near, GLclampf z_far)
|
||||||
|
{
|
||||||
|
if (m_context_lost)
|
||||||
|
return;
|
||||||
|
|
||||||
|
dbgln_if(WEBGL_CONTEXT_DEBUG, "WebGLRenderingContextBase::depth_range(z_near={}, z_far={})", z_near, z_far);
|
||||||
|
|
||||||
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#VIEWPORT_DEPTH_RANGE
|
||||||
|
// "The WebGL API does not support depth ranges with where the near plane is mapped to a value greater than that of the far plane. A call to depthRange will generate an INVALID_OPERATION error if zNear is greater than zFar."
|
||||||
|
RETURN_WITH_WEBGL_ERROR_IF(z_near > z_far, GL_INVALID_OPERATION);
|
||||||
|
m_context->gl_depth_range(z_near, z_far);
|
||||||
|
}
|
||||||
|
|
||||||
void WebGLRenderingContextBase::finish()
|
void WebGLRenderingContextBase::finish()
|
||||||
{
|
{
|
||||||
if (m_context_lost)
|
if (m_context_lost)
|
||||||
|
|
|
@ -40,6 +40,7 @@ public:
|
||||||
|
|
||||||
void depth_func(GLenum func);
|
void depth_func(GLenum func);
|
||||||
void depth_mask(GLboolean mask);
|
void depth_mask(GLboolean mask);
|
||||||
|
void depth_range(GLclampf z_near, GLclampf z_far);
|
||||||
|
|
||||||
void finish();
|
void finish();
|
||||||
void flush();
|
void flush();
|
||||||
|
|
|
@ -35,6 +35,7 @@ interface mixin WebGLRenderingContextBase {
|
||||||
|
|
||||||
undefined depthFunc(GLenum func);
|
undefined depthFunc(GLenum func);
|
||||||
undefined depthMask(GLboolean flag);
|
undefined depthMask(GLboolean flag);
|
||||||
|
undefined depthRange(GLclampf zNear, GLclampf zFar);
|
||||||
|
|
||||||
undefined finish();
|
undefined finish();
|
||||||
undefined flush();
|
undefined flush();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue