diff --git a/Source/Processors/Visualization/SpikeDisplayCanvas.cpp b/Source/Processors/Visualization/SpikeDisplayCanvas.cpp index c3e02d80d30797b7b341ae686baf682cc6440652..10cc176e5e67cc3584a37bdd06862979a6c215a8 100644 --- a/Source/Processors/Visualization/SpikeDisplayCanvas.cpp +++ b/Source/Processors/Visualization/SpikeDisplayCanvas.cpp @@ -51,8 +51,8 @@ void SpikeDisplayCanvas::initializeSpikePlots(){ std::cout<<"Initializing Plots"<<std::endl; - int nPlots = 6; - int nCols = 2; + int nPlots = 4; + int nCols = 4; int totalWidth = getWidth(); diff --git a/Source/Processors/Visualization/SpikePlotting/ProjectionAxes.cpp b/Source/Processors/Visualization/SpikePlotting/ProjectionAxes.cpp index 204f579643386a60053d50bceedc6df80c8afb93..ca7561395fbdeae9ffb01dc8da1266baf992b31e 100644 --- a/Source/Processors/Visualization/SpikePlotting/ProjectionAxes.cpp +++ b/Source/Processors/Visualization/SpikePlotting/ProjectionAxes.cpp @@ -103,6 +103,8 @@ void ProjectionAxes::plot(){ plot(); return; } +// else +// std::cout<<"All is good no errors detected"<<std::endl; } void ProjectionAxes::plotOldSpikes(bool allSpikes){ @@ -194,15 +196,17 @@ void ProjectionAxes::createTexture(){ texWidth = BaseUIElement::width; texHeight = BaseUIElement::height; - std::cout<<"Creating a new texture of size:"<<texWidth<<"x"<<texHeight<<std::endl; + std::cout<<"Creating a new texture of size:"<<texWidth<<"x"<<texHeight;//<<std::endl; // Delete the old texture glDeleteTextures(1, &textureId); // Generate a new texture glGenTextures(1, &textureId); + std::cout<<" textureId:"<<textureId<<std::endl; // Bind the texture, and set the appropriate parameters glBindTexture(GL_TEXTURE_2D, textureId); glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, texWidth, texHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); + glGenerateMipmap(GL_TEXTURE_2D); // generate a new FrameBufferObject createFBO(); @@ -212,7 +216,7 @@ void ProjectionAxes::createTexture(){ } void ProjectionAxes::createFBO(){ - std::cout<<"Creating a new frame buffer object"<<std::endl; + std::cout<<"Creating a new frame buffer object";//<<std::endl; // if (!isTextureValid) // createTexture(); @@ -227,20 +231,25 @@ void ProjectionAxes::createFBO(){ // Generate and bind the new Render Buffer glGenRenderbuffersEXT(1, &rboId); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rboId); + std::cout<<" fboID:"<<fboId<<" rboID:"<<rboId<<std::endl; + + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, texWidth, texHeight); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); // Attach the texture to the framebuffer glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, textureId, 0); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rboId); - + // If the FrameBuffer wasn't created then we have a bigger problem. Abort the program. if(!checkFramebufferStatus()){ std::cout<<"FrameBufferObject not created! Are you running the newest version of OpenGL?"<<std::endl; std::cout<<"FrameBufferObjects are REQUIRED! Quitting!"<<std::endl; exit(1); } - + glClearColor(0.0, 0.0, 0.0, 0.0); + glClear(GL_COLOR_BUFFER_BIT); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); }