#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <stdio.h>
const GLint WIDTH = 800, HEIGHT = 600;
int main(void)
{
if (!glfwInit()) {
printf("glfwInit() Error");
return 1;
}
GLFWwindow* window = glfwCreateWindow(WIDTH, HEIGHT, "window title", NULL, NULL);
if (!window) {
printf("glfwCreateWindow() Error");
glfwTerminate();
return 1;
}
glfwMakeContextCurrent(window);
glewExperimental = GL_TRUE;
if (glewInit() != GLEW_OK) {
printf("glewInit() Error");
glfwDestroyWindow(window);
glfwTerminate();
}
const GLubyte* vendor = glGetString(GL_VENDOR); // get the vendor
printf("Vendor: %s\n", vendor);
const GLubyte* renderer = glGetString(GL_RENDERER); // get the graphic card model
printf("Renderer: %s", renderer);
while (!glfwWindowShouldClose(window)) {
glfwPollEvents();
}
glfwDestroyWindow(window);
glfwTerminate();
return 0;
}
/*
run:
Vendor: NVIDIA Corporation
Renderer: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2
*/