mirror of
https://github.com/bjornbytes/lovr.git
synced 2024-07-02 12:33:52 +00:00
rm FORMAT_LUMINANCE_ALPHA;
This commit is contained in:
parent
c750b64b1b
commit
d8047cdeff
|
@ -17,12 +17,6 @@ Texture* lovrTextureCreate(TextureData* textureData) {
|
||||||
lovrTextureSetFilter(texture, FILTER_LINEAR, FILTER_LINEAR);
|
lovrTextureSetFilter(texture, FILTER_LINEAR, FILTER_LINEAR);
|
||||||
lovrTextureSetWrap(texture, WRAP_REPEAT, WRAP_REPEAT);
|
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;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,31 +4,15 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
TextureFormatInfo lovrTextureFormats[] = {
|
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,
|
.internalFormat = GL_RGB,
|
||||||
.format = GL_RGB,
|
.format = GL_RGB,
|
||||||
.channels = 3,
|
.channels = 3
|
||||||
.swizzled = 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.internalFormat = GL_RGBA,
|
.internalFormat = GL_RGBA,
|
||||||
.format = GL_RGBA,
|
.format = GL_RGBA,
|
||||||
.channels = 4,
|
.channels = 4
|
||||||
.swizzled = 0
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FORMAT_LUMINANCE_ALPHA,
|
|
||||||
FORMAT_RGB,
|
FORMAT_RGB,
|
||||||
FORMAT_RGBA
|
FORMAT_RGBA
|
||||||
} TextureFormat;
|
} TextureFormat;
|
||||||
|
@ -14,8 +13,6 @@ typedef struct {
|
||||||
GLenum internalFormat;
|
GLenum internalFormat;
|
||||||
GLenum format;
|
GLenum format;
|
||||||
int channels;
|
int channels;
|
||||||
int swizzled;
|
|
||||||
int swizzle[4];
|
|
||||||
} TextureFormatInfo;
|
} TextureFormatInfo;
|
||||||
|
|
||||||
extern TextureFormatInfo lovrTextureFormats[];
|
extern TextureFormatInfo lovrTextureFormats[];
|
||||||
|
|
Loading…
Reference in a new issue