-1

My OpenGL version 4.5.0 on Ubuntu 14.04. VBO and shaders are used. The OpenGL not rendering correctly after lock screen (black with a few color lines, looks like glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT) not working). I tried both offline rendering (FBO save frame to picture) and online rendering (draw frame on window).

Any suggestion would be appreciated.

  • What does this have to do with programming? – Aaron Gillion Apr 05 '16 at 02:16
  • @AaronGillion, Hello Aaron, thanks for your reply. I have to render my 3D model offline as a service on a server, output frame image onto stream media. So, the server screen should be locked, and my application should be working fine with screen locked. – Jiewei Li Apr 05 '16 at 02:31
  • Maybe you lost the context (error: GL_CONTEXT_LOST)? What are your OpenGL errors after lock screen? And run the program in gDEBugger, that will give you more information of what is going on. Also, what do you mean "should be working fine"? Find a reference that says it "SHALL BE FINE" or abandon the solution. – Andreas Apr 05 '16 at 19:48

1 Answers1

0

Render to an FBO not to a window-. The contents of a window are undefined for the pixels that don't pass the pixel ownership test (i.e. windows obscured, for example by the screen locker overlay).

Depending on the OpenGL implementation and environment you still may require a window for creating a context. But recently it's become possible to create working OpenGL contexts without requring a display server to run.

For NVidia see https://devblogs.nvidia.com/parallelforall/egl-eye-opengl-visualization-without-x-server/

datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • thanks for your replay. The problem is still there when I render to FBO (OpenGL context is created with a window, window is hide immediately). I will try to create OpenGL context without a window as you suggested. If it is working, I will let you know. – Jiewei Li Apr 05 '16 at 08:37