kanato's picture

ARB Shaders

I'm trying to play around with shaders on my laptop with it's crappy Intel X3100 card (I'm travelling, so this is all I can entertain myself with) which doesn't support GL 2.0. From what I can tell, GL.Arb.CreateShaderObject should allow values equivalent to GL_VERTEX_SHADER_ARB = 0x8b31 or GL_FRAGMENT_SHADER_ARB = 0x8b30. I assume it's not ok to just add these to OpenTK.Graphics.ArbShaderObjects in GLEnums.cs since that file is autogenerated?

Ok, so now I just pass (ArbShaderObjects)0x8b31 to GL.Arb.CreateShaderObject and it gives me a null reference exception. I track this in the debugger and sure enough, GL.Delegates.glCreateShaderObjectARB is null. Is this an indication that my video drivers suck, and in spite of the fact that it reports GL_ARB_FRAGMENT_PROGRAM is a supported extension? Or am I not understanding which functions go with that extension? I've thrown a call to GL.LoadAll for good measure but that doesn't make any difference.

Also, this is relatively unimportant, but GL.Arb.ShaderSource is missing the same nice (int,string) overload that GL.ShaderSource does.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kanato's picture

Ok, I updated my video drivers (I forgot I had rolled them back from before) and now there is support for OpenGL 2.0, and the ARB functions load and work.

the Fiddler's picture

ARB shaders, being extensions, haven't got the same clean-up treatment as core OpenGL. Still, I'll add any missing enums to the next release, now that the core is (more or less) ready.