Hi Christian,

>> The OSX port is unmaintained - for years. I lost interest, because I
>> was the only one who cared back then. I had no support and no
>> feedback. That wasn't a motivation. And to be honest I have no clue
>> how this huge mess of APIs in OSX is meant to be used. I think I
>> called once for developers but no answer.
>
> I am sorry I was not around at that time. I would be interested in
> DirectFB on OSX. And yes, I agree that the current state of OSX is  
> very
> strange if you are not aware of the history of different parts of the
> OS. THe result is, that there are totally different APIs for things  
> that
> are essentially the same.

I have the port working again. But it only runs fullscreen and has no  
mouse support.
>
> I see several different concepts of implementing DirectFB on top of  
> OSX,
> but - coming from the Macintosh world - I don't know which way would
> appeal to the typical Linux user of DirectFB.

Sounds good. The problem with Cocoa is, that according to Apple  
documentation the main thread is responsible for processing all  
events. Threads can pass events to the main thread but basicly the  
cocoa main loops has to be in the main thread.
(DirectFB starts a thread for every input device, which basically  
consists of a loop waiting for events and translating the system  
specific events to DirectFB events.)

SDL solved this problem by including SDL_main.h which redefines  main 
() to SDL_main() and by linking to SDL_main.a which includes the main  
which initializes the cocoa stuff.
I wanted to get around this somehow.

The OSX APIs have maybe, I guess about 10 ways to open a window  
(Cocoa, Carbon, Obsolete "Toolbox" Stuff, Sprockets(?), OpenGL,  
GLUT, ...).
That's confusing.

What I did right now is to take old APIs which looked easy to me. And  
I got it running in a few hours back then.

What I use for input is WaitNextEvent(). To switch the mode and get  
the pointer to the framebuffer I use:
CGDisplaySwitchToMode()
CGDisplayCapture()
GDisplayBaseAddress()
CGDisplayBytesPerRow()

Can you suggest a way to open a windows and get a pointer to its  
buffer (doublebuffered if possible)? Without using Cocoa.

Another thing to keep in mind is that the thread which opens the  
window and switches modes, configures graphics stuff etc,  is not the  
thread in which events are processed.

Basically DirectFB, coming from the linux embedded world, has a  
unixish device view on the hardware (framebuffer device (+gfx  
hardware registers), input devices, etc) and was not designed to run  
on other operating systems which have a much more integrated high- 
level view on everything, like Cocoa.  However, of course we can work  
around it somehow...

Andi


_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to