6. Do you mean here? I rewrote it a bit, but I don't really know how else to put it. What's not clear?
I didn't see that, I assumed the member would only be documented in the member's documentation itself. Your description is fine (except for "screens bounds" which should be "screen's bounds").
9. Hmm I admit its pretty big, but the problem is that some calls depend on each other and some calls have to be made in a certain order, so it's not that easy to separate them. I documented everything to make it as clear as possible. But I'll look into it again.
Why are dependencies and order a problem? You can of course preserve them. I'm aware that you may need to pass several arguments, but often this is still better than a massive block of code, because it makes clear which function changes what.
I don't understand why you all want to remove the default constructor. Since the class has primitive type members which won't get initialized properly, to me it is mandatory to write a constructor to ensure a valid state -- which is exactly what Foaly argued.
Yes, but it should be private. Ironically, the argument "valid state" is actually a counterargument, because the default constructor creates a semantically
invalid screen instance, which refers to no real screen. The whole point behind constructors however is to initialize instances to a valid state.
Whether the attributes are in a defined but undocumented state, or in an undefined state, doesn't matter in practice. Users can't make any assumptions about uninitialized instances. All they can do is assign a valid one.
Also, having it private prevents people from having a screen instance that gets properly setup later on, doesn't it?
It does, but it's not a library writer's task to provide a null state for every object. In my opinion, this is already used far too much for convenience, with the effect that we give up class invariants. In this case, it's even worse because there is no officially documented way to check for a null state. This whole discussion has a bigger scope than just
sf::Screen, as there are several classes in SFML doing the same. Maybe we should bring it up again for SFML 3...
Java designers also thought making every object reference nullable would be a good idea, with the result that
NullPointerException is an omnipresent bug in Java development. The effect was so severe that various libraries began to provide half-hearted solutions (
@Nullable and
@NonNull annotations for static code analyzers). This is something you don't have in C++, and I'm really glad about it.
In a near-future C++ version (probably an intermediate library fundamentals technical specification), we will have
std::optional which is exactly designed to provide optional state.
boost::optional has already existed for ages.
A different question: Does it even make sense when the user creates copies of
sf::Screen objects? There is no point in modifying one. If every screen is saved globally, wouldn't const pointers and references suffice?