PDA

View Full Version : I'm working on Mac OS. Hit a problem, I'd be happy to code a fix, but one question



Nightwind0
03-12-2014, 06:03 AM
Hi. I'm porting my game to Mac OS X. I know ClanLib only partially supports Mac OSX right now, but I'd be happy to try to help to get it into a state where it at least runs my game, haha.
I'm getting a crash in GL3GraphicContextProvider::reset_frame_buffer(), on glBindFramebuffer(GL_FRAMEBUFFER, 0);.

There is a comment above that line:
// To do: move this to OpenGLWindowProvider abstraction (some targets doesn't have a default frame buffer)

I'd be happy to do that and submit a patch. However, I'm not exactly sure what needs to be done. Do I need to add a "reset" to the OpenGLWindowProvider base class or something? Is there a design in mind for this?

Also it looks like there is some Font work needed on the Mac side. I will try to fill out more of the Mac code (Similar to some of the stuff I recently submitted that was patched into 3.0.1) and submit a patch for that when I have something.
And of course anything else I run into as I work on my Mac port. :)

rombust
03-12-2014, 09:16 PM
I can't answer your question. I've never used a Mac :)

Also see https://github.com/sphair/ClanLib/pull/5 ... for other OSX issues

iirc from talk from a long time ago. it's the same as the answer given in this stackoverflow.com question http://stackoverflow.com/questions/19662413/opengl-es-2-0-and-default-framebuffer-in-ios

Nightwind0
03-12-2014, 09:37 PM
I can't answer your question. I've never used a Mac :)

Also see https://github.com/sphair/ClanLib/pull/5 ... for other OSX issues

iirc from talk from a long time ago. it's the same as the answer given in this stackoverflow.com question http://stackoverflow.com/questions/19662413/opengl-es-2-0-and-default-framebuffer-in-ios

Thanks. I'll see what I can get working and submit any patches I come up with.

- - - Updated - - -


I can't answer your question. I've never used a Mac :)

Also see https://github.com/sphair/ClanLib/pull/5 ... for other OSX issues

iirc from talk from a long time ago. it's the same as the answer given in this stackoverflow.com question http://stackoverflow.com/questions/19662413/opengl-es-2-0-and-default-framebuffer-in-ios

By the way, do you know who on the forums did what Mac stuff there is?

rombust
03-13-2014, 02:36 PM
I don't know. Somebody else might know.

As far as I know, nobody is currently working on ClanLib Mac OS.

Edwardson97
03-13-2014, 02:37 PM
I can't answer your question. I've never used a Mac :)

Also see https://github.com/sphair/ClanLib/pull/5 ... for other OSX issues

iirc from talk from a long time ago. it's the same as the answer given in this stackoverflow.com question http://stackoverflow.com/questions/19662413/opengl-es-2-0-and-default-framebuffer-in-ios

2007 really? Also good luck on beating Seth on his post!

Judas
03-14-2014, 04:23 AM
The Mac port for ClanLib 3 is incomplete, as you've noticed.

Part of the code originates from an experimental iOS port of ClanLib that I did and the "no default frame buffer" comment applies to OpenGL ES on iOS. I'm not sure if it applies to OS X as well - I can't really remember. The font code is also from that iOS port and has some problems with baseline alignment. Your crash is more likely that the OpenGL binding failed somehow and glBindFramebuffer is a null pointer. Why that would suddenly fail I do not now - last time I did some testing the Mac version did manage to display something.

There's mainly two problems with finishing the port:

1) ClanLib is rather large and lots of functionality like basic window geometry management and input handling is still not fully ported. Doing it alone is a lot of work!

2) Cocoa, and in particular Cocoa Touch, are not very compatible with the way ClanLib wants to run the main run loop. ClanLib assumes it can poll UI messages (KeepAlive::process), while the default model of Cocoa is to call NSApplicationMain and then that function never returns until the program exits. This can be workarounded for Cocoa, but afair there are no official ways to do it with Cocoa Touch's UIApplicationMain function. How other polling based systems get away with doing it anyway I'm not sure - I suspect some nasty hack.