[SDL] Video with SDL/OpenGL

Gib Bogle bogle at ihug.co.nz
Tue Jul 2 14:33:01 PDT 2002


> Message: 35
> Date: Tue, 02 Jul 2002 16:44:26 +0100
> From: Dominique Louis <Dominique at SavageSoftware.com.au>
> Organization: Savage Software Solutions
> To: sdl at libsdl.org
> Subject: Re: [SDL] Video with SDL/OpenGL
> Reply-To: sdl at libsdl.org
> 
> Hi Gib,
>    This sounds like a similar problem to I was having with porting the
> GLMovie demo to Pascal.
> 
> Try moving the function call "glmpeg_update" so that it is the last
> thing called in side the main loop ( just after the SDL_Delay call ).
> ie something like this...
> 
>    while( SMPEG_status( mpeg ) == SMPEG_PLAYING )
>    {
>      SDL_Event event;
> 
>      while ( SDL_PollEvent(&event) )
>      {
>        switch (event.type)
>        {
>          case SDL_KEYDOWN:
>                  if ( event.key.keysym.sym == SDLK_ESCAPE ) {
>                      SMPEG_stop( mpeg );
>                  }
>                  break;
>          case SDL_MOUSEBUTTONDOWN:
>          case SDL_QUIT:
>                  SMPEG_stop( mpeg );
>                  break;
>        }
>      }
>      SDL_Delay(100);
>      glmovie_quit( surface, 0, 0, 0, 0 ); // <--- Add this call here to
> see what happens.
>    }
> 
> When I did this the video plays. Does it does so for you?

(Of course you meant to add glmpeg_update(), not glmovie_quit()).  Yes,
this change makes it play.  But it is excruciatingly slow - about 1
fps.  So now one puzzle is replaced by another.  Just when I'd posted a
message about the speed of Linux/SDL/OpenGL, I now find something that
is unusably sluggish.  plaympeg plays the video at its original 352x240
resolution, while glmovie is stretching it onto a 640x480 res screen.  I
really need to find out what is slowing glmovie down so much, because in
my application I will be playing video onto arbitrarily oriented OpenGL
surfaces, i.e. I will not be able to map video pixels 1-to-1 to screen
pixels.

Gib




More information about the SDL mailing list