fixed texture error

This commit is contained in:
Anakin 2016-12-13 19:07:36 +01:00
parent 481256e8ea
commit 96379a9afb
2 changed files with 11 additions and 1 deletions

View File

@ -132,7 +132,16 @@ void OpenGlViewer::paintGL()
{
// set the texture
std::uint32_t tmp_textureIndex = segmentIterator->textureIndex >= m_vTextures->size() ? m_vTextures->size() - 1 : segmentIterator->textureIndex;
if (m_oglTexture->isCreated())
{
m_oglTexture->destroy();
m_oglTexture->create();
m_oglTexture->setSize(m_vTextures->at(tmp_textureIndex)->width(), m_vTextures->at(tmp_textureIndex)->height());
m_oglTexture->setData(*m_vTextures->at(tmp_textureIndex));
}
// give the MVP to the shader
m_program->setUniformValue(m_uniformMVP, getMVPMatrix(modelIndex));

View File

@ -1,6 +1,7 @@
#include "Header\MainWindow.h"
#include <QtWidgets/QApplication>
int startGUI(int argc, char* argv[])
{
QApplication a(argc, argv);