mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
fixed setImage()
This commit is contained in:
+6
-7
@@ -35,11 +35,12 @@ namespace vb01Gui{
|
|||||||
mat->addVec4Uniform(diffColUni, color);
|
mat->addVec4Uniform(diffColUni, color);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
mat->addBoolUniform(texUni, true);
|
|
||||||
string frame[]{imagePath};
|
string frame[]{imagePath};
|
||||||
Texture *tex = new Texture(frame, 1, false);
|
Texture *tex = new Texture(frame, 1, false);
|
||||||
mat->addTexUniform("diffuseMap", tex, false);
|
|
||||||
textures.push_back(tex);
|
textures.push_back(tex);
|
||||||
|
|
||||||
|
mat->addTexUniform("diffuseMap", tex, false);
|
||||||
|
mat->addBoolUniform(texUni, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
rect->setMaterial(mat);
|
rect->setMaterial(mat);
|
||||||
@@ -130,15 +131,13 @@ namespace vb01Gui{
|
|||||||
if(textures[i]->getPath()[0] == image)
|
if(textures[i]->getPath()[0] == image)
|
||||||
texId = i;
|
texId = i;
|
||||||
|
|
||||||
/*
|
|
||||||
if(texId == -1){
|
if(texId == -1){
|
||||||
string p[]{image};
|
string p[]{image};
|
||||||
textures.push_back(new Texture(p, 1));
|
textures.push_back(new Texture(p, 1, false));
|
||||||
mat->setDiffuseMap(textures[textures.size() - 1], 0);
|
mat->setTexUniform("diffuseMap", textures[textures.size() - 1], false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mat->setDiffuseMap(textures[texId], 0);
|
mat->setTexUniform("diffuseMap", textures[texId], false);
|
||||||
*/
|
|
||||||
|
|
||||||
this->imagePath = image;
|
this->imagePath = image;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user