-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add an assert on custom frame control support #4444
Add an assert on custom frame control support #4444
Conversation
@@ -27,12 +27,20 @@ | |||
********************************************************************************************/ | |||
|
|||
#include "raylib.h" | |||
#include "config.h" | |||
#include "assert.h" |
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.
Since this is a system header it should use <> not ""
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.
true 👍
#if !defined(SUPPORT_CUSTOM_FRAME_CONTROL) | ||
// This examaple requires the SUPPORT_CUSTOM_FRAME_CONTROL feature. | ||
// Please edit your raylib config.h and recompile raylib. | ||
assert(false); | ||
#endif |
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 is assert needed? would not a printf and return -1 here be the same?
assert is not used any other raylib code.
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.
Inside the library assert might be to harsh,
but considering this example application can not function without that define, I would use an assert.
But whatever the codebase follows is fine for me
@Mercotui thanks but I'm not adding two extra libraries and an assert just because the user can not read the example instructions. |
Naja as I personally experienced: The whole screen flashes black and white at a high framerate. As for libraries: Anyway I could update the code to |
This prevents users from getting a attacked by angry frames when they try this example without reading the warnings in the source code.