Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "handleGraphics.h"
- handleGraphics::handleGraphics()
- {
- //ctor
- }
- void handleGraphics::applyImage(SDL_Surface *screen,std::string name,int x,int y)
- {
- SDL_Surface *image=SDL_LoadBMP(name.c_str());
- SDL_Surface *optimized=SDL_DisplayFormat(image);
- SDL_FreeSurface(image);
- SDL_Rect offset;
- offset.x = x-(int)((*optimized.h)/2);
- offset.y = y-(int)((*optimized.w)/2);
- SDL_BlitSurface( optimized, NULL, screen, &offset );
- }
Add Comment
Please, Sign In to add comment