seacloud9's picture

Simple ES 2.0 crash on OSX 10.7.5

Project:The Open Toolkit library
Version:1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (invalid)
Description

I have tried to use both the source forge build of OpenTK but I am able to get more of the demos to run using the below build.
https://github.com/andykorth/opentk/issues/23
I would like to get simple es exampel to run

That way I might be able to eventually run ThreeSharp -> https://github.com/mono-soc-2013/ThreeSharp

error message: (from the openTK example)

Disposing window 1773659856.
Launching sample: "Simple ES 2.0"

Size: 2304
System:
Darwin
11.4.2
Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64
x86_64
Detected configuration: MacOS / Mono
Using HIDInput.
Keyboard device 1825924208 discovered, sender is 1825918848
Mouse device 1825925536 discovered, sender is 1825918848
Mouse device 1825927216 discovered, sender is 1825918848
Keyboard device 1825932000 discovered, sender is 1825918848
Mouse device 1825928688 discovered, sender is 1825918848
CoreGraphics reported 2 display(s).
Display 0 is at 2560x1440
Supports 64 display modes.
Display 0 bounds: {X=0,Y=0,Width=2560,Height=1440}
Display 1 is at 1680x1050
Supports 42 display modes.
Display 1 bounds: {X=2560,Y=390,Width=1680,Height=1050}
Creating default GraphicsMode (32, 16, 0, 0, 0, 2, False).
Bits per pixel: 32
Depth: 16
Running on Mac OS X 10.7.5.
Setting process to be foreground application.
Creating window...
Created Window: 7224592
Setting window title: 7224592, CFstring : 6653424, Text : OpenTK Window
Created window.
Titlebar size: Rect: [880, 398, 800, 22]
Attached window events.
Creating GraphicsContext.
Bits per pixel: 16
Depth: 16
GraphicsMode: Index: 1825985720, Color: 32 (8888), Depth: 16, Stencil: 0, Samples: 0, Accum: 0 (0000), Buffers: 2, Stereo: False
IWindowInfo: MacOS.CarbonWindowInfo: Handle 7224592
GraphicsContextFlags: Embedded
Requested version: 2.0
System.PlatformNotSupportedException: Please, refer to http://www.opentk.com for more information.
at OpenTK.Platform.Factory+UnsupportedPlatform.CreateGLContext (OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, Boolean directRendering, Int32 major, Int32 minor, GraphicsContextFlags flags) [0x00006] in /Users/brendon.smith/Downloads/opentk-master/Source/OpenTK/Platform/Factory.cs:154
at OpenTK.Graphics.GraphicsContext..ctor (OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, Int32 major, Int32 minor, GraphicsContextFlags flags) [0x0014b] in /Users/brendon.smith/Downloads/opentk-master/Source/OpenTK/Graphics/GraphicsContext.cs:134
at OpenTK.GameWindow..ctor (Int32 width, Int32 height, OpenTK.Graphics.GraphicsMode mode, System.String title, GameWindowFlags options, OpenTK.DisplayDevice device, Int32 major, Int32 minor, GraphicsContextFlags flags, IGraphicsContext sharedContext) [0x00138] in /Users/brendon.smith/Downloads/opentk-master/Source/OpenTK/GameWindow.cs:208
Disposing of CarbonGLNative window.
Disposing window 7224592.
System.PlatformNotSupportedException: Please, refer to http://www.opentk.com for more information.
at OpenTK.Platform.Factory+UnsupportedPlatform.CreateGLContext (OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, Boolean directRendering, Int32 major, Int32 minor, GraphicsContextFlags flags) [0x00006] in /Users/brendon.smith/Downloads/opentk-master/Source/OpenTK/Platform/Factory.cs:154
at OpenTK.Graphics.GraphicsContext..ctor (OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, Int32 major, Int32 minor, GraphicsContextFlags flags) [0x0014b] in /Users/brendon.smith/Downloads/opentk-master/Source/OpenTK/Graphics/GraphicsContext.cs:134
at OpenTK.GameWindow..ctor (Int32 width, Int32 height, OpenTK.Graphics.GraphicsMode mode, System.String title, GameWindowFlags options, OpenTK.DisplayDevice device, Int32 major, Int32 minor, GraphicsContextFlags flags, IGraphicsContext sharedContext) [0x00138] in /Users/brendon.smith/Downloads/opentk-master/Source/OpenTK/GameWindow.cs:208
System.NullReferenceException: Object reference not set to an instance of an object
at OpenTK.Platform.MacOS.HIDInput.DeviceValueReceived (IntPtr context, IntPtr res, IntPtr sender, IntPtr val) [0x00001] in /Users/brendon.smith/Downloads/opentk-master/Source/OpenTK/Platform/MacOS/HIDInput.cs:203
at (wrapper managed-to-native) System.Windows.Forms.XplatUICarbon:ReceiveNextEvent (uint,intptr,double,bool,intptr&)
at System.Windows.Forms.XplatUICarbon.PeekMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax, UInt32 flags) [0x00017] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs:1607
at System.Windows.Forms.XplatUICarbon.DoEvents () [0x00025] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs:1270
at System.Windows.Forms.XplatUI.DoEvents () [0x00000] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs:610
at System.Windows.Forms.Application.DoEvents () [0x00000] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:481
at Examples.ExampleBrowser.RunSample (System.Windows.Forms.Control parent, Examples.ExampleInfo e) [0x0010e] in /Users/brendon.smith/Downloads/opentk-master/Source/Examples/ExampleBrowser.cs:392
at Examples.ExampleBrowser.ActivateNode (System.Windows.Forms.TreeNode node) [0x0006e] in /Users/brendon.smith/Downloads/opentk-master/Source/Examples/ExampleBrowser.cs:333
at Examples.ExampleBrowser.treeViewSamples_NodeMouseDoubleClick (System.Object sender, System.Windows.Forms.TreeNodeMouseClickEventArgs e) [0x00019] in /Users/brendon.smith/Downloads/opentk-master/Source/Examples/ExampleBrowser.cs:171
at System.Windows.Forms.TreeView.OnNodeMouseDoubleClick (System.Windows.Forms.TreeNodeMouseClickEventArgs e) [0x0001c] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs:1015
at System.Windows.Forms.TreeView.MouseUpHandler (System.Object sender, System.Windows.Forms.MouseEventArgs e) [0x0002b] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs:2049
at System.Windows.Forms.Control.OnMouseUp (System.Windows.Forms.MouseEventArgs e) [0x0001c] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:6050
at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x0007e] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5279
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x0016f] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5020
at System.Windows.Forms.TreeView.WndProc (System.Windows.Forms.Message& m) [0x00069] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs:1129
at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:228
at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:209
at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00085] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:240


