mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Feat] (GL_State/RenderState): implement ClearStencil
This commit is contained in:
@@ -721,7 +721,7 @@ namespace MobileGL {
|
|||||||
*params = 0; // TODO
|
*params = 0; // TODO
|
||||||
break;
|
break;
|
||||||
case GL_STENCIL_CLEAR_VALUE:
|
case GL_STENCIL_CLEAR_VALUE:
|
||||||
*params = 0; // TODO
|
*params = MG_State::pGLContext->GetClearStencil();
|
||||||
break;
|
break;
|
||||||
case GL_STENCIL_FAIL:
|
case GL_STENCIL_FAIL:
|
||||||
*params = 0; // TODO
|
*params = 0; // TODO
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ namespace MobileGL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ClearStencil_State(GLint s) {
|
void ClearStencil_State(GLint s) {
|
||||||
// TODO: implement
|
MG_State::pGLContext->SetClearStencil(static_cast<Int>(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearDepth_State(GLclampd depth) {
|
void ClearDepth_State(GLclampd depth) {
|
||||||
|
|||||||
@@ -312,6 +312,14 @@ namespace MobileGL {
|
|||||||
return m_renderState.GetClearDepth();
|
return m_renderState.GetClearDepth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GLContext::SetClearStencil(Int stencil) {
|
||||||
|
m_renderState.SetClearStencil(stencil);
|
||||||
|
}
|
||||||
|
|
||||||
|
Int GLContext::GetClearStencil() const {
|
||||||
|
return m_renderState.GetClearStencil();
|
||||||
|
}
|
||||||
|
|
||||||
void GLContext::SetPixelStoreParam(PixelStoreParam param, Int value) {
|
void GLContext::SetPixelStoreParam(PixelStoreParam param, Int value) {
|
||||||
m_renderState.SetPixelStoreParam(param, value);
|
m_renderState.SetPixelStoreParam(param, value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,6 +111,8 @@ namespace MobileGL {
|
|||||||
const FloatVec4& GetClearColor() const;
|
const FloatVec4& GetClearColor() const;
|
||||||
void SetClearDepth(Float depth);
|
void SetClearDepth(Float depth);
|
||||||
Float GetClearDepth() const;
|
Float GetClearDepth() const;
|
||||||
|
void SetClearStencil(Int stencil);
|
||||||
|
Int GetClearStencil() const;
|
||||||
void SetPixelStoreParam(PixelStoreParam param, Int value);
|
void SetPixelStoreParam(PixelStoreParam param, Int value);
|
||||||
Int GetPixelStoreParam(PixelStoreParam param) const;
|
Int GetPixelStoreParam(PixelStoreParam param) const;
|
||||||
PixelStoreParameters GetPixelStoreParameters(Bool isUnpack) const;
|
PixelStoreParameters GetPixelStoreParameters(Bool isUnpack) const;
|
||||||
|
|||||||
@@ -222,6 +222,17 @@ namespace MobileGL {
|
|||||||
return m_parameters.ClearDepth;
|
return m_parameters.ClearDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderState::SetClearStencil(Int stencil) {
|
||||||
|
if (m_parameters.ClearStencil == stencil) return;
|
||||||
|
|
||||||
|
m_parameters.ClearStencil = stencil;
|
||||||
|
++m_version;
|
||||||
|
}
|
||||||
|
|
||||||
|
Int RenderState::GetClearStencil() const {
|
||||||
|
return m_parameters.ClearStencil;
|
||||||
|
}
|
||||||
|
|
||||||
// -------------------- Pixel Store --------------------
|
// -------------------- Pixel Store --------------------
|
||||||
void RenderState::SetPixelStoreParam(PixelStoreParam param, Int value) {
|
void RenderState::SetPixelStoreParam(PixelStoreParam param, Int value) {
|
||||||
#define SET_PIXEL_STORE_PARAM(paramNameHead, paramNameTail, val) \
|
#define SET_PIXEL_STORE_PARAM(paramNameHead, paramNameTail, val) \
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ namespace MobileGL {
|
|||||||
// Clear State
|
// Clear State
|
||||||
FloatVec4 ClearColor = FloatVec4(0.0f, 0.0f, 0.0f, 1.0f);
|
FloatVec4 ClearColor = FloatVec4(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
Float ClearDepth = 1.0f;
|
Float ClearDepth = 1.0f;
|
||||||
|
Int ClearStencil = 0;
|
||||||
|
|
||||||
// Cull Face
|
// Cull Face
|
||||||
Bool CullFaceEnabled = false;
|
Bool CullFaceEnabled = false;
|
||||||
@@ -207,6 +208,8 @@ namespace MobileGL {
|
|||||||
const FloatVec4& GetClearColor() const;
|
const FloatVec4& GetClearColor() const;
|
||||||
void SetClearDepth(Float depth);
|
void SetClearDepth(Float depth);
|
||||||
Float GetClearDepth() const;
|
Float GetClearDepth() const;
|
||||||
|
void SetClearStencil(Int stencil);
|
||||||
|
Int GetClearStencil() const;
|
||||||
|
|
||||||
// Pixel Store
|
// Pixel Store
|
||||||
void SetPixelStoreParam(PixelStoreParam param, Int value);
|
void SetPixelStoreParam(PixelStoreParam param, Int value);
|
||||||
|
|||||||
Reference in New Issue
Block a user