Closed sczhaoyu closed 7 years ago
code:
void run(){
auto ext = context->getState()->get
OpenGL calls should only ever be called by a thread with a valid graphics context, if you do calls outside this then you will get GL errors.
The OSG will do all set up and use of PBO's automatically for you so there shouldn't be any need to do PBO calls manually for most common usage cases. For dynamically updateded textures all one need to do is update the osg::Image data attached to the osg::Texture and call image->dirty() on the image so ensure the data is passed on the next time the texture is passed to OpenGL. To use PBO's in this process you simply assign an osg::PixerlBufferObject to the osg::Image.
Thanks
Mr openscenegraph: While I was using multithreading to change the model's texture, I couldn't use glMapBuffer function. It also couldn't be used on the pointer I created.