Comments

Comment viewing options

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

#1

Status:open» closed (invalid)

As far as I know, OpenGL ES is not supported on Mac OS X. A quick search confirms that there is no OpenGLES.Framework available under System/Libary/Frameworks.

Starting with OpenGL 4, there is a ARB_ES2_compatibility extension that should help here. Without this, the only way to run OpenGL ES would be to use an emulator or port the code to desktop OpenGL. Without support by the operating system, there is nothing OpenTK can do about this...

If you test using an OpenGL ES emulator, please share your results!

the Fiddler's picture

#2

Status:closed (invalid)» need info

I have committed additional code into the es branch that might help get this running.

Try creating a regular graphics context (use GraphicsContextFlags.Default instead of GraphicsContextFlags.Embedded) and see if the code you are using runs. There is a good chance that Mac OS X 10.9 will run OpenGL|ES code out of the box using this trick (no need for emulators!)

the Fiddler's picture

#3

On Mac OS X 10.9, on a rMBP with the ARB_ES2_compatibility extension is now supported. This allows you to run ES code via a regular desktop OpenGL context.

From a quick test this appears to be working as expected.

the Fiddler's picture

#4

Status:need info» closed (invalid)

Mac OS X 10.7 does not support OpenGL ES. You need at least 10.9 for this.

Please open an issue at https://github.com/opentk/opentk/issues if OpenGL ES fails to work on Mac OS X 10.9+