C # mono p / invoke error
I recently tried using p / invoke in mono (.NET platform for Linux) to write a simple OpenGL application to see how it works in C # (I've already done this successfully on windows). I've heard about the structure of tao, but I don't want it to be for a simple "hello world" like program.
I was just stuck at the beginning. I p / called some GL functions to see if they work. I immediately called glClearColor and glClear to see if it raises glGetError or not (due to opengl not being initialized at all at this point).
Instead of calling the function, it just flushes and unloads the next stack trace and another debuginfo. No exception was thrown.
StackTrace:
at (wrapper managed-to-native) Calmarius.OGL.OpenGLLibrary.glClearColor (single,single,single,single) <0x00004>
at (wrapper managed-to-native) Calmarius.OGL.OpenGLLibrary.glClearColor (single,single,single,single) <0xffffffff>
at Calmarius.RTS.GameForm.OnPaint (System.Windows.Forms.PaintEventArgs) [0x00000] in /home/calmarius/Development/csharp/RTS/RTS/Form1.cs:60
at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message&) <0x000b0>
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&) <0x001e2>
at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message&) <0x0000d>
at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message&) <0x00054>
at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message&) <0x001da>
at ControlWindowTarget.OnMessage (System.Windows.Forms.Message&) <0x00014>
at ControlNativeWindow.WndProc (System.Windows.Forms.Message&) <0x00022>
at System.Windows.Forms.NativeWindow.WndProc (intptr,System.Windows.Forms.Msg,intptr,intptr) <0x001b7>
at System.Windows.Forms.XplatUIX11.DispatchMessage (System.Windows.Forms.MSG&) <0x00016>
at System.Windows.Forms.XplatUI.DispatchMessage (System.Windows.Forms.MSG&) <0x00015>
at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) <0x00997>
at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext) <0x0006a>
at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) <0x00025>
at Calmarius.RTS.Program.Main () [0x0000b] in /home/calmarius/Development/csharp/RTS/RTS/Program.cs:19
at (wrapper runtime-invoke) System.Object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>
Signature for glClearColor:
//gllibname="opengl32.dll" --> mapped to libGL.so
[DllImport(gllibname)]
public static extern void glClearColor(float red, float green, float blue, float alpha);
Specification C:
void glClearColor( GLclampf red,GLclampf green,GLclampf blue,GLclampf alpha );
GLclampf is a float as I saw its declaration in the header.
a source to share