Jump to content
  • Advertisement
Sign in to follow this  

[SDL] Image didn't show up.

This topic is 3403 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!