I’m trying to write a C++ windows service that can render to a texture. I’ve got the code working as a regular console app, but when run as a service wglGetProcAddress() returns NULL.
Can anyone tell me if this is possible, and if so, what do I need to do to make OpenGL work inside a service process?
Edit:
I still haven’t got this to work under Vista, but it does work under XP.
Services run in non-interactive desktops. These desktops do not connect to the physical display device of the computer but rather to logical display devices. The logical display devices are very basic generic VGA devices set to 1024 X 768 with no bells and whistles.
Services can use most GDI functions but no advanced graphics functions such as DirectX or OpenGL. So you can create windows, create or retrieve device contexts and do some fairly complex drawing and rendering but you can’t use anything but straightforward GDI (and some GDI+).
If you check GetLastError after wglGetProcAddress returns NULL you should get the reason for the failure.