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.
the Fiddler's picture

Can you post the list of supported extensions and the reported version (as returned by GetString)? The errors about the GL version are probably a result of mis-parsing the version string in GLHelper.cs:397 (BuildExtensionList method).

Edit: I'm working on the text issues on Mono (which are blocking the 0.9.2 branch).

kanato's picture

Ok I will do so

JTalton's picture


the Fiddler's picture

The text layout issue seems to be a result of line-ending handling. Kanato, can you please confirm this by opening Examples/Data/Poem.txt, saving it with native line-endings and running the Text example?

I'm trying to find if there is any way to specify the desired line-endings to GDI+.

Inertia's picture

The output from Simple FBO should look like this. It's just a bunch of random triangles with random colors to fill the textures, so your result will vary a bit.

Free Image Hosting at www.ImageShack.us

Not sure about the GLSL Fractal, it might have fallen back to software and you need to wait 5 minutes until the first frame is done. According to the info a quick google search turned up on the graphics chip it supports GL 1.4, so I'm quite impressed it runs at all.

Good to hear that OpenAL is not complaining ^^

Edit: What Mono version is installed? (just to avoid Mono 1.x.x versions to cause any conflicts, there have been some iirc which might explain the problem with the VBO example)

the Fiddler's picture

Update on the text rendering bug: this is actually a mono bug in libgdiplus. Currently looking for workarounds...

kanato's picture

Ok, sorry this took so long to post. It exposed another bug that I need to deal with. Right now the call to CGDisplayAvailableModes to list the graphics modes that the display supports crashes, unless a Windows.Forms.Form is created first. So it looks like there's some initialization that Mono's OSX driver does that I am not doing right now. Will look into it ASAP.

Vendor: Intel Inc.
Renderer: Intel GMA 950 OpenGL Engine
Version: 1.2 APPLE-1.4.56
Extensions: GL_ARB_transpose_matrix GL_ARB_vertex_program GL_ARB_vertex_blend GL_ARB_window_pos GL_ARB_shader_objects GL_ARB_vertex_shader GL_EXT_multi_draw_arrays GL_EXT_clip_volume_hint GL_EXT_rescale_normal GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_gpu_program_parameters GL_APPLE_client_storage GL_APPLE_specular_vector GL_APPLE_transform_hint GL_APPLE_packed_pixels GL_APPLE_fence GL_APPLE_vertex_array_object GL_APPLE_vertex_program_evaluators GL_APPLE_element_array GL_APPLE_flush_render GL_NV_texgen_reflection GL_NV_light_max_exponent GL_IBM_rasterpos_clip GL_SGIS_generate_mipmap GL_ARB_shading_language_100 GL_ARB_texture_border_clamp GL_ARB_multitexture GL_ARB_texture_env_add GL_ARB_texture_cube_map GL_ARB_texture_env_dot3 GL_ARB_texture_env_combine GL_ARB_texture_compression GL_ARB_texture_mirrored_repeat GL_ARB_shadow GL_ARB_depth_texture GL_ARB_fragment_program GL_ARB_fragment_shader GL_ARB_point_sprite GL_ARB_texture_non_power_of_two GL_ARB_vertex_buffer_object GL_ARB_pixel_buffer_object GL_EXT_framebuffer_object GL_EXT_texture_rectangle GL_ARB_texture_rectangle GL_EXT_texture_env_add GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_texture_lod_bias GL_EXT_abgr GL_EXT_bgra GL_EXT_stencil_wrap GL_EXT_texture_filter_anisotropic GL_EXT_separate_specular_color GL_EXT_secondary_color GL_EXT_blend_func_separate GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_blend_equation_separate GL_EXT_packed_depth_stencil GL_APPLE_flush_buffer_range GL_APPLE_ycbcr_422 GL_APPLE_texture_range GL_APPLE_pixel_buffer GL_NV_blend_square GL_ATI_texture_env_combine3 GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod
ShadingLanguageVersion: 1.10

Responses to other things:
I saved and tested the Poems.txt file with three different line endings, dos (\r\n), unix (\n) and mac (\r) as saved in vim. dos and unix give the same result, and the mac setting is even worse as it puts all the text on the same line. None of them give good results.

The FBO results look just like that, with some randomness, so that's good.

Edit: I am using Mono 2.0.1.

the Fiddler's picture

Thanks for the info.

[Version string]
I'm a little confused here... According to apple's docs:
The GL_VERSION string begins with a version number. The version number uses one of these forms:
Vendor-specific information may follow the version number. Its depends on the implementation, but a space always separates the version number and the vendor-specific information.

If I understand this correctly, the string "1.2 APPLE-1.4.56" means support for GL1.2. In that case why do the drivers report "ShadingLanguageVersion: 1.10"? (Is GLSL even supported by the GMA950?)

[Text problems]
The issue here is that Mono's implementation of libgdiplus cannot handle newline characters (relevant discussion). I'll commit a workaround asap.

Inertia's picture


It appears to support GLSL 1.1, when looking at this I cannot get rid of the feeling that this driver is heavily work-in-progress. E.g. GL_EXT_framebuffer_object is GL 1.5, although version reports something different.

kanato's picture

Okay, I think I fixed the issue on calling CG functions. I will do some more thorough testing at this point before I move on to adding new features.