Skip to main content
GameDev.net gamedev.net
🔒 Locked

rotozoomSurface() SDL_GFX

Started by Kirsch Jan 3, 2011 at 2:00 AM 0 replies 2.3k views
Original Post
Kirsch
Kirsch
After figuring out that SDL_gfx is a decent library to use to rotate surfaces, I began to use rotozoomSurface to rotate a surface on my game, however it proved mixed results. The surface rotated fine yet gave a black background when it rotated, and I can't figure out how to change that background color when it rotates.

screenshot:

http://img694.imageshack.us/img694/3273/rotation.png

code:

SDL_Surface *rotationSurface;

rotationSurface = rotozoomSurface(hole, (double)rotAngle, 1, 1);

apply_surface(100, 250, rotationSurface, screen);
Jack Sotac
Jack Sotac
Depending on the surface returned by rotozoomSurface(), it will be necessary to either set the color key with SDL_SetColorKey() or enable per-pixel alpha using SDL_SetAlpha() for that surface. This will allow the surface to be used on any background.
0xa0000000

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.