[.net] Problem with home-made OpenGL wrapper.

Started by
1 comment, last by Rob Loach 17 years, 10 months ago
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:

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 ...


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...
My game development blog: http://rykerlabs.com
Advertisement
OK, I think I fixed the problem, apparently I had the parameter wrong in glClearDepth.
My game development blog: http://rykerlabs.com
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.....
Rob Loach [Website] [Projects] [Contact]

This topic is closed to new replies.

Advertisement