The method I use for overlaying text on a GL view is:- You have a square texture image that contains all the chars you will need (mine is a 256x256 bmp). You load the texture and write a function that creates polys for each of the chars you pass in to the function. Each poly uses the correct texture position to display the required char.
You are only adding 2*chars triangles for each render loop. This does not effect the FPS by any noticeable degree on my OpenGL app. You could also use this to display text in the 3D environment if you need to (my version does not do this yet). I have some example code if you need some more info on this method. On Jun 2, 3:03 pm, TreKing <[email protected]> wrote: > On Wed, Jun 1, 2011 at 7:39 PM, EdwardComb <[email protected]> wrote: > > I google again and found out that we cannot straight away display text > > on GLSurvaceView. (my mistake i didnt mention in the question) > > That would have been good to know :-) > > > Thus, I tried to bind the text as texture on an object like a 2D square. > > As a result: > > 1) My FPS drop from ~16 to ~3 > > Yup - that sounds slow. I've not used GLSurfaceView, but all Views have a > draw function that takes a Canvas that you can use to draw text. Other than > that, I have no idea. > > > 2) My application crash. > > You will have to provide much more information than that if you want help > with that part. > > --------------------------------------------------------------------------- > ---------------------- > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > transit tracking app for Android-powered devices -- 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

