Tangent128 / luasdl2

A pure C binding of SDL 2.0 for Lua 5.1, Lua 5.2, and LuaJIT.
ISC License
385 stars 74 forks source link

renderer:copyEx doesn't accept textures #40

Closed MadPie closed 8 years ago

MadPie commented 8 years ago

The function errors saying it expected a table, instead of userdata for arg 1, which is the texture. Is there a fix for this?

Here is the error-

bad argument #1 to 'copyEx' (table expected, got userdata)

Tangent128 commented 8 years ago

copyEx takes its arguments in the form of a table.

Instead of

renderer:copyEx(textureUserdata)

try

renderer:copyEx({texture = textureUserdata})

(Documentation)

MadPie commented 8 years ago

That fixed it.