-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
GLFW Boolean return type #181
Comments
Technically it's possible (and easy). LWJGL normally does this only when the native API has a dedicated boolean type. Is anyone against such a change? It will affect the following functions:
|
In GLFW we do, @Spasi Why GLFW_TRUE was chosen instead of native Java boolean? |
@iamcreasy I mentioned this, int is used because that's what the native API uses. C code can do:
because C supports numeric values in conditions (they are automatically compared against 0). |
That would be great! In addition, there are a few callbacks that have boolean type arguments, such as the iconify callback or the cursor enter callback. Could this be done there as well for consistency? |
@arisona Thanks for the reminder, those callbacks have changed too. |
This commit fixes functions that were missed in #181.
Both OpenAL and OpenGL have Boolean return methods that are used in place of their *_TRUE and *_FALSE return values. GLFW also does this but does not make a special type for the Boolean value and instead treats it as an int (OpenGL and OpenAL treat it as a byte if I remember correctly but only give it the true or false value) so it should be possible to make it so that certain GLFW functions that are documented Boolean returns actually return a Boolean java type. Its not really required as its easy enough to just do
glfwInit() != GLFW_TRUE
but it would be nice to have.The text was updated successfully, but these errors were encountered: