SFML pointers

Started by
1 comment, last by ????????? 12 years, 10 months ago
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]
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.
Thanks for the ultra-fast reply!!! smile.gifOh, about the siggy,..... sure! biggrin.gif

-David D.

This topic is closed to new replies.

Advertisement