Reputation: 31
I am attempting to make some kind of OpenGL wrapper that can be used on both PC and on Android.
My approach is to have some kind of Abstract OpenGL class with all OpenGL functions and then extend that class with a specialized one for each platform. However, there seem to be no way to do this on Android as you need a GL10 object that only can be get from functions such as onDrawFrame()
and so on. You cannot save that GL10 object and use that in my Android GL class that extends Abstract OpenGL. If I try, nothing will be rendered, I have no idea why.
So are there any work around for this? If an OpenGL function are being called in Android GL class I need to have some way to do all the calls in the onDrawFrame()
in the renderer class.
Upvotes: 1
Views: 778
Reputation: 16450
jPCT is another good option. Java-Based and supports PC and Android.
Upvotes: 1
Reputation: 2273
You can consider using libgdx engine if you need your OpenGL app run both on PC and Android device. That's more reasonable than creating own wrappers.
Upvotes: 4