hi all,i m starting with OpenGL and have a question I cant seem to find any resource on..

my glSurfaceView is in an activity with 2 buttons.i would like the buttons to interact with the glSurfaceView (for example zoom in/zoom out).I implemented a couple of methods in the glSurfaceView, that raise a queueevent (which changes a value in the renderer). I have then bound the button's onClick events to those methods. I have not used touch event (because the glSurfaceView is not meant to be touch sensitive)..This does not work, though it does not generate any error, the perspective is simply not changed...If i use touch event in the glSurfaceView then everything works fine.Could someone please help me shed some light if what im asking is possible?

Sure it is possible. Curious. Did you debug it? Seems like a quick problem to find with a little debugging.

If the action is as simple as changing an atomic variable for something like zoom, then just setting a member variable for zoom in the renderer class will work fine rather than queing events. Some people write whole games without any queued events between threads. Not recommending this. Just saying. Maybe just do this as a test if you are resistant to bad coding practices that idiots like me on the forum recommend.

Hello seed, thanks very much for trying to help..the action is really simple, and I am surprised I still couldnt get it to work the way I wanted. Let me give you a few details of the code.The activity has 2 buttons, and 1 view that extends glsurfaceview.Button zoomin calls this method defined in the extended glsurfaceview:

As I said, the only way i got this to work was detecting the ontouchevent on the glsurfaceview, and binding the rest of my code there. I know this will sound trivial to most of you reading this.. but I have only started with openGL a few days ago..I guess Im just missing something really obvious..?

again, thanks very much for any help you could give...

thanksN

seed wrote:Sure it is possible. Curious. Did you debug it? Seems like a quick problem to find with a little debugging.

If the action is as simple as changing an atomic variable for something like zoom, then just setting a member variable for zoom in the renderer class will work fine rather than queing events. Some people write whole games without any queued events between threads. Not recommending this. Just saying. Maybe just do this as a test if you are resistant to bad coding practices that idiots like me on the forum recommend.

Sorry, I probably shouldn't have spoken so soon. I don't really know what I am talking about. I haven't done anything like this. I suppose you probably want two views, one is your glSurface and one that has your buttons and do the onTouch in the other view - or something like that, but again I probably shouldn't have spoken.

I am curious about something. You said, "because the glSurfaceView is not meant to be touch sensitive". Really? I hadn't heard that. Why is that?

oh i see I had my hopes raised already ..no what I meant was that in the scope of my project the glsurface is not meant to trap any touch event itself. I wanted the user to click on the buttons in the normal view to do that..but I just cant seem to understand how to achieve that..

hope someone else chimes in, if possible..

but thanks for your input seed,

N

seed wrote:Sorry, I probably shouldn't have spoken so soon. I don't really know what I am talking about. I haven't done anything like this. I suppose you probably want two views, one is your glSurface and one that has your buttons and do the onTouch in the other view - or something like that, but again I probably shouldn't have spoken.

I am curious about something. You said, "because the glSurfaceView is not meant to be touch sensitive". Really? I hadn't heard that. Why is that?