1
0
Fork 0

Add basic GLFW initialization

This commit is contained in:
Meoweg 2015-11-03 15:40:20 +00:00
parent 86f1154ea0
commit 8ff7ad3dfb

View file

@ -1,3 +1,26 @@
#include <cstdlib>
#include <GL/glfw.h>
#include <emscripten/emscripten.h>
static void iterate();
int main()
{
if (!glfwInit())
exit(EXIT_FAILURE);
if (!glfwOpenWindow(640, 480, 8, 8, 8, 8, 16, 0, GLFW_WINDOW))
{
glfwTerminate();
exit(EXIT_FAILURE);
}
emscripten_set_main_loop(iterate, 60, 1);
}
void iterate()
{
glfwPollEvents();
}