models are correctly rendered in framebuffers

This commit is contained in:
devZoGok
2021-10-19 19:06:40 +03:00
parent 19fa1590d0
commit 6102373fbc
4 changed files with 15 additions and 15 deletions
+5 -3
View File
@@ -53,7 +53,7 @@ namespace vb01{
glBindTexture(GL_TEXTURE_2D,0);
}
Texture::Texture(string path){
Texture::Texture(string path,bool flip){
bool png=false;
int length=path.length();
if(path.substr(length-4,string::npos)==".png")
@@ -68,7 +68,7 @@ namespace vb01{
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
//stbi_set_flip_vertically_on_load(true);
stbi_set_flip_vertically_on_load(flip);
data=stbi_load(path.c_str(),&width,&height,&numChannels,0);
@@ -77,12 +77,14 @@ namespace vb01{
stbi_image_free(data);
}
Texture::Texture(string paths[6]){
Texture::Texture(string paths[6],bool flip){
this->type=TextureType::TEXTURE_CUBEMAP;
glGenTextures(1,&texture);
glBindTexture(GL_TEXTURE_CUBE_MAP,texture);
stbi_set_flip_vertically_on_load(flip);
for(int i=0;i<6;i++){
data=stbi_load(paths[i].c_str(),&width,&height,&numChannels,0);
if(data){