discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Painting gnustep-gui into OpenGL


From: Ivan Vučica
Subject: Re: Painting gnustep-gui into OpenGL
Date: Wed, 27 Apr 2011 18:03:17 +0200



On Wed, Apr 27, 2011 at 17:09, David Chisnall <address@hidden> wrote:
I'm not sure - I always use GNUstep with a window manager.

I just tested on Linux, no borders here. Oh well, painting windows isn't that hard once other parts of view hierarchy work :)
 


There's some sample code for this in my Cocoa Programming book I think - the examples can be downloaded from the book's page.

I'll take a look at them.

I'll also take a look at the book :-)

 

>
> Maybe! I was rather looking for something that paints into framebuffer (without X11) that I could easily reuse to paint in-game, but maybe things could easily be patched to render views into textures.

That's what NSImage lockFocus is for.  Call this, and the drawing target becomes that NSImage instance.  Then you can just get the data from it.

That sounds like exactly what I need! Thanks!
 

> I am not familiar with Cairo, however, and I did not take a look at Opal, so I'm not sure how much I could help.
>
> Is there some documentation/diagrams I could take a look to quickly understand what piece of the puzzle does what, apart from studying the code (which may generate more questions than answers)? For example, I am somewhat confused by what Opal exactly is. :-)

Opal is an implementation of CoreGraphics, which (on OS X) sits between AppKit and the window server.  You don't really have to understand any of that for CoreAnimation though - just provide a mechanism for redirecting drawing to an OpenGL texture and animating a rectangle that this texture is attached to.

This sounds to me like it could be a job for a category that would provide a texture object, something like a GSOpalGLTextureObject. That would require a GL context -- I suppose that would have to be hacked into NSWindow somehow. This is the place where I have no idea how things work: but perhaps base view of an NSWindow can be replaced by an NSOpenGLView? 

--
Ivan Vučica
address@hidden
Coming soon for iPhone, Zombie Ball - http://j.mp/zbivmail



reply via email to

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