Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support offscreen drawing #48

Open
rlane opened this issue Mar 17, 2012 · 1 comment
Open

support offscreen drawing #48

rlane opened this issue Mar 17, 2012 · 1 comment

Comments

@rlane
Copy link

rlane commented Mar 17, 2012

Redirecting drawing operations to another SDL surface is useful for postprocessing effects, procedurally generated sprites, etc.

Proposed API:

canvas = createCanvas(width, height)
canvas = loadImage(filename)
previous = selectCanvas(canvas)
drawCanvas(canvas, x, y)
canvas = rotozoomCanvas(srcCanvas, angle, zoom, smooth)

The implementation would mostly be a renaming of the existing sprite code and adding more bindings. The sprite() function could be reimplemented in Lua in terms of the canvas functions.

Let me know what you think of this API. I'll implement it in the next couple of days.

@r043v
Copy link

r043v commented Mar 19, 2012

would be easy to selectCanvas function only replace current "fb->screen" surface into the l81 struct, all other code would still working out of the box,

after, internally, load81 would reset screen surface to the real one, and do the flip, on each frame

will be ok for blit onto canvas, but not offer any way for blitting canvas on screen with sprite method if this one still keep filename as unique argument.

i started implement dynamic argument in the lua api for my image/anims/maps code, for accept indiferently filenames or image id

maybe time, now as this is project start to define goal and future api of load81.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants