Using OpenGL in a Vista Service?

I am trying to use OpenGL (more specifically a PBuffer) from inside of a Service running under Vista, but I cannot get a valid OpenGL context for creating the PBuffer. The Service, however, is running fine under WinXP…

There is a checkbox “Allow Access to the desktop” somewhere in der Service properties, but this does not change the behavior.

Are there any tips and tricks to solve this problem? Has someone else succeeded in this specific usage pattern?

Probably unrelated, but unless you really have a reason to use a PBuffer, it is better to use an FBO instead (skip to the ‘examples’ section).

Do you succeed in running a very simple GL window from your service , without PBO/FBO ?

On the XP the services share session with the first logged-in user. On the Vista they have separate session which does not support the hw acceleration so you are likely out of luck. What are you trying to accomplish?

@Komat: We are creating a web service which produces and returns images (JPEGs) from 3D landscapes for camera parameters provided by the web request…

Would using an Apache web server and creating our web service as an apache module change anything on Vista? Probably not, I think…

What about this “Allow Access to the Desktop” checkbox in the service properties?

@ZBuffer: Since we don’t want to and probably cannot use an onscreen OpenGL canvas/windows we want to use the PBuffer for offscreen rendering instead. The PBuffer will be the only OpenGL rendering context in use, so using an FBO instead would not change anything: we still have to create a valid OpenGL context, which could not be done on Vista inside of a service, or can it?

That checkbox allows the service to create visible windows within the session 0. When it is not checked, windows it creates will be invisible even on XP. On Vista you can only see content of the session 0 when compatibility mechanism detects that some service created window within the session 0 and gives you possibility to temporarily display content of the session 0. You can read more about that here.

I assume that to create the OpenGL context you might need to run additional process as some user using the CreateProcessAsUser function. Create the context in that process and use some communication mechanism to transfer work between the service and the process. I never needed that so I do not know if it is possible to create context if there is no normal logged-in user.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.