[SDL] Image didn't show up.

Started by
0 comments, last by Mybowlcut 15 years, 3 months ago
I want to make a class for my Player(user) but the image I want to didn't show up in the screen but it loads fine. It show up when I try to make a function in class Engine that calls the ApplySurface(100,100,player1,screen) but I want to separate it using function to make it more organize and so I can add more in the future. Didn't work.
Quote:class Engine { public: SDL_Surface *screen; SDL_Surface *player1; void ApplySurface( int x, int y, SDL_Surface* psource, SDL_Surface* pdestination, SDL_Rect* clip = NULL ); Engine::Engine() { screen = NULL; player1 = NULL; } }; class Player: public Engine { public: void draw(); }; void Player::draw() { ApplySurface(100,100,player1,screen); }
Works
Quote:class Engine { public: SDL_Surface *screen; SDL_Surface *player1; void ApplySurface( int x, int y, SDL_Surface* psource, SDL_Surface* pdestination, SDL_Rect* clip = NULL ); void draw(); Engine::Engine() { screen = NULL; player1 = NULL; } }; void Engine::draw() { ApplySurface(100,100,player1,screen); }
Hope you understand what I'm trying to say. Thanks m3rk OT: What's the BBcode for codes here? The one with fancy colors that others use.
Advertisement
Look here for info on code tags.

Can we see the definition of ApplySurface? After all that is the function doing the drawing, right?

This topic is closed to new replies.

Advertisement