[MonoDevelop] OpenGL 3.2 and GLSL 1.5 on Lion 10.7.2 using Monomac

Eric Hosick erichosick at interfacevision.com
Tue Oct 18 15:37:20 EDT 2011

Hi All,

I'm not sure where to talk about this or if I should fork or what but here
we go.

When running in Lion 10.7.2, the following call:

string version = GL.GetString(StringName.Version);

returned "*2.1 ATI-7.12.9*"

With a few additions to Monomac I was able to get the following:

string version = GL.GetString(StringName.Version); // version = *3.2

Ok. So the file NSOpenGL.h had the following:


/* NSOpenGLPFAOpenGLProfile values */

enum {

NSOpenGLProfileVersionLegacy    = 0x1000,   /* choose a Legacy/Pre-OpenGL
3.0 Implementation */

NSOpenGLProfileVersion3_2Core   = 0x3200    /* choose an OpenGL 3.2 Core
Implementation      */



and an addition to NSOpenGLPixelFormat of:


 NSOpenGLPFAOpenGLProfile      =  99, /* specify an OpenGL Profile to use

I edited src/AppKit/Enums.cs adding the following few things:

public enum NSOpenGLPixelFormatAttribute {


OpenGLProfile = 99,



 public enum NSOpenGLPFAOpenGLProfile {

 VersionLegacy    = 0x1000, // choose a Legacy/Pre-OpenGL 3.0 Implementation

 Version3_2Core   = 0x3200 // choose an OpenGL 3.2 Core Implementatio


Made monomac and tested it with NeHeLesson7 (directly referencing to the
monomac.dll) and changing the following in MyOpenGLView.InitGL():


  var attribs = new object[] { NSOpenGLPixelFormatAttribute.Accelerated,
NSOpenGLPixelFormatAttribute.ColorSize, 24,
NSOpenGLPixelFormatAttribute.DepthSize, 16 };


var attribs = new object[] { NSOpenGLPixelFormatAttribute.OpenGLProfile,
NSOpenGLPixelFormatAttribute.DepthSize, 16 };

Of course, a lot of stuff in OpenGL 3.2 is deprecated so if you do this most
demos will not work. But it does let you use 1.5 of GLSL!

If there is anything I can do to help put this into the MonoMac base, please
let me know.

If I overlooked something, please let me know.

Take care,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20111019/0b8f528e/attachment.html 

More information about the Monodevelop-list mailing list