Sign in to follow this  

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

This topic is 4201 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites

This topic is 4201 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this