Sign in to follow this  
?????????

SFML pointers

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
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.
[/size]
Something like that.

Share this post


Link to post
Share on other sites
Thanks for the ultra-fast reply!!! [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]Oh, about the siggy,..... sure! [img]http://public.gamedev.net/public/style_emoticons/default/biggrin.gif[/img]

-David D.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this