I have an application that will be taking advantage of the NDK do to high graphics requirements and a terrain generation library that I wrote in c++. My question is if I already made my GUI with the SDK and I make a random opengl call in java such as GLES20.glEnable(GL_CULL_FACE);
and then proceed to call glEnable(GL_DEPTH_TEST);
in C++ via JNI would there be any known errors/build issues? In the case that someone wonders why I am asking this and/or thinks it is a stupid question it is because in desktop OpenGL there is an existing OpenGL context
(though GLFW took care of most of this). I am concerned if OpenGL ES also has an existing context
. If so, would making OpenGL ES calls from both java and C++ write to previously stated context
?
In OpenGL you're always dealing with context, yes. The critical parts for you are
Practically all Java calls to OpenGL go into native code any way. So if you write parts of your program with the NDK and call into these parts in the same way as you'd call directly into OpenGL, then a OpenGL context will be current and be usable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With