Hi,
I encountered an issue when porting an OSX app to Linux. Created a basic test with and Fbo whose color texture should be shared between the two windows, but it isn’t. What is the correct way of doing this? If I remember correctly this has worked before for me on Linux.
Latest Cinder git master with gtx 1080, proprietary driver 375.39, on Fedora 25.
Thanks,
-Gabor
OSX:
Linux:
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
class MultiWindowTestApp : public App
{
public:
void setup() override;
void update() override;
private:
app::WindowRef mWindow0;
app::WindowRef mWindow1;
void drawWindow( size_t windowId );
void renderFbo();
gl::FboRef mFbo;
};
void MultiWindowTestApp::setup()
{
mFbo = gl::Fbo::create( 1920, 1080 );
mWindow0 = app::getWindow();
mWindow0->getSignalDraw().connect( [ & ]() { drawWindow( 0 ); } );
mWindow1 = createWindow( Window::Format().size( ivec2( 400 ) ) );
mWindow1->getSignalDraw().connect( [ & ]() { drawWindow( 1 ); } );
}
void MultiWindowTestApp::renderFbo()
{
gl::ScopedFramebuffer fbo( mFbo );
gl::ScopedViewport viewport( mFbo->getSize() );
gl::clear( Color( 1.0f, 0.0f, 0.2f ) );
}
void MultiWindowTestApp::update()
{
renderFbo();
}
void MultiWindowTestApp::drawWindow( size_t windowId )
{
gl::viewport( getWindowSize() );
gl::setMatricesWindow( getWindowSize() );
gl::clear();
gl::draw( mFbo->getColorTexture(), getWindowBounds() );
}
CINDER_APP( MultiWindowTestApp, RendererGl )