GLFW ist eine Bibliothek für [[opengl|OpenGL]].
=====Installation=====
====Linux====
sudo apt-get install libglfw3
sudo apt-get install libglfw3-dev
====Windows====
GLFW [[https://www.glfw.org/download|hier]] herunterladen und den 'include' und den jeweils benötigten 'lib-xxx' Ordner an die Compilerflags anhängen. Die Datei 'glfw3.dll' aus dem jeweiligen 'lib-xxx' Ordner muss neben die Executable gespeichert werden.
=====Example=====
#include
int main(void)
{
GLFWwindow* window;
if (!glfwInit())
return -1;
window = glfwCreateWindow(800, 600, "OpenGL GLFW", NULL, NULL);
if (!window)
{
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
while (!glfwWindowShouldClose(window))
{
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(window);
glfwPollEvents();
}
glfwTerminate();
return 0;
}
gcc test.c -lglfw -lGLU -lGL
{{glfw_example.zip}}