Java Question GLSurfaceView and Renderer from B4A library

bloxa69

Active Member
Licensed User
Longtime User
Hey guys, sorry for overposting, but I really need this answer.
I know I can create a GLSurfaceView in B4A by using B4A OpenGL library.
Is there any way to assign a renderer to that GLSurfaceView from a different B4A library containing the renderer code (made out of java renderer code)?
I mean, it looks like B4A OpenGL library already has a renderer assigned to that view it creates. Is there any way to reassign it?
 

thedesolatesoul

Expert
Licensed User
Longtime User
Yes, it seems that the OpenGL lib creates and assigns its own renderer. I am not versed with OpenGL, but maybe using reflection you can reassign the renderer.
Or you can just create a static method in your lib (untested pseduojava):
B4X:
static void setMyRenderer(GLSurfaceViewWrapper2 glsv, GLSurfaceView.Renderer pRenderer){
  glsv.setRenderer(pRenderer);
}
Although you should do it after Initiailze and hopefully the sequence wont break anything.
 

bloxa69

Active Member
Licensed User
Longtime User
thanks,
will try. I've got all components running but for now it's mainly in Java, which is not so bad if you think of it. Just trying to figure out the ways to communicate between B4A and my library's parts so I can modify the elements without changing the Java code, from B4A.
 
Top