Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Error displaying, pointer to Sprite  (Read 6507 times)

0 Members and 1 Guest are viewing this topic.

Xeshi

  • Newbie
  • *
  • Posts: 8
    • View Profile
Error displaying, pointer to Sprite
« Reply #15 on: March 25, 2011, 01:59:20 pm »
Quote from: "Tank"
Go for the first version. Never ever use the heap when there's not a good reason to do so!


So how best to do it?
Do not want to tangle with the inheritance, I do not have much experience to be able to write it well.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Error displaying, pointer to Sprite
« Reply #16 on: March 25, 2011, 02:33:03 pm »
Quote from: "Xeshi"
So how best to do it?
Use automatic memory management whenever possible.
Code: [Select]
Type object(args);
DoSomething(object);
instead of
Code: [Select]
Type* pointer = new Type(args);
DoSomething(*pointer);
delete pointer;
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything