简体   繁体   中英

Opentk Opengl Version

I have a Windows C# application which uses OpenTK. The application performs some relatively simple drawing but also calls into a C++ developed dll for additional openGL drawing/rendering.

The application and c++ dll have been developed against openGL version 1.1 so when I modified the creation of the OpenTK GLControl from version 1.1 to version 3.0, as shown:

From

private OpenTK.GLControl m_OpenGLDisplay = new OpenTK.GLControl(new OpenTK.Graphics.GraphicsMode(32, 24, 8, 0), 1, 1, OpenTK.Graphics.GraphicsContextFlags.Default);

To

private OpenTK.GLControl m_OpenGLDisplay = new OpenTK.GLControl(new OpenTK.Graphics.GraphicsMode(32, 24, 8, 0), 3, 0, OpenTK.Graphics.GraphicsContextFlags.ForwardCompatible);

I was expecting to encounter no end of problems. Unfortunately the application seems to behave no different regardless of the version I enter - up to 4.0(including the error status from GL.GetError).

Any explanation would be appreciated.

Why would there be problems? OpenGL is backwards compatible , so code written against one version will execute on a higher version.

The only time OpenGL broke compatibility was with the core/compatibility profile distinction, and core profiles are always opt-in. But core profiles are also the only mandatory implementations. That is, if an implementation offers 3.2 core, it may or may not offer 3.2 compatibility. The reverse is not allowed; if it offers 3.2 compatibility, it must offer 3.2 core as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM