gnu3dkit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnu3dkit-dev] NSOpenGL and etc.


From: Frederic De Jaeger
Subject: [Gnu3dkit-dev] NSOpenGL and etc.
Date: 04 Nov 2002 01:56:21 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Hi lists

I have started implementating NSOpenGLContext and NSOpenGLPixelFormat
for the X backend using glx.  Here is the first screen shot.

http://thoran.free.fr/screen1.png

I will release a patch soon (I just need to clean it, document it...)
on the same place (But I will of course annonce it here).

Some details:
I drop the idea of the GSXView.  It is a bad idea in fact.  Brent
Gulanowski pointed me that a GLContext  can be attached to any view
and this does not play well with this approach.

I wrote a class in the backend that can attach an X window to any view
that belongs to an NSWindow.  The new window is a direct descendant of
the X window containing the NSWindow.  

This class may be used for other purposes than implementing openGL.

With this, it's easy to attach a glx context to such window.
What I observed, while looking at the spec, was that the NSOpenGL API
is very close to GLX 1.3.  Even the tokens have the same numerical values.
We have the following correspondences:
 NSOpenGLPixelFormat  <--->  GLXFBConfig
 NSOpenGLContext <---> GLXContext
and they are functionally equivalent (almost)

I write, for the gui, two classes that implement the visible part of
the API (NSOpenGLContext and NSOpenGLPixelFormat).  When they are sent 
allocWithZone: they ask the current GSDisplayServer for a concrete
implementation of themselves and forward the invocation to it.

Because my drivers (NVidia, closed source) are completely buggy (the X
server crashes)  I could not write a clean implementation using the
nice GLX 1.3 API.  Now, it's an ugly mix between GLX 1.0 and GLX 1.3.

current status:
- The only things that is working is a GL context attached to a mapped
NSView (the view really needs to belong to a view hierarchy that is
attached to an NSWindow (and this window must be mapped on the
screen))
- [NSOpenGLPixelFormat initWithAttributes] just considers the most
important attributes (the one I fully understand)


things that need to be implemented:
- fullscreen and offscreen gl context
- sharing of textures and display list name spaces.
- methods related to NSOpenGLContextParameter.
- case when there are several virtual screens
- multithread.

and a lot of other things.


Cheers,

        Frederic De Jaeger




reply via email to

[Prev in Thread] Current Thread [Next in Thread]