4

I have very odd problem with my C# OpenTK screensaver application. When I compile the program and run it before changing the extension, as EXE file, it works properly. But when I change the extension to SCR and run it, it crashes with a System.EntryPointNotFound exception (glCreateProgram function in this case). In the debugger I have checked that when I run:

as EXE file: GL.GetString(StringName.Vendor) -> "Intel" GL.GetString(StringName.Version) -> "2.1.0 - Build 8.15.10.2622"

as SCR file: GL.GetString(StringName.Vendor) -> "Microsoft" GL.GetString(StringName.Version) -> "1.1.0"

In my application I am using parameterless constructor of GameWindow class to create OpenGL context. For little experiment I changed extension to BAT and it run perfectly well. I have no idea why my OpenGL context depends on file extension, I'm guessing that screensavers are executed by system on some kind of overlay but truly I couldn't find solution for this issue.

Any ideas?

Bart
  • 19,692
  • 7
  • 68
  • 77
mi_k
  • 53
  • 1
  • 5
  • This is a Dll Hell problem, you've got more than one version of opengl32.dll on your machine. Windows finds another one when you renamed it to .scr, no doubt the one in c:\windows\system32 – Hans Passant Mar 25 '12 at 14:26
  • I checked that, on my computer I have two copies of the library opengl32.dll - first in C:\Windows\System32\ and the second one in C:\Windows\winsxs\... but both files are identical versions. – mi_k Mar 25 '12 at 15:14
  • 1
    Right, that's the Microsoft version. You haven't found the Intel version yet. Clearly your EXE program can. Enable unmanaged debugging and look at Debug + Windows + Modules to see where it is located. – Hans Passant Mar 25 '12 at 15:20
  • @mi_k: You should always use the opengl32.dll found in system32. glCreateShader is a extension function. OpenTK should deal with extension loading properly. – datenwolf Mar 25 '12 at 20:26

1 Answers1

1

Finally, after long searching i found out that Intel blocks hardware support for screensavers using OpenGL. I have changed extension to "sCr" to fool driver and now everything works fine.

Link: opengl.org forum

mi_k
  • 53
  • 1
  • 5