Communication between Activity and GLSurfaceView

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

Communication between Activity and GLSurfaceView

Postby sdesmond » Mon Mar 01, 2010 1:33 pm

I'm writing a simple sports game using an extended version of an GLSurfaceView object as my main view. I've added a scoreboard bar at the top from within the activity that owns the surface view. My problem is that most of the game play takes place entirely in the surface view and I'm not sure how to pass data out of the view to my activity to update the score. The only techniques I can think of are to use return statements which don't really work for me because the gameplay is controlled in the surfaceview so there aren't calling methods from the activity. The other way I've tried is to pass the different views into the surfaceview constructor but this gives me an error that only the thread that created a view hierarchy can modify its child views. I'm sure there is some easy technique for this but I cannot figure it out. thanks for the help
sdesmond
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Feb 08, 2010 8:30 pm

Top

Re: Communication between Activity and GLSurfaceView

Postby Ahylkova » Thu Sep 05, 2013 6:30 pm

What I read I really liked it. Thank you for your information!
Ahylkova
Junior Developer
Junior Developer
 
Posts: 15
Joined: Wed Sep 04, 2013 9:23 pm

Top

Return to Android 2D/3D Graphics - OpenGL Tutorials

Who is online

Users browsing this forum: No registered users and 7 guests