[SDL] Video with SDL/OpenGL

Dominique Louis Dominique at SavageSoftware.com.au
Tue Jul 2 08:57:02 PDT 2002


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?


L8R,


Dominique Louis.

Gib Bogle wrote:
>>Message: 41
>>Date: Sat, 29 Jun 2002 03:42:42 -0400 (EDT)
>>From: "Ryan C. Gordon" <icculus at clutteredmind.org>
>>To: "sdl at libsdl.org" <sdl at libsdl.org>
>>Subject: Re: [SDL] Video with SDL/OpenGL
>>Reply-To: sdl at libsdl.org
>>
>>
>>>if not, then consider using MPEG content which, I think,
>>>is more desirable because the format is less platform-specific
>>>and is well supported in SGL with the smpeg library.
>>
>>If nothing else, look at the glmovie.c source in smpeg to see how to get
>>from a YUV overlay to a GL surface.
> 
> 
> Ryan, I have installed smpeg-0.4.4 and studied the test program
> glmovie.c.  But when I run this program I get very strange behaviour. 
> I'm hoping that someone here can explain what is happening.
> 
> When I play an MPEG-1 file (./glmovie test.mpg) I do not see anything
> related to the content in this mpg file.  Instead I see a fixed image,
> which happens to correspond to the bitmap of the NeHe logo, such as is
> used in lesson06, which I was running yesterday.  In other words glmovie
> is somehow locating the bitmap, which apparently still resides in RAM
> somewhere, probably on the graphics card.  It is opening the mpg file
> and returning correct mpeg_info.width and .height, but displaying
> something else.  BTW, plaympeg plays the file OK.
> 
> My machine is a P4 with a GeForce4 Ti4400 graphics card.
> 
> Before getting stuck into trying to debug this, since I'm not familiar
> yet with OpenGL I thought I'd check here to see if this behaviour has
> been seen before.
> 
> thanks
> Gib
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
> 
> 


-- 
http://www.DelphiGamer.com := for all your Object Pascal game 
development needs;
http://www.delphi-jedi.org/Jedi:TEAM_SDL_HOME := Home of JEDI-SDL; 
Cross-platform game development with Pascal, has never been easier.






More information about the SDL mailing list