New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OS X improvement: warnings + bugfix + refactoring, the lot! #1042
Conversation
27b6c2e
to
2b456b6
Compare
Actually... there's a bug in there. 😩 I'm currently working on some refactoring (to grab the cursor maybe more elegantly) so I'll update this PR when the refactoring is done and the bug fixed. |
Does the iOS code need a similar change perhaps? I've noticed with the latest master branch code (that I've built for iOS) that on orientation change the resize event is fired and its data shows width and height values that are twice what It would be preferable for these width/height values to be consistently in the same units and for those units to always be in pixels. |
The related code is heavily different so I don't think so. But there might be some inconsistency with backing factor somewhere -- this thing is a nightmare at least on OS X for SFML. |
2b456b6
to
a675246
Compare
I just updated the description of this PR as it now includes a few more thing. Testing/feedback welcome! |
Opened an issue for the problem I’d mentioned. Also wrote a fix and made a pull request for those changes: Bug: iOS orientation change handling re-scales window size by backingScaleFactor #1049. Hope this helps at least on the iOS side of things then.
|
The OpenGL example and Glsl.inl fixes are not really OS X specific, but I guess that doesn't really matter. 😉 Would be great if some other OS X users could test this. |
No, absolutely not. Even more reasons to check this PR! :-) (I've put it in here because it calms down BuildBot.) |
/// \param X Component of the 4D vector | ||
/// \param Y Component of the 4D vector | ||
/// \param Z Component of the 4D vector | ||
/// \param W Component of the 4D vector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? It doesn't add information, just makes the documentation more verbose. Now the parameter descriptions are even identical for all four parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Doxygen allow to document multiple parameter in one line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the official documentation even uses a x,y,z
example, so using a single \param
here seems pretty appropriate ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly clang doesn't like it and emit a warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang bugreport! 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a side note, I'm personally a big fan of keeping things concise, including documentation. It's amazing how people write stuff like
/**
* Checks if the object is stored.
*
* @param object Object that is checked.
* @return true if the object is stored, false otherwise.
*/
boolean containsObject(Object object) { ... }
where the method name alone would contain 100% of the documentation's information, just to fit in some questionable document-everything-strictly policy. The only thing it does is becoming outdated at the next refactoring. 😉
SFML contains quite a few such places, even if not that extreme. It's not something we have to adapt now that the documentation is already written, but I would not force currently concise documentation to the same level of verbosity, either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang bugreport!
Technically, I would need to go through Apple's bug report system as they modify clang for their needs... But you're right -- and I totally agree on the readability/conciseness part. However, last time I used it, it took them two years to answer my bug report. In the meantime, let's have a happy BuildBot report, shall we? 😄
So will you adjust the docs? |
I'd leave the commit as-is to get a clean build bot feedback. When the missing feature from clang is added, we can always change it back.
We have two choice here: a) assume I do my job right and merge it, or b) put pressure on the community until testers show up. Besides me, who would be in favor of b) -- I cannot stress enough how much I'd love to see more good contributions for OS X from the community. |
Since we've still not found more testers, do you thin we should go ahead and merge it? Currently there seems to be merge conflicts, so a rebase would be nice. |
👍 |
a675246
to
0c369dd
Compare
Rebased and updated (dropping 32-bit support) |
This PR has been added to my merge list, meaning it will be merged soon, unless someone raises any concerns. |
(in prevision for custom cursors)
NOTE: external libraries are not updated in this commit but don't expect update to contain 32-bit symbols from now on.
67891a6
to
845c684
Compare
This PR fixes the warnings detected by static analyser regarding OS X, as well as clang's warning for regular build. That is, it replaces deprecated
setColor
forsf::Text
, fixes a bit the documentation in one place, removes#warning
that are anyway useless, replaces some deprecated Cocoa feature with newer ones (10.7+) and usesstatic_cast
instead of C-cast where appropriate.It also improves desktop/fullscreen modes detection for 10.8+ as explained in this comment and how they are handled when creating a fullscreen view.
Furthermore, it importantly refactors SFOpenGLView and splits this monolithic implementation into several files to make it manageable by human being. This way I can implement #614 correctly (already did, actually!)
In addition to all that, it fixes a bug related to fullscreen mode: when resizing a fullscreen window, the fullscreen mode was completely broken.
Finally, in order to anticipates some refactoring for #827: NSImage can now be easily created from raw pixel data.
NB: the branch is still named
osx_warning
but its content is significantly more important than just fixing warning. I didn't rename it as I don't know how GitHub will react...