Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/test/browser/test_glfw_minimal.c
4150 views
1
/*
2
* Copyright 2015 The Emscripten Authors. All rights reserved.
3
* Emscripten is available under two separate licenses, the MIT license and the
4
* University of Illinois/NCSA Open Source License. Both these licenses can be
5
* found in the LICENSE file.
6
*/
7
8
#include <stdio.h>
9
#include <stdlib.h>
10
#define GLFW_INCLUDE_ES2
11
#include <GL/glfw.h>
12
13
int main() {
14
printf("main function started\n");
15
16
if (glfwInit() != GL_TRUE) {
17
printf("glfwInit() failed\n");
18
glfwTerminate();
19
return 1;
20
}
21
22
printf("glfwInit() success\n");
23
24
if (glfwOpenWindow(640, 480, 8, 8, 8, 8, 16, 0, GLFW_WINDOW) != GL_TRUE) {
25
printf("glfwOpenWindow() failed\n");
26
glfwTerminate();
27
return 1;
28
}
29
30
printf("glfwOpenWindow() success\n");
31
return 0;
32
}
33
34
35