[Top][All Lists]

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

NSOpenGL* and etc

From: Frederic De Jaeger
Subject: NSOpenGL* and etc
Date: 04 Nov 2002 21:02:53 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

This is a repost of a mail I sent to gnustep-dev and gnu3dkit-dev.

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


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
- [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.
- NSOpenGLView (should be easy, now)

and a lot of other things.

Here is the patch, if someone wants to play with.
It is very unstable.


There is no instruction.  
For the backend, you need to regenerate configure with autoconf, and
config.h.in with autoheader.


        Frederic De Jaeger

reply via email to

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