
Windows 7
Posted Wednesday, 17 March, 2010 - 17:02 by Soundbomber inI have done an install of my app on a new windows 7 machine and am getting an InvalidEnum error.
The app was developed using OpenTK 0.9.8.
Are there any known issues regarding the version of OpenGL installed on the client machine and its compatibility with OpenTK 0.9.8?


Comments
Re: Windows 7
There are many reasons why an InvalidEnum may occur and the quickest way to understand the error is to look up the ailing function on the OpenGL reference pages.
Judging from opengl.org, the most common issue on Windows 7 is that users forget to install OpenGL drivers. Windows will install DirectX drivers automatically but will only emulate OpenGL over GDI or DirectX. However, this emulation layer supports only OpenGL 1.1 (GDI) or 1.4 (DirectX) and trying to use newer features, like VBO, will result in an error. Of course, drivers downloaded from the IHV's (nvidia.com, ati.com, intel.com) or from the manufacturer's website (dell, HP, etc) will bypass the emulator layer and provide better performance and features.
If possible, I would suggest checking
GL.GetString(StringName.Vendor)and displaying a warning if it contains "Microsoft Corporation". You should also check that all necessary extensions are available before trying to use them (for example, VBOs require ARB_vertex_buffer_object or GL version 1.5, FBOs require EXT_framebuffer_object or GL version 3.0 and so on.)Note that OpenTK 0.9.8 has not been tested on Windows 7 at all. It should work, but the first version to officially support Windows 7 is 1.0-beta-2. If possible, I would suggest upgrading to the latest release.
Re: Windows 7
OK, firstly thank you for the response.
The vendor name shows as "Intel" and I have the latest Intel drivers installed, and I am now working with OpenTK 1.0-beta-3. Still get the InvalidEnum error. I have had a look on the OpenGL forums and can't find anything relevant.
Fiddler you mention checking that all neccessary extensions are available - How do I achieve this (sorry if that is a dumb question!).
For info the error occurs when I call
GL.Enable(EnableCap.VertexArray)Re: Windows 7
In that case, the error is right: the correct method is
GL.EnableClientState(ArrayCap.VertexArray). Personally, I would suggest avoiding vertex arrays completely: vertex buffer objects are faster and safer to use under .Net. (The issue with VAs is that the data store is your responsibility, which means you have to guard it against the garbage collector. VBOs store the data in video memory, which is both faster and safer.)In OpenGL 1.x, 2.x and 3.x with the compatibility profile, you can check for extension support using:
Moreover, every version of OpenGL moves a number of extensions into core. For example, OpenGL 1.5 introduced vertex buffer objects:
As a rule of thumb, core functions reside in
GL., while extension functions live inGL.Arb.,GL.Ext.,GL.NV., etc. However, some extensions may modify the behavior of core functions (for example, ARB_vertex_buffer_object changes howGL.BufferDataworks when a VBO is bound - read the extension spec for more information).Re: Windows 7
Thanks Fiddler, using GL.EnableClientState(ArrayCap.VertexArray) solved my problem.