Created
October 2, 2014 10:07
-
-
Save tai2/0cc3dda8fd4a35f13c00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // gcc -framework OpenGL -lglfw3 glfwtest.c -o glfwtest | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <GLFW/glfw3.h> | |
| int main() | |
| { | |
| GLFWwindow* window; | |
| if (!glfwInit()) { | |
| fprintf(stderr, "glfwInit() failed\n"); | |
| abort(); | |
| } | |
| window = glfwCreateWindow(640, 480, "My Title", NULL, NULL); | |
| if (!window) { | |
| fprintf(stderr, "glfwCreateWindow() failed\n"); | |
| abort(); | |
| } | |
| printf("GLFW_CONTEXT major=%d minor=%d\n", | |
| glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR), | |
| glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR)); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment