Just wanted to add that I have tried calling PaintGL from the main thread, and although it no longer crashes it doesn't appear to render anything. Pseudo code snippets below.
I pass a pointer of a PreviewHelper instance to my PreviewCallback class then:
- Code: Select all
virtual HRESULT STDMETHODCALLTYPE DrawFrame(IDeckLinkVideoFrame* theFrame){
mtx1.lock();
PreviewHelper->SetFrame(theFrame);
mtx1.unlock();
}
The on main thread:
- Code: Select all
//bind fbo
//translate
//scale
//set fill colour to white
mtx2.lock();
MyObject.PreviewHelper->PaintGL();
mtx2.unlock();
//unbind fbo
A Rect with co-ordinates (-1,-1,1,1) draws fine.