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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - r1nux

Pages: [1]
1
General / SFML Precision (C++)
« on: September 28, 2008, 01:11:31 am »
Does one really need this precision for sprite-placement-management and such?

And I guess that one argument against using doubles instead fo float is
the size where float takes up 4 bytes and doubles uses 8 bytes.

2
General / Help *lol*
« on: September 25, 2008, 08:11:19 pm »
Quote from: "ravenheart"
:cry:
i never understood virtual destructors, could u tell me how one could work with sf::shape?

edit: i do not understand ANY destructor


By making the Base class Destructor virtual, both the destructors will be called in order.

One thing im confused about is that the shape-class dosnt declare
a default constructor.
Dosnt that mean that the shape-class gets a "regular" non-virtual destructor?

Edit:
Think of the destructor as the function that gets called when the object gets
destroyed or gets out of scope.

Example:
Code: [Select]
class AClass
{
public:
AClass(); // Constructor
~AClass(); // Destructor
};


int main(int argc, char** argv)
{
AClass* testClass = new AClass; // Constructor gets called

delete testClass; // Destructor gets called

return 0;
}

or

int main(int argc, char** argv)
{
AClass testClass; // Constructor gets called

return 0; // Destructor gets called.
}


Class Reference

3
General / Help *lol*
« on: September 25, 2008, 05:05:08 pm »
The overhead for calling one extra function is so small for simple games that
you wont notice it anyways.

But my 2 cents.
Try the both techniques to see what suits you the most.

4
General / Help *lol*
« on: September 25, 2008, 04:45:29 pm »
You would probably want to send a reference instead of a copy of the shape
for performance.

5
General / Help *lol*
« on: September 25, 2008, 04:24:08 pm »
Have a "get-function" in the Bat-class?

Ex:

Code: [Select]
class Bat
{
public:
...

sf::Shape getShape() { return m_shapeX; }

private:
sf::Shape m_shapeX;
}


sf::RenderWindow App;

...

Bat left;
App.Draw(left.getShape());


PS.
Havn't tested to compile this code.
But it's should give some kind of idea anyways.

6
General / play video files
« on: September 25, 2008, 12:31:37 pm »
Not nativly with SFML.
But this tutorial, while in french still has english comments, might be usefull?
http://www.sfml-dev.org/wiki/fr/tutoriels/integrervideo

7
Window / sf::Input
« on: September 09, 2008, 06:14:21 am »
Quote from: "marox"
you can do that with Event class ;)


Ahh, thats true.
Tho im still not getting hang of how to implement a check for a single keypress.
What I'm meaning with that is that i want to seperate
onKeyPress and onKeyDown.
Hard to explain and definitive in the wrong forum-section for this kind of topic.

8
Window / sf::Input
« on: September 08, 2008, 11:27:22 pm »
I'm looking for the feature to not only read out if a key is pressed (with App.GetInput()).

In my utopia the Input-class would have the following functions:
IsKeyDown (only returns true the first time a key is being pressed)
IsKeyPressed (returns true every time a key is pressed)
IsKeyReleased (returns true when and only when the key has been released)

I have tried to "simulate" this by myself but without success.
If anyone could help me simulate this or point me in the right direction
I would happily be satisfied with that.

Best regards.

9
Feature requests / Rotating views
« on: April 23, 2008, 10:19:02 pm »
Is this hard/impossible to add to SFML?

Or is it maybe easy to do this by the user with the
help of OGL?

Pages: [1]
anything