Hi all,
i’m implementing an opengl application on c#. I wrap opengl functions like in TAO/OpenTK framework, i.e., for context/device creation i’m using functions like wglCreateContext, wglGetCurrentDC, SetPixelFormat, SwapBuffers, ChoosePixelFormat, GetDC, among others with direct dll imports DllImport(“dll.dll”…) from system’s user32.dll, gdi32.dll, kernel32.dll and opengl32.dll. Similarly I wrap opengl functions i need directly with [DllImport(“opengl32.dll”)]. So far it works just fine, nothing to complain about.
However, i got to add an additional dll (let’s call it lao.dll) to my c# application (thus importing lao.dll’s external functions with [DllImport(“lao.dll”)]). Inside of lao.dll i have some calls to opengl functions, like glGetFloatv, glBindBuffer, etc. To build this dll i’m using glew.h, glew32.lib. (In the c# application runtime i add glew32.dll to its path). Well, thing is that my application stop running whenever i call a funtion from lao.dll that uses opengl functions. There’s no errors, no crashes, it just doesn’t do anything! (i still can click buttons, resize window and so on.) In the debug mode, it’s the same, no errors but i can’t go further on the execution. I was expecting to be able to do opengl manipulation on this dll but it seems either that i’m doing things in a wrong way or that it’s just impossible.
Have you folks any suggestion on how to get it working?
thx, lao