fixed problem
This commit is contained in:
@@ -46,6 +46,7 @@ OpenGLController::~OpenGLController()
|
||||
{
|
||||
textureData* cursor = vTextures.back();
|
||||
vTextures.pop_back();
|
||||
delete cursor->data;
|
||||
delete cursor;
|
||||
}
|
||||
}
|
||||
@@ -347,8 +348,7 @@ void OpenGLController::loadMsh(const char * path)
|
||||
tempData->alpha = tempTex.hasAlpha();
|
||||
tempData->width = tempTex.getWidth();
|
||||
tempData->height = tempTex.getHeight();
|
||||
tempData->data = tempTex.getData().data();
|
||||
|
||||
tempData->data = new std::vector<std::uint8_t>(tempTex.getData());
|
||||
}
|
||||
catch (std::invalid_argument e)
|
||||
{
|
||||
@@ -356,7 +356,7 @@ void OpenGLController::loadMsh(const char * path)
|
||||
tempData->alpha = true;
|
||||
tempData->width = 1;
|
||||
tempData->height = 1;
|
||||
tempData->data = (const GLvoid*)solidColor;
|
||||
tempData->data = new std::vector<std::uint8_t>({ 0, 0, 255, 255 });
|
||||
}
|
||||
|
||||
vTextures.push_back(tempData);
|
||||
@@ -370,7 +370,7 @@ void OpenGLController::loadMsh(const char * path)
|
||||
0,
|
||||
vTextures.front()->alpha ? GL_BGRA : GL_BGR,
|
||||
GL_UNSIGNED_BYTE,
|
||||
vTextures.front()->data
|
||||
vTextures.front()->data->data()
|
||||
);
|
||||
|
||||
// set some texture parameters
|
||||
@@ -380,6 +380,4 @@ void OpenGLController::loadMsh(const char * path)
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user