MCPcopy Create free account
hub / github.com/defold/defold / RenderScript_DisableState

Function RenderScript_DisableState

engine/render/src/render/render_script.cpp:741–763  ·  view source on GitHub ↗

disables a render state * * Disables a render state. * * @name render.disable_state * @param state [type:constant] state to disable * * - `graphics.STATE_DEPTH_TEST` * - `graphics.STATE_STENCIL_TEST` * - `graphics.STATE_BLEND` * - `graphics.STATE_ALPHA_TEST` ([icon:iOS][icon:android] not available on iOS and Android) * - `graphics.STATE_CULL_F

Source from the content-addressed store, hash-verified

739 * ```
740 */
741 int RenderScript_DisableState(lua_State* L)
742 {
743 int top = lua_gettop(L);
744 (void) top;
745
746 RenderScriptInstance* i = RenderScriptInstance_Check(L);
747 uint32_t state = luaL_checkinteger(L, 1);
748 if (state != dmGraphics::STATE_DEPTH_TEST &&
749 state != dmGraphics::STATE_STENCIL_TEST &&
750 state != dmGraphics::STATE_ALPHA_TEST &&
751 state != dmGraphics::STATE_BLEND &&
752 state != dmGraphics::STATE_CULL_FACE &&
753 state != dmGraphics::STATE_POLYGON_OFFSET_FILL)
754 {
755 return luaL_error(L, "Invalid state: %s.disable_state(%d).", RENDER_SCRIPT_LIB_NAME, state);
756 }
757 if (InsertCommand(i, Command(COMMAND_TYPE_DISABLE_STATE, state))) {
758 assert(top == lua_gettop(L));
759 return 0;
760 } else {
761 return luaL_error(L, "Command buffer is full (%d).", i->m_CommandBuffer.Capacity());
762 }
763 }
764
765 /*# sets the render viewport
766 *

Callers

nothing calls this directly

Calls 8

lua_gettopFunction · 0.85
luaL_checkintegerFunction · 0.85
luaL_errorFunction · 0.85
InsertCommandFunction · 0.85
CommandClass · 0.70
assertFunction · 0.50
CapacityMethod · 0.45

Tested by

no test coverage detected