[SDL] smpeg/glmovie crawls

Gib Bogle bogle at ihug.co.nz
Wed Jul 3 15:10:01 PDT 2002


> Message: 29
> From: "Paulo Pinto" <pjmlp at progtools.org>
> To: <sdl at libsdl.org>
> Subject: RE: [SDL] smpeg/glmovie crawls
> Date: Wed, 3 Jul 2002 18:21:25 +0100
> Reply-To: sdl at libsdl.org
> 
> > -----Original Message-----
> > From: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of
> > Romi Kuntsman
> > Sent: quarta-feira, 3 de Julho de 2002 18:42
> > To: sdl at libsdl.org
> > Subject: Re: [SDL] smpeg/glmovie crawls
> >
> >
> > Sam Lantinga wrote:
> >
> > >>>It almost looks like a thread timing issue, but why should glmovie
> > >>>differ from plaympeg in this regard?
> > >>>
> > >>>
> > >>Are you sure you aren't in software Mesa?
> > >>
> > >>
> > >
> > >It might also be the apparent threading issue with glmovie that was
> > >discussed earlier.  Anybody brave enough to dig into glmovie
> > and smpeg
> > >and figure out the right way to do it? :)
> > >
> > >See ya,
> > >     -Sam Lantinga, Software Engineer, Blizzard Entertainment
> > >
> > >
> >
> > This is a threading issue indeed.
> > In the Delphi port of glMovie, it doesn't even work with
> > threads at all,
> > but when glmpeg_update() is in the main loop it works just fine!
> >
> > It appears that OpenGL already contains lot's of "invalid
> > command" error
> > in it's queue when glmpeg_update() is called from the seperate thread
> > (unlike from the main thread). Maybe OpenGL doesn't really
> > like threads
> > (as it is a state machine), or that SMPEG does some stuff
> > that mess up
> > stuff in OpenGL...
> >
> 
> OpenGL doesn't support threads. You must use a rendering
> context per thread.

There are two issues involved here, which may or may not stem from the
same basic cause:
1. The callback to do the OpenGL drawing doesn't work, and the draw
function has to be in the main thread.
2. With the draw function in the main thread, performance is abysmal.

As far as I know, the only OpenGL functions used are in the draw
function, which is executing at a great rate, taking only 5 ms. 
Therefore the performance problem seems unrelated to OpenGL.  The
problem is that the draw function is repeatedly drawing the same frame,
since the frame is not getting updated - an smpeg problem.

I am willing to accept Sam's invitation, and delve into this.  This
might not achieve the desired result though, because I (a) have no C++
experience (b) have no game programming experience (c) have virtually no
thread programming experience and (d) am over 50.  So don't hold your
breath.  One thing - it is bound to be educational.

Gib




More information about the SDL mailing list