Userdata objects can be referenced with lightuserdata.

This commit is contained in:
jussi
2023-10-30 00:04:11 +02:00
parent 992310fb90
commit d287078c65
18 changed files with 453 additions and 256 deletions

View File

@@ -29,7 +29,7 @@ int lglBlitFramebuffer( lua_State *L ) {
glBindFramebuffer( GL_READ_FRAMEBUFFER, 0 );
}
else {
RenderTexture *srcTex = luaL_checkudata( L, 1, "RenderTexture" );
RenderTexture *srcTex = uluaGetRenderTexture( L, 1 );
glBindFramebuffer( GL_READ_FRAMEBUFFER, srcTex->id );
}
@@ -37,7 +37,7 @@ int lglBlitFramebuffer( lua_State *L ) {
glBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 );
}
else {
RenderTexture *dstTex = luaL_checkudata( L, 2, "RenderTexture" );
RenderTexture *dstTex = uluaGetRenderTexture( L, 2 );
glBindFramebuffer( GL_DRAW_FRAMEBUFFER, dstTex->id );
}