Skip to content

Commit

Permalink
BlitBuffer: Allow preserving the rotation & inverse flag in fromstring
Browse files Browse the repository at this point in the history
  • Loading branch information
NiLuJe committed Dec 11, 2021
1 parent 369f191 commit ca2de4b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ffi/blitbuffer.lua
Expand Up @@ -2148,11 +2148,17 @@ function BB.compat(oldbuffer)
return ffi.cast("BlitBuffer4*", oldbuffer)[0]
end
function BB.fromstring(width, height, buffertype, str, stride)
function BB.fromstring(width, height, buffertype, str, stride, rotation, inverse)
local dataptr = C.malloc(#str)
ffi.copy(dataptr, str, #str)
local bb = BB.new(width, height, buffertype, dataptr, stride)
bb:setAllocated(1)
if rotation ~= nil then
bb:setRotation(rotation)
end
if inverse ~= nil then
bb:setInverse(inverse)
end
return bb
end
Expand Down

0 comments on commit ca2de4b

Please sign in to comment.