mirror of https://github.com/bjornbytes/lovr.git
Don't include glad on web;
This commit is contained in:
parent
8464463d4e
commit
6a13ac5ee1
|
@ -17,8 +17,11 @@ static void lovrTextureCreateStorage(Texture* texture) {
|
||||||
int mipmapCount = log2(MAX(w, h)) + 1;
|
int mipmapCount = log2(MAX(w, h)) + 1;
|
||||||
GLenum internalFormat = textureData->format.glInternalFormat;
|
GLenum internalFormat = textureData->format.glInternalFormat;
|
||||||
GLenum format = textureData->format.glFormat;
|
GLenum format = textureData->format.glFormat;
|
||||||
|
#ifndef LOVR_WEB
|
||||||
if (GLAD_GL_ARB_texture_storage) {
|
if (GLAD_GL_ARB_texture_storage) {
|
||||||
|
#endif
|
||||||
glTexStorage2D(GL_TEXTURE_2D, mipmapCount, internalFormat, w, h);
|
glTexStorage2D(GL_TEXTURE_2D, mipmapCount, internalFormat, w, h);
|
||||||
|
#ifndef LOVR_WEB
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < mipmapCount; i++) {
|
for (int i = 0; i < mipmapCount; i++) {
|
||||||
glTexImage2D(GL_TEXTURE_2D, i, internalFormat, w, h, 0, format, GL_UNSIGNED_BYTE, NULL);
|
glTexImage2D(GL_TEXTURE_2D, i, internalFormat, w, h, 0, format, GL_UNSIGNED_BYTE, NULL);
|
||||||
|
@ -26,6 +29,7 @@ static void lovrTextureCreateStorage(Texture* texture) {
|
||||||
h = MAX(h >> 1, 1);
|
h = MAX(h >> 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture* lovrTextureCreate(TextureData* textureData) {
|
Texture* lovrTextureCreate(TextureData* textureData) {
|
||||||
|
@ -226,7 +230,7 @@ void lovrTextureSetFilter(Texture* texture, FilterMode filter, float anisotropy)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, MAX(anisotropy, 1.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void lovrTextureGetWrap(Texture* texture, WrapMode* horizontal, WrapMode* vertical) {
|
void lovrTextureGetWrap(Texture* texture, WrapMode* horizontal, WrapMode* vertical) {
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
#if LOVR_WEB
|
#if LOVR_WEB
|
||||||
#define GLFW_INCLUDE_ES3
|
#define GLFW_INCLUDE_ES3
|
||||||
|
#define GLFW_INCLUDE_GLEXT
|
||||||
#elif __APPLE__
|
#elif __APPLE__
|
||||||
#define GLFW_INCLUDE_GLCOREARB
|
#define GLFW_INCLUDE_GLCOREARB
|
||||||
|
#include "glad/glad.h"
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
#define APIENTRY __stdcall
|
#define APIENTRY __stdcall
|
||||||
|
#include "glad/glad.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "glad/glad.h"
|
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
|
Loading…
Reference in New Issue