namespace ManGLe {
public sealed class gl {
#if BUILD_WITH_GL
public const string dll = "opengl32.dll";
[DllImport(dll, EntryPoint = "glAlphaFunc")]
public static extern void AlphaFunc(glFunction Function, float Reference);
[DllImport(dll, EntryPoint = "glBegin")]
public static extern void Begin(glDrawMode Mode);
[DllImport(dll, EntryPoint = "glBitmap")]
public static extern void Bitmap(int Width, int Height, float OriginX, float OriginY, float OffsetX, float OffsetY, [In] byte[] Bitmap);
// ... etc ...
[.net] Problem with home-made OpenGL wrapper.
Hello,
I'm working on an OpenGL wrapper, yes I'm aware of the ones out there but I'm doing this to learn.
Anyway, I'm having a slight problem with OpenGL working about 10% of the time when called upon from my wrapper...
Sometimes it draws the triangles, and sometimes it doesn't (usually after recompiling when not making any changes to the code.)
I'm using Tao.Sdl for the window/context creation and then using my OpenGL wrapper. I know it works because I've seen the triangles drawn, but after some builds it doesn't draw and I have to spend hours tweaking/adding/removing bits of code to get it to work again. If I comment a random line of code in my program for example, it will work again, but if I recompile after that it won't work...
I'm soooo confused with this, so any help would be GREATLY appreciated...
Here is some of the wrapper code:
Thanks!
Edit: I'm using VC# 2005, and I also noticed that if I delete all the previous obj files and built files and then rebuild, it works again...
You might be better to use Tao.OpenGl as it's pretty much already written for you. You mentioned that you had been using Tao.Sdl, look around the Tao Framework for Tao.OpenGl.dll and add reference to that.....
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement