onCreateView:
View view = inflater.inflate(R.layout.gl_fragment, container, false);
mGlLayout = (FrameLayout)view.findViewById(R.id.gllayout);

mGlView = new GL2JNIView(getActivity().getApplication());
LayoutParams lParams = new LayoutParams(LayoutParams.MATCH_PARENT, 
LayoutParams.MATCH_PARENT);
mGlLayout.addView(mGlView, lParams);

return view;

>Can you show onSurfaceChanged, onSurfaceCreated and onSurfaceCreated ? 
As wrote I used the hello-gl2 native sample from NDK so the calls are like 
there:
onSurfaceCreated is empty
onDrawFrame only contains a call into native code (render)
onSurfaceChanged only contains a call into native code (setupGraphics)

On Wednesday, January 9, 2013 10:02:12 AM UTC+1, Fabien R wrote:
>
> On 07/01/2013 20:18, Zoltan Hubai wrote: 
> > Hi 
> > 
> > I need some help with the following problem. 
> > 
> > I took the hello-gl2 example from the android-ndk and rewrote a bit to 
> > suite my needs. 
> > The GL2JNIView class is the same except the init function where I added 
> >         setRenderMode(RENDERMODE_WHEN_DIRTY); 
> > 
> > In the Render class onSurfaceChanged function I call the native 
> > method setupGraphics(int w, int h)  (see attached file) 
> > In the Render class onDrawFrame function i call the native method void 
> > render(jbyteArray bArray) (bArray contains a jpg image with some other 
> data) 
> > 
> >   
> Can you show onSurfaceChanged, onSurfaceCreated and onSurfaceCreated ? 
> > I'm using the GL2JNIView inside a Fragment that is displayed at user 
> > request. The GL2JNIView is created in the Fragments onCreateView and 
> added 
> > to a FrameLayout. 
> >   
> Can you show onCreateView  ? 
> > This all works fine except the first time the Fragment is displayed I 
> get 
> > the following error: 
> > 
> >   
> You declare the vertices as: 
> GLfloat vVertices[] = { -1.0f, 1.0f, 0.0f, // Position 0 
>
> And in your vertex shader, you expect: 
> static const char gVertexShader[] = "attribute vec4 a_position;   \n" 
>
> Is it normal ? 
>
> - 
> Fabien 
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to