Add basic GLFW initialization
This commit is contained in:
parent
86f1154ea0
commit
8ff7ad3dfb
1 changed files with 23 additions and 0 deletions
23
main.cpp
23
main.cpp
|
@ -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();
|
||||
}
|
||||
|
|
Reference in a new issue