Jump to content
  • Advertisement
Sign in to follow this  

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

This topic is 4509 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
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.....

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!