[Ves] Connection between Native Rendering and GLSurfaceView

Pat Marion james.patrick.marion at gmail.com
Fri Sep 6 12:15:41 EDT 2013


If you look at KiwiGLSurfaceView.java, you'll see that the native rendering
code is invoked like this:

public void onDrawFrame(GL10 gl) {
    boolean result = KiwiNative.render();
    ...
}

As long as the native rendering is called from inside the onDrawFrame
method of the GLSurfaceView's Renderer then everything works.  The
GLSurfaceView will ensure its Renderer's GL context is active prior to
calling onDrawFrame.  If you need to make other GL calls, like creating
textures, you should do those calls by queuing a runnable to execute on the
Renderer's thread.  You'll see examples of that in KiwiGLSurfaceView.java.

If you create a second GLSurfaceView, you won't be able to render the same
data in each view, you'll have to create new VBOs for each context.  If
you're using vesKiwiDataRepresentation objects, then you'll need to create
two of those.

Pat




On Fri, Sep 6, 2013 at 10:33 AM, David López <davidestebanlopez at gmail.com>wrote:

> Hello everybody,
>
> I wanted to know how the native rendering part of the application knows in
> which GLSurfaceView it should draw. For instance, if I had two
> GLSurfaceViews how could I use them to render different the data from
> different points of view?
>
> Thank you all,
>
> David.
>
> _______________________________________________
> Ves mailing list
> Ves at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/ves
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20130906/5effa8f6/attachment-0001.html>


More information about the Ves mailing list