More emscripten stuff;

SwapInterval was removed to ensure RAF timing is used.
This commit is contained in:
bjorn 2018-08-30 21:58:00 -07:00
parent 7222d1fa26
commit 017066d45e
3 changed files with 4 additions and 8 deletions

View File

@ -5,14 +5,6 @@
#pragma once
// WEBGL_compressed_texture_s3tc_srgb isn't ratified yet...
#ifdef EMSCRIPTEN
#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
#endif
typedef enum {
FORMAT_RGB,
FORMAT_RGBA,

View File

@ -94,7 +94,9 @@ void lovrGraphicsCreateWindow(int w, int h, bool fullscreen, int msaa, const cha
glfwSetWindowCloseCallback(state.window, onCloseWindow);
}
#ifndef EMSCRIPTEN
glfwSwapInterval(0);
#endif
glfwGetFramebufferSize(state.window, &state.width, &state.height);
lovrGpuInit(state.gammaCorrect, glfwGetProcAddress);
VertexFormat format;

View File

@ -16,6 +16,8 @@
#if EMSCRIPTEN
#include <GLES3/gl3.h>
#include <GLES2/gl2ext.h>
#include <GL/gl.h>
#include <GL/glext.h>
#else
#include "lib/glad/glad.h"
#endif