[MPlayer-G2-dev] specifing visual for X11 window

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Feb 29 23:06:06 CET 2004


Hello,

>>I've been working on an OpenGL vo module for G2.
>>What I need is a way to make sure the window that is passed to the 
>>config function is usable for OpenGL.
> 
> Is there any case where the normal native visual type for the display
> wouldn't be the best? IMO the X code should always use this type of
> visual anyway. And sometimes, the window will be created well before
> the vo is known (think of playing in an existing window) so I think
> the vo driver just has to fail if it can't use the visual given to
> it...

I don't really know. I just tried it the way the G1 vo's do it, but the 
visual returned by glXMatchVisual didn't work with the one the window had...

>>The best idea I had so far was adding a XVisualInfo* part to 
>>vo_instance_t and if it's set the window will be created using this visual.
>>Would this be acceptable / do you have any other ideas (except creating 
>>the window in the vo module, this would give the same mess as in G1).
> 
> No, X-specific stuff is definitely not acceptable in the generic vo
> api... Some of us will even be building --without-x! Of course you can
> use #ifdefs but that's a mess, especially if we want vo modules to be
> dynamic loaded plugins (in which case the structs need to be
> binary-compatible).

I though/feared so. But I found a way around the problem. Do you know a 
way to find out which visual a window uses?
I currently use
     XMatchVisualInfo(mDisplay, mScreen, depth, TrueColor, &vinfo);
(copyed from x11_helper.c, create_window function), but that sure isn't 
really good...
In case someone's interested I attached this vo (but please consider it 
pre-alpha ;-) )

Greetings,
Reimar Döffinger
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vo_gl.c
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-g2-dev/attachments/20040229/bddbf7ac/attachment.asc>


More information about the MPlayer-G2-dev mailing list