made Editor non reliant on GLFW aka i added an IRenderTexture interface of use in non renderer specific aplications
This commit is contained in:
@@ -18,19 +18,19 @@ void TSE::GLFW::TextureHelperOpenGL::Apply(Texture *tex)
|
||||
if(tex->Chanels() == 1)
|
||||
{
|
||||
if (tex->bpp() == 8)
|
||||
glTexImage2D(GL_TEXTURE_2D, 0,GL_RGBA, tex->width(), tex->height(), 0, GL_RED, GL_UNSIGNED_BYTE, tex->GetImagePtr());
|
||||
glTexImage2D(GL_TEXTURE_2D, 0,GL_RGBA, tex->Width(), tex->Height(), 0, GL_RED, GL_UNSIGNED_BYTE, tex->GetImagePtr());
|
||||
}
|
||||
if(tex->Chanels() == 3)
|
||||
{
|
||||
if(tex->bpp() == 24)
|
||||
glTexImage2D(GL_TEXTURE_2D, 0,GL_RGBA, tex->width(), tex->height(), 0, GL_BGR, GL_UNSIGNED_BYTE, tex->GetImagePtr());
|
||||
glTexImage2D(GL_TEXTURE_2D, 0,GL_RGBA, tex->Width(), tex->Height(), 0, GL_BGR, GL_UNSIGNED_BYTE, tex->GetImagePtr());
|
||||
}
|
||||
else if(tex->Chanels() == 4)
|
||||
{
|
||||
if(tex->bpp() == 32)
|
||||
glTexImage2D(GL_TEXTURE_2D, 0,GL_RGBA, tex->width(), tex->height(), 0, GL_BGRA, GL_UNSIGNED_BYTE, tex->GetImagePtr());
|
||||
glTexImage2D(GL_TEXTURE_2D, 0,GL_RGBA, tex->Width(), tex->Height(), 0, GL_BGRA, GL_UNSIGNED_BYTE, tex->GetImagePtr());
|
||||
if (tex->bpp() == 8) //need to decode it with bitwise operations in shader
|
||||
glTexImage2D(GL_TEXTURE_2D, 0,GL_RGBA, tex->width(), tex->height(), 0, GL_RED, GL_UNSIGNED_BYTE, tex->GetImagePtr());
|
||||
glTexImage2D(GL_TEXTURE_2D, 0,GL_RGBA, tex->Width(), tex->Height(), 0, GL_RED, GL_UNSIGNED_BYTE, tex->GetImagePtr());
|
||||
}
|
||||
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
|
||||
Reference in New Issue
Block a user