Overlay problems with gtk-sdl vanilla way

I think I found a good way to use SDL in GTK for simple blit operations and
multiple display
ex (GTK1.2) :

GdkVisual *theVisual=gdk_visual_get_best();
GdkGC *TheGC = gdk_gc_new(Dra_DrawingAreaForSDL->window);

GdkImage *ThePixbuf=gdk_image_new(GDK_IMAGE_FASTEST,theVisual,
SDL_Surface *Surface=SDL_CreateRGBSurface(SDL_HWSURFACE, 640, 480, 32
, Rmask, Gmask, Bmask, Amask);
SDL_Surface Surface2=SDL_CreateRGBSurfaceFrom(ThePixbuf->mem, 640,
480, 32 , 640
4, Rmask, Gmask, Bmask, Amask);


 SDL_BlitSurface(Surface, NULL, Surface2, NULL);
 gdk_draw_image(Dra_DrawingAreaForSDL->window, TheGC,ThePixbuf , 


this way, we can have multiple SDL display coz we are not using the Surface
from SetVideoMode
the speed is as good than SDL (even better with my little benchs)
the problem is I have to use YUV overlay too and I think is really not made
to be used without SetVideoMode

if we take the previous code and add the following

char CharForEnvVar[64]; //Should be set initialized before use: oupsiS
sprintf(CharForEnvVar, “SDL_WINDOWID=0x%lx”,
GDK_WINDOW_XWINDOW(GTK_WIDGET(Dra_DrawingAreaForSDL)->window ));

if( SDL_Init(SDL_INIT_VIDEO) < 0 )
         cout << "doh!\n";

SDL_Overlay *Overlay=SDL_CreateYUVOverlay( IMGW,IMGH, SDL_UYVY_OVERLAY, 

SDL_DisplayYUVOverlay(Overlay, &OverlayRect);

we run soon in a wall because even if hardware YUV dont care about the
display surface, XvShmPutImage in X11_DisplayYUVOverlay need a window and a
GC who aren’t set yet because SetVideoMode have not been called

I added into X11_DisplayYUVOverlay:

Window theWin = strtol(getenv(“SDL_WINDOWID”), NULL, 0);
GC TheGc=XCreateGC(GFX_Display,theWin, 0, NULL);
SDL_NAME(XvShmPutImage)(GFX_Display, hwdata->port, theWin,TheGc ,
hwdata->image, 0, 0, overlay->w, overlay->h,
dstrect->x, dstrect->y, dstrect->w, dstrect->h, False);

with this, I can have yuv Xv into GTK app while having other BGR display in
same time
(only one display can have overlay but anyway I have only one backend scaler

now, I know it’s REALLY ugly for the YUV stuff so I wanted to know if I
would take the time to write a (nicer than this) patch, will it be
integrated “soon” ?
or any way to change where SDL_windowid and SDL_GC is set?
like a plublic fct or a way to get acces to current_video informations?

I am not interedted in gdk-pixbuf coz is dam slow, think coz it only take
RGB for righ now and it has to convert to BGR (FPS are similar to SDL when
using RGB mask into SDL_CreateRGBSurface)

my stage at matrox is soon over (2 weeks) and it would be great if I left
the place with good promise to my successor, so if anyone got a idea, would
be really great!!!


julien vary_________________________________________________________________
MSN Messenger : discutez en direct avec vos amis !