Concept3D's picture

Unable to find an entry point exception

Hello guys ,

I have 3D application which am porting from TaoFramework to OpenTK and glControl , the problem is that whenever I use glUseProgram , glBindBuffer (apparently openGL 1.5 and higher functions) I get an exception like this "Unable to find an entry point named 'glGenBuffers' in DLL 'opengl32.dll'". , though that didn't happen when tried to create a separate test application that uses glUseProgram. and btw am sure that I have the latest drivers and graphics card that supports openGL 3.

Any Ideas? I appreciate any help :)

Regards.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture
  • What does GL.GetString(StringName.Version) return?
  • Are you using OpenTK.Compatibility.dll to access Tao.OpenGl or are you using OpenTK.dll to access OpenTK.Graphics.OpenGL?

When using OpenTK.Graphics, this exception should only occur if the function really isn't supported (e.g. you are getting a non-accelerated context).

When using Tao.OpenGl (both through Tao.OpenGl.dll or OpenTK.Compatibility.dll), this may happen when accessing any OpenGL function before creating an OpenGL context. In that case, you need to step through the code, find the culprit and remove it (the issue typically lies in Resize event handlers, so check those first).

Concept3D's picture

Thanx for the reply.

Actually I use OpenTK.dll to access OpenTK.Graphics.OpenGL, I use the comparability to access some of the glu functionality.
The glGetString Returns a non-accelerated Microsoft context , it should be nvidia instead , and there was no problem with the other test applications. Any Ideas ?

Regards.

the Fiddler's picture

Are you passing custom parameters to the GLControl constructor? If so, try using the default, parameterless constructor.

GLControl glControl = new GLControl();
// instead of
GLControl glControl = new GLControl(new GraphicsMode(...));

Moreover, what does this print?

// glControl is your GLControl instance
Console.WriteLine(glControl.Context.GraphicsMode.ToString());

Might provide some insight.

Concept3D's picture

the control fails to initials an accelerated context , so it gives me Microsoft Generic GDI context with the following settings
Index: 8, Color: 32 (8888), Depth: 24, Stencil: 0, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
I tried both ways; the default value and custom values with the same result. can't really think of anything that prevents a context from being initialized :(

the Fiddler's picture

Try running your application with the debug version of OpenTK.dll (you can find it in Binaries/OpenTK/Debug). This dll will print debug info to the output window of Visual Studio - attach this info here so I can take a look. I haven't really seen this kind of issue before.

It would also help if you posted what video card and drivers you are using. Do other OpenGL applications work correctly? What about the samples in Examples.exe?

Concept3D's picture

Other openGL applications work correctly , the same goes with examples.exe.
here is the driver info from GPU caps :
Renderer: NVIDIA GeForce 8500 GT
GPU: G86
Bios: 60.86.41.00.43
OpenGL: Core: 3.0 - GLSL: 1.30
Drivers: Forceware 6.14.11.8208 (2-18-2009)

here is the debug info :I used the following constructor for openGL control
glControl1 = new OpenTK.GLControl(OpenTK.Graphics.GraphicsMode.Default, 2, 0, OpenTK.Graphics.GraphicsContextFlags.Default);

.
Detected configuration: Windows / .Net
DisplayDevice 1 (primary) supports 158 resolutions.
Creating default GraphicsMode (32, 16, 0, 0, 0, 2, False).
Creating GraphicsContext.
Creating GraphicsContext.
Device context: -1996418924
Selecting pixel format... GraphicsMode: Index: 11, Color: 24 (8880), Depth: 0, Stencil: 0, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 265058, Parent (Windows.WindowInfo: Handle 265064, Parent (null))
GraphicsContextFlags: Default
Requested version: 1.0
Loaded opengl32.dll: 1590689792
OpenGL will be bound to handle: 265058
Setting pixel format... 11
Creating temporary context for wgl extensions.
Load extensions for OpenTK.Platform.Windows.Wgl... 50 extensions loaded in 37 ms.
Load extensions for OpenTK.Platform.Windows.Wgl... 50 extensions loaded in 3 ms.
Using WGL_ARB_create_context... success!
success! (id: 131072)
Selecting pixel format (ARB)... success!
Disposing context 131072.
Destroying window: Windows.WindowInfo: Handle 265064, Parent (null)
GraphicsMode: Index: 8, Color: 32 (8888), Depth: 24, Stencil: 0, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 265070, Parent (null)
GraphicsContextFlags: Default
Requested version: 2.0
OpenGL will be bound to handle: 265070
Setting pixel format... 8
Using WGL_ARB_create_context... success!
success! (id: 196608)

Concept3D's picture

Finally I was able to find the problem. my application used to "fade in" at start, I only did that as an effect by playing with Opacity property in the Form , it worked when I used TaoFramework , while it resulted in not initializing glControl correctly -or maybe it initialized correctly but after that when the opacity changes the openGL context is replaced by Generic Microsoft GDI context, thats what I can understand-.
Any way is this a bug in the glControl ? because it didn't happen with SimpleOpenGL control from TaoFramework ??

Thanx for the help.
Regards,

the Fiddler's picture

Can you please provide a simple test case that reproduces this issue?

Concept3D's picture

here is a sample that reproduce the bug, it only happens when the opacity of the form is changed at start up of the application.
in the sample the form opacity is set to 50% , that will cause the context to be microsoft generic.
while changing that to 100% will result in successful context creation .
btw I think this is a minor issue.

Regards.

AttachmentSize
Opacity_glControl_Bug.rar19.68 KB