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

Function RenderScript_DisableTexture

engine/render/src/render/render_script.cpp:1471–1490  ·  view source on GitHub ↗

disables a texture on the render state * * Disables a texture that has previourly been enabled. * * @name render.disable_texture * @param binding [type:texture|string|hash] texture binding, either by texture unit, string or hash that should be disabled * @examples * * ```lua * function update(self, dt) * render.enable_texture(0, self.my_render_

Source from the content-addressed store, hash-verified

1469 * ```
1470 */
1471 int RenderScript_DisableTexture(lua_State* L)
1472 {
1473 RenderScriptInstance* i = RenderScriptInstance_Check(L);
1474 dmhash_t sampler_hash = 0;
1475 uint32_t unit = 0;
1476
1477 if (lua_isnumber(L, 1))
1478 {
1479 unit = lua_tointeger(L, 1);
1480 }
1481 else
1482 {
1483 sampler_hash = dmScript::CheckHashOrString(L, 1);
1484 }
1485
1486 if (InsertCommand(i, Command(COMMAND_TYPE_DISABLE_TEXTURE, sampler_hash, unit)))
1487 return 0;
1488 else
1489 return luaL_error(L, "Command buffer is full (%d).", i->m_CommandBuffer.Capacity());
1490 }
1491
1492 /*# retrieve the buffer width from a render target
1493 *

Callers

nothing calls this directly

Calls 8

lua_isnumberFunction · 0.85
lua_tointegerFunction · 0.85
CheckHashOrStringFunction · 0.85
InsertCommandFunction · 0.85
luaL_errorFunction · 0.85
CommandClass · 0.70
CapacityMethod · 0.45

Tested by

no test coverage detected