Thanks guys.  You have all been very helpful!

On Aug 19, 5:15 am, Robert Green <[email protected]> wrote:
> I just load the loading screen textures first and render it in OpenGL
> ortho while loading.  I even have a progress bar, though you have to
> load in steps to do that.
>
> On Aug 18, 4:40 am, Miguel Morales <[email protected]> wrote:
>
>
>
> > Well, I think the easiest thing for you would be to add an overlay
> > view on top of your openGL view.
> > This is fairly easy.
>
> > On your activity's onCreate you could do this:
>
> > LinearLayout base = new LinearLayout(this);
>
> > FrameLayout frame = new FrameLayout(this);
> > YourGLView gl_view  = new YourGLView(...);
>
> > YourOverlayView overlay_view = new YourOverlayView(...);
>
> > frame.addView(gl_view);
> > frame.addView(overlay_view);
> > base.addView(frame);
>
> > setContentView(base);
>
> > YourOverlayView can be derived from any view.  I personally extend
> > ImageView and override the onDraw() method for full control.
>
> > On Tue, Aug 17, 2010 at 11:56 PM, Jason <[email protected]> wrote:
> > > Hi all,
>
> > > I'm trying to find the best way to implement a "loading screen" when
> > > using aGLSurfaceView.
>
> > > Basically the situation is this:
>
> > > The app (game) loads a bunch of textures into VRAM when the GL surface
> > > is created (onSurfaceCreated), however these textures are only for the
> > > current "level" of the game.  When the player reaches the end of the
> > > level I need to remove these textures from VRAM and load the new ones.
>
> > > Previously (during development) each level was a complete load/unload
> > > of the Activity, which works fine, however this creates a bunch of
> > > unnecessary overhead as I don't need to reload the world for a simple
> > > level progression.  So I have been experimenting with different ways
> > > to overlay a standard view (which is my "loading" screen) over the top
> > > of theGLSurfaceViewwhile the level data is loaded.
>
> > > This has created some problems for me:
>
> > > 1. Because theGLSurfaceViewis not actually destroyed, the
> > > onSurfaceCreated call is only made once and hence the opportunity to
> > > load textures is gone.  To overcome this, I have introduced a flag
> > > into the Renderer thread which will load up the textures in the first
> > > call to onDrawFrame after the level is loaded.  I don't particularly
> > > like this, but can't seen any other solution.
>
> > > 2. I don't seem to be able to find a way to effectively "switch views"
> > > in my Activity.  I initially set the view (setContentView(...)) to the
> > > loading screen (i.e NOT theGLSurfaceView), then the actual level load
> > > is done asynchronously and when complete calls back to the main
> > > activity thread which then performs a second call to setContentView()
> > > with theGLSurfaceViewinstance.  This works the first time, but
> > > thereafter I can't seem to get the loading view to become visible.  If
> > > I use setVisibility(View.VISIBLE) on the loading view it doesn't
> > > display, and if I perform a further call to setContentView() my
> > >GLSurfaceViewnever comes back... that is, after subsequently calling
> > > setContentView with theGLSurfaceViewI get nothing displayed... no
> > > errors, but my loading screen basically never disappears.
>
> > > So.. does anyone out there have a good approach to solving this?  That
> > > is, how to best implement a loading screen to "hide" the process of
> > > bootstrapping opengl resources etc.
>
> > > Thanks!
>
> > > --
> > > 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
>
> > --http://developingthedream.blogspot.com/,http://diastrofunk.com,http:/..., 
> > ~Isaiah 55:8-9

-- 
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