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

Function RenderScript_SetViewport

engine/render/src/render/render_script.cpp:781–792  ·  view source on GitHub ↗

sets the render viewport * * Set the render viewport to the specified rectangle. * * @name render.set_viewport * @param x [type:number] left corner * @param y [type:number] bottom corner * @param width [type:number] viewport width * @param height [type:number] viewport height * @examples * * ```lua * -- Set the viewport to the window dime

Source from the content-addressed store, hash-verified

779 * ```
780 */
781 int RenderScript_SetViewport(lua_State* L)
782 {
783 RenderScriptInstance* i = RenderScriptInstance_Check(L);
784 int32_t x = luaL_checkinteger(L, 1);
785 int32_t y = luaL_checkinteger(L, 2);
786 int32_t width = luaL_checkinteger(L, 3);
787 int32_t height = luaL_checkinteger(L, 4);
788 if (InsertCommand(i, Command(COMMAND_TYPE_SET_VIEWPORT, x, y, width, height)))
789 return 0;
790 else
791 return luaL_error(L, "Command buffer is full (%d).", i->m_CommandBuffer.Capacity());
792 }
793
794 /*# creates a new render target
795 * Creates a new render target according to the supplied

Callers

nothing calls this directly

Calls 6

luaL_checkintegerFunction · 0.85
InsertCommandFunction · 0.85
luaL_errorFunction · 0.85
CommandClass · 0.70
CapacityMethod · 0.45

Tested by

no test coverage detected