SFML community forums
General => Feature requests => Topic started by: solgar on November 25, 2009, 12:18:56 am
-
Laurent, have you ever consider Shape::Compile() method to be public instead of private? I think, that Shape Compile() method should be public rather than private. If someone create his own shape it can be compiled only at render time. I think that user should have possibility to compile shape by himself. Plus in Java binding when I create predefined shapes I have to rewrite these static methods because those return object instead of pointer and these Shapes are not compiled (I cannot rewrite compile method because this method operate on private myPoints) - so there is difference between Java and C++ Shapes. I know that this is minor issue, but what do you think about it?
-
Laurent, have you ever consider Shape::Compile() method to be public instead of private?
No :)
I think, that Shape Compile() method should be public rather than private. If someone create his own shape it can be compiled only at render time. I think that user should have possibility to compile shape by himself
Hum, does it really matter? Is it done only one time anyway, it's not like if it was compiled before every Draw().
Plus in Java binding when I create predefined shapes I have to rewrite these static methods because those return object instead of pointer and these Shapes are not compiled (I cannot rewrite compile method because this method operate on private myPoints) - so there is difference between Java and C++ Shapes. I know that this is minor issue, but what do you think about it?
Sorry, I don't understand. Can you tell me more about this issue?
-
Hum, does it really matter? Is it done only one time anyway, it's not like if it was compiled before every Draw().
Ok, you are right.
Sorry, I don't understand. Can you tell me more about this issue?
It is more difference than issue. Predefined shapes (like line or circle) in Java will be uncompiled - C++ predefined shapes are compiled during creation. They will be uncompiled because I have to rewrite these static methods (sf::Shape::Circle() and others) as jSFML native function because these methods return objects not created by "new" and because of that those objects cannot be deleted using "delete" - and native object is "deleted" when corresponding Java object is freed by GC. To rewrite those static methods i need to rewrite ComputeNormal() and Compile() because these are private and i cannot access them. I can rewrite ComputeNormal() but Compile() uses private myPoints which I cannot access. So i thought that it would be nice to have access to this method. But as you said compiling is not a performance killing task. Just a thought ;).
-
Well, so they are just like custom shapes, they will be compiled on first Draw.
And can't you just do something like this, instead of rewriting everything?
xxx Rectangle(...)
{
sf::Shape* shape = new sf::Shape(sf::Shape::Rectangle(..));
...
}
-
And can't you just do something like this, instead of rewriting everything?
xxx Rectangle(...)
{
sf::Shape* shape = new sf::Shape(sf::Shape::Rectangle(..));
...
}
Of course I can. Stupid me. Thanks. :D