kanato's picture

Mac OS X progress

I have committed preliminary Mac OS support to the branches/macos folder in subversion. I am starting a new topic because the old topic has a bunch of discussion which isn't relevant now.

Things which aren't currently supported:
* Fullscreen
* WinForms integration, including GLControl

Things which are supported:
* Game window creation
* Keyboard and mouse events
* Enumeration of supported display modes

OpenTK Example results on my machine are listed below. My machine is a Mac Mini, with OS X 10.4.11 installed. Graphics card is a built-in Intel GMA 950.

GLSL 1: First shader: Works, but gives message about requiring OpenGL 2.0
GLSL 2: Julia set: Gives message about requiring OpenGL 2.0, then black screen with FPS counter
OpenAL: Playback: Works
OpenGL 5: Vertex arrays: Null reference exception
OpenGL: GLU Tesselation: KeyNotFoundException is thrown
OpenGL: Simple FBO: Works (I am unsure if the resulting image is correct though)
Test: Audio Context Test: No error message.
Test: GameWindow states: Fullscreen min/max not implemented.
Test: Input Logger: Works okay if you click on the "hidden input window" at first. If you click on anything else, it stops working.
Test: Math speed test: KeyNotFoundException is thrown
Test: Resolution changes: Not supported yet.
Tutorial 1: Simple Window: Works
Tutorial 2: Immediate mode: Works
Tutorial 3: Display Lists: Works
Tutorial 3: Fonts: Works
Tutorial 4: Text: Runs, but text layout is messed up, except for FPS counter.
Tutorial 5: Texture mapping: Works
Tutorial 8: VBO's: Works after message about needing OpenGL 1.5.

WinForms 1: Runs, but no colors appear.
WinForms 2: Runs, but no response to input.
WinForms 3: Works
WinForms 4: Runs, but nothing appears in controls.

The KeyNotFoundException appears to be a bug in the CarbonGLNative window, so I will need to examine that more closely. Kamujin, if you can run the examples and let me know if you get the same results that will be helpful.

I've also done some refactoring in the library in how platform specific classes are instantiated.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kanato's picture

Yes, they will need to install mono. There is a Mac OS installer for 2.0.1 on the mono webpage, which should be adequate. I think they shouldn't need to do anything with OpenGL and OpenAL, those will already be there.

kanato's picture

Has anyone else had a chance to test this? I've done a fair amount of testing of OpenTK using AgateLib, and have found no major issues. I would like to know that this code runs on another Macintosh.

JTalton's picture

I'll try to see if this works on my MacBook Pro tonight or tomorrow.

JTalton's picture

Crashes every time on startup.

kanato's picture

Is there any stacktrace or output to the console?

JTalton's picture

OSXExamplesError.png118.8 KB
kanato's picture

Huh, ok interesting. Unfortunately, GameWindow is swallowing the error and disposing the CarbonGLNative object which pointed out a separate bug from the one that is making it crash in the first place. Can you look inside the Examples package (right or control- click->show package contents) and look for the Contents/Resources/debug.log and post that as an attachment?

JTalton's picture

Creating GraphicsContext.
GraphicsMode: Index: 1, Color: 32 (8888), Depth: 16, Stencil: False, Samples: 0, Accum: 0 (0000), Buffers: 2, Stereo: False
IWindowInfo: MacOS.CarbonWindowInfo: Handle 10167120
OpenTK.Platform.MacOS.MacOSException: AGL Error: BadPixelFormat invalid pixel format

debug.log5.58 KB
kanato's picture

Ok, can you give this one a shot? I have included some extra debugging information about the pixel format that is chosen, and also excluded some pixel format flags that aren't necessary. Also, what video hardware do you have and what OS version? All my tests have been on OS X 10.4.11 with an Intel GMA 950.

Examples.app_.tgz1.27 MB
JTalton's picture

Most tests work great! Here are a few errors:

OpenGL 5 : Vertex Arrays (hidden) - Null Reference Exception
OpenGL : GLU Tessalation Test - Opens and then closes (not crash)
WinForms 3 : Extensions - Crash
WinForms 4: Multiple GLControls Test - Controls don't look right

The OpenAL test works fine.

MacBook Pro
OS X 10.5.6
2.16 GHz Intel Core Duo
ATI Radeon x1600 - 256 MB RAM

Woot! Can't wait to see if I can get Golem3D running on it. :)