rm FORMAT_LUMINANCE_ALPHA;

This commit is contained in:
bjorn 2017-07-15 02:43:26 +09:00
parent c750b64b1b
commit d8047cdeff
3 changed files with 2 additions and 27 deletions

View File

@ -17,12 +17,6 @@ Texture* lovrTextureCreate(TextureData* textureData) {
lovrTextureSetFilter(texture, FILTER_LINEAR, FILTER_LINEAR);
lovrTextureSetWrap(texture, WRAP_REPEAT, WRAP_REPEAT);
#ifndef LOVR_WEB
if (lovrTextureFormats[textureData->format].swizzled) {
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, lovrTextureFormats[textureData->format].swizzle);
}
#endif
return texture;
}

View File

@ -4,31 +4,15 @@
#include <string.h>
TextureFormatInfo lovrTextureFormats[] = {
{
#ifdef LOVR_WEB
.internalFormat = GL_LUMINANCE_ALPHA,
.format = GL_LUMINANCE_ALPHA,
.channels = 2,
.swizzled = 0
#else
.internalFormat = GL_RG,
.format = GL_RG,
.channels = 2,
.swizzled = 1,
.swizzle = { GL_RED, GL_RED, GL_RED, GL_GREEN }
#endif
},
{
.internalFormat = GL_RGB,
.format = GL_RGB,
.channels = 3,
.swizzled = 0
.channels = 3
},
{
.internalFormat = GL_RGBA,
.format = GL_RGBA,
.channels = 4,
.swizzled = 0
.channels = 4
}
};

View File

@ -5,7 +5,6 @@
#pragma once
typedef enum {
FORMAT_LUMINANCE_ALPHA,
FORMAT_RGB,
FORMAT_RGBA
} TextureFormat;
@ -14,8 +13,6 @@ typedef struct {
GLenum internalFormat;
GLenum format;
int channels;
int swizzled;
int swizzle[4];
} TextureFormatInfo;
extern TextureFormatInfo lovrTextureFormats[];