At 06:30 AM 5/25/2002 +1000, you wrote:
thanks Bill,
Yes, but how to position the inset surface within the main
surface?
I did this with a SDL_Rect, you just blit the smpeg surface onto your main
surface .
if(SDL_mutexP(smpeg_holder_lock) == -1) return 0;
if (top)
SDL_BlitSurface(sdl_smpeg_holder,NULL,sdl_screen,&Screen_smpeg_Target);
else
SDL_BlitSurface(sdl_smpeg_holder,NULL,sdl_screen,&Screen_smpeg_Target_bottom);
if(SDL_mutexV(smpeg_holder_lock) == -1) return -1;
you use a mutex to keep the threads happy
also for the initialization i did this
sdl_smpeg_target =
SDL_CreateRGBSurface(SDL_SWSURFACE,100,100,16,63488,2016,31,0);
//created as a software surface to avoid a
potential crash
SDL_DisplayFormat(sdl_smpeg_target);
sdl_smpeg_holder =
SDL_CreateRGBSurface(SDL_SWSURFACE,100,100,16,63488,2016,31,0);
SDL_DisplayFormat(sdl_smpeg_holder);
mpeg = SMPEG_new("c:\\tmp\\random2.mpeg",&info,1);
SMPEG_enableaudio(mpeg, 1);
SMPEG_enablevideo(mpeg, 1);
SMPEG_setvolume(mpeg, 100);
smpeg_mutex_lock = SDL_CreateMutex();// keep threads happy
smpeg_holder_lock = SDL_CreateMutex();
SMPEG_setdisplay(mpeg,sdl_smpeg_target ,NULL/*
smpeg_mutex_lock*/, update_smpeg);
SMPEG_scaleXY(mpeg, sdl_smpeg_target->w, sdl_smpeg_target->h);
SMPEG_loop(mpeg, 1);
SMPEG_play(mpeg);
Shane>On Sat, 2002-05-25 at 03:56, nbs wrote:
On Fri, May 24, 2002 at 10:34:00PM +1000, Richard Keech wrote:
hi all,
I’m seeking advice and/or code examples of how to embed an SMPEG
screen within a larger SDL screen. All SMPEG examples I’ve seen
have the SMPEG screen being the entire window.
Just make a new surface, and point SMPEG to it, rather than to your
window’s surface.
I did this when I was working on VidSlide (unfinished title :^/ ).
It allowed me to turn a video file into a puzzle.
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl