Skip to content

Commit

Permalink
sokol: Implement missing Get/SetRenderStates
Browse files Browse the repository at this point in the history
  • Loading branch information
IonAgorria committed Oct 24, 2024
1 parent 64b8fab commit 230e47d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Source/Render/sokol/SokolRenderPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ sg_compare_func GetSokolCompareFunc(eCMPFUNC cmpfunc) {
return SG_COMPAREFUNC_GREATER;
case CMP_GREATEREQUAL:
return SG_COMPAREFUNC_GREATER_EQUAL;
default:
case CMP_ALWAYS:
return SG_COMPAREFUNC_ALWAYS;
default:
xassert(0);
return SG_COMPAREFUNC_ALWAYS;
}
}

Expand Down
9 changes: 7 additions & 2 deletions Source/Render/sokol/SokolRenderState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1133,17 +1133,22 @@ void cSokolRender::SetDrawTransform(class cCamera *pDrawNode)

uint32_t cSokolRender::GetRenderState(eRenderStateOption option) {
switch(option) {
case RS_WIREFRAME:
return activePipelineMode.wireframe_mode;
case RS_ZWRITEENABLE:
return activePipelineMode.depth_write;
case RS_ZFUNC:
return activePipelineMode.depth_cmp;
case RS_WIREFRAME:
return activePipelineMode.wireframe_mode;
case RS_CULLMODE:
return activePipelineMode.cull;
case RS_ALPHA_TEST_MODE:
return activeCommandAlphaTest;
case RS_BILINEAR:
return 1;
case RS_FOGENABLE:
return 0;
default:
xassert(0);
return 0;
}
}
Expand Down

0 comments on commit 230e47d

Please sign in to comment.