DDraw, wined3d (d3d8, d3d9) and OpenGL32 in Mac OSX + stack fudging -- x86 only

Chris Niederauer ccn at ccntech.com
Sun Apr 30 16:56:03 CDT 2006


I didn't work on this patch, but I can add some answers to Mike's  
questions...

On Sun, 30 Apr 2006 05:32:49 -0700, Mike Hearn wrote:
> On Sat, 29 Apr 2006 14:46:33 -0700, Nick Burns wrote:
>> OpenGL dynamic loading
>>     -- Mac OSX does not need to dlsym every ogl entry point -- it  
>> handles
>>        that for you...
>
> Hmm, well so do Windows and Linux ;) I think it's done that way  
> because
> some of the GL functions are introduced in later versions of OpenGL  
> so we
> need to test for them at runtime.

We can at least avoid any direct dlsym references on the Mac and  
simply use the glXGetProcAddress procedure.  Also, for anything that  
is added to the OpenGL stack post 10.4.4 or whatever the first intel  
version of OS X was, it could avoid a huge amount of  
glXGetProcAddress's for the included opengl calls like glBegin, etc.   
Was there more to this you wanted to add, Nick?


>> Stack fudging
>>     -- mac requires 16 byte aligned stack windows does not
>>     -- this leads to illegal instructions (aligned wrongly)
>
> This is an Intel Mac right?! Intel chips have never required  
> alignment as
> far as I know, though it can help performance.

This is not a requirement by the processor, per se, but by the OS X  
ABI.  When a windows function attempts to call into an OS X function,  
the ABI must be properly set up in order to work with the OS X ABI  
compliant code.  16 byte alignment is one requirement of OS X's ABI:
<http://developer.apple.com/documentation/DeveloperTools/Conceptual/ 
LowLevelABI/Articles/IA32.html>


>> GLX Root Window
>>     -- Wine uses the fact that a root window exists in x11 in many
>>        places...
>>     -- But no one wants to run the x11 root window on their mac  
>> (what the
>>        b&w checkerz are ugly?)
>
> What stops you fixing the Mac X server to, well, not suck? I don't  
> see why
> you need to hack Wine to fix this.

On systems that already have roots like the Window Server on OS X and  
the GDI root on Windows, your system then looks like Linux.  This  
works fine and all, but it makes it so that Mac OS X and Windows apps  
don't show up side by side with the linux apps.  In the end, I'm sure  
it would be most desirable to avoid X11 on the Mac completely because  
it's an optional install (albeit easily installable after the fact)  
and it just doesn't have an OS X feel to it, which is what people  
would desire who are running OS X.

Chris



More information about the wine-devel mailing list