Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

mds_79

How to dynamically create an SDL_Surface

This topic is 5663 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

Ok. As the topic says, I want to dynamically allocate an array of SDL_Surfaces. Something along these lines (this doesn''t work) SDL_Surface **poo; *poo = new SDL_Surface[10]; Thanks "Discipline is never an end itself, only a means to an end." - Robert Fripp

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
SDL_Surface** srf;

srf = new SDL_Surface*[10];

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
SDL_Surface** srf;

srf = new SDL_Surface*[10];

if I remember correcly.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Newbie question:

why would you want to do this?

Share this post


Link to post
Share on other sites
Thanks, I''ll check to see if it works when I get home. The reason I want to do this is to allow different sprites to have a differing number of frames for animation.

"Discipline is never an end itself, only a means to an end." - Robert Fripp

Share this post


Link to post
Share on other sites
Thanks again, it worked perfectly.

"Discipline is never an end itself, only a means to an end." - Robert Fripp

Share this post


Link to post
Share on other sites

  • 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!