in Android NDK, is it possible to get OpenGL ES 1.1 to work with a typical Java-based GLSurfaceView template (overriding methods from GLSurfaceView.Renderer onDrawFrame, onSurfaceCreated, etc.) using the C ++ side frame, color and depth of buffers and VBO?
I am trying to create them using this:
void ES1Renderer::on_surface_created() { // Create default framebuffer object. The backing will be allocated for the current layer in -resizeFromLayer glGenFramebuffersOES(1, &defaultFramebuffer); glBindFramebufferOES(GL_FRAMEBUFFER_OES, defaultFramebuffer); // Create color renderbuffer object. glGenRenderbuffersOES(1, &colorRenderbuffer); glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer); glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, colorRenderbuffer); // create depth renderbuffer object. glGenRenderbuffersOES(1, &depthRenderbuffer); glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer); glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer); }
However, this does not seem to fit the context that I think was created when initializing GLSurfaceView and the java side.
I'm not an expert on NDK or OpenGLES, but I need to port an iOS application that uses OpenGL ES 1.1, and I try to use as much code as I can. Since the application also uses the user interface components for the platform (buttons, lists, etc.), Rice GL graphics, I thought this would be the best way. However, now I am considering using my native activity, although I'm not sure what will happen to the other java components.
source share