The reasons are that you don't have to play with these variables .
But that's what protected is for. The regular John Doe won't be deriving from SFML classes as this (exept for sf::Thread) is not SFML's schema of proper use.
It's a great lib, but far from complete.
And because it's so tight in functionality and "keeping it minimal", it's a pity that it lacks the ability to add functionality program-side without touching the library code itself.
Making everything public is absurd because it kills OOP paradigms. But protected is the key to allow extention of classes.
I would like to know what people think about this, thou not a whole lot extend or even touches the lib's source.
Another example, getting the 4x4 opengl-friendly projection matrix from a sf::RenderWindow's current view is IMPOSSIBLE.
I'm using mixed SFML/OpenGL code (for a background moving texture, to simulate depth), and wanted to get the exact same projection matrix that SFML's drawables get (to avoid Preservation of GL states, which is slow)
Instead I had to do something like:
App.Draw(Shape());
(draw a bogus shape in order to load the projection matrix.)
This is clearly a bug, I'd better fix it myself. Can you tell me more about it?
I don't think it's a bug. Maybe I wrote it badly (I'm not so good at english).
I wanted to do a sound queue, that would derive from Sound (because of the OpenAL Source), keeping all Sound's functionality: volume, pitch, position... and to take as many buffers as wanted, and just do what Music class does for music streaming, but without the streaming part, and having more control over what's played and how.
e.g.:
SoundQueue q;
q.AddBuffer(soundBuffer1);
q.StartLoop();
q.AddBuffer(soundBuffer2);
q.AddBuffer(soundBuffer3);
q.EndLoop();
q.AddBuffer(soundBuffer4);
q.Play(); //if currently stopped, plays buf1 thru 3, and then loops indefinetly between buf2 and 3.
q.Stop(); //stop looping, so when the queue reaches the buffer3, continue with buffer 4 until there are no more.
q.HardStop(); // Kill the sound, shut it up.