Jump to content

  • Log In with Google      Sign In   
  • Create Account


SFML pointers


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 anonymous22   Members   -  Reputation: 199

Like
0Likes
Like

Posted 08 June 2011 - 09:58 AM

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.

Attached File  main - Copy.cpp.txt   3.56KB   67 downloads

Sponsor:

#2 rip-off   Moderators   -  Reputation: 6876

Like
1Likes
Like

Posted 08 June 2011 - 10:09 AM

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:

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.

#3 anonymous22   Members   -  Reputation: 199

Like
0Likes
Like

Posted 08 June 2011 - 10:44 AM

Thanks for the ultra-fast reply!!! Posted ImageOh, about the siggy,..... sure! Posted Image

-David D.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS