Pygmy
01-21-2011, 12:40 PM
I'm using OpenTK in Windows.
I have an app with a user-interface, and I want to run a background thread for continuously rendering to a FrameBuffer Object.
Every rendered frame, I want to display (different parts of) this rendered texture in one or more controls in my UI.
Creating a render-thread is not a problem (making sure the context is only current in one thread at a time).
But how do I synchronize so that when the background thread has rendered a frame, OpenGL-controls in my UI-thread display (different parts of) the rendered texture ?
I assume first of all I need to wait for the GPU to finish rendering, and then somehow let the OpenGL-controls in the UI-thread draw a control-filling quad with the wanted coordinates in the rendered texture.
So does anybody know how I actually should approach and synchronize all this ?
I have an app with a user-interface, and I want to run a background thread for continuously rendering to a FrameBuffer Object.
Every rendered frame, I want to display (different parts of) this rendered texture in one or more controls in my UI.
Creating a render-thread is not a problem (making sure the context is only current in one thread at a time).
But how do I synchronize so that when the background thread has rendered a frame, OpenGL-controls in my UI-thread display (different parts of) the rendered texture ?
I assume first of all I need to wait for the GPU to finish rendering, and then somehow let the OpenGL-controls in the UI-thread draw a control-filling quad with the wanted coordinates in the rendered texture.
So does anybody know how I actually should approach and synchronize all this ?