Jump to content
  • Advertisement
Sign in to follow this  
?????????

SFML pointers

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

Sorry if this is a dumb question.
Hello, I recently started development in SFML and I would like to know whether the code I wrote (attached) is perfectly fine.
Basically, I seperated my little app into functions and I use a pointer to my RenderWindow in each function. Is it ok to use such pointers, or should I call the RenderWindows methods using some other way (eg. global non-pointer, argument, etc...)?

Thanks in advance,
David D.

[attachment=2916:main - Copy.cpp.txt]

Share this post


Link to post
Share on other sites
Advertisement
Consider passing the RenderWindow by reference to the functions that requirement. Try to avoid using globals.

Your signature is incredibly big. See if you can condense it, e.g. strip out the quote tags:
[size="1"]
A n00b programmer: someone once told me learning C++ was like learning how to juggle knives...
Servant of the Lord: That's not true at all! C++ doesn't require anywhere near the hand-eye coordination juggling requires. And with C++ after you slip and kill someone with the knife, you can reuse it for something else afterward. With actual knives, you have to get rid of the evidence.

Something like that.

Share this post


Link to post
Share on other sites
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!