From 6623e7fbdb4307536d3f5920c267c74f8bc6a989 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 11 May 2020 02:19:18 +0200 Subject: Generating triangles for polygon face in .obj file, opengl error/initialisation --- src/glfw.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/glfw.c (limited to 'src/glfw.c') diff --git a/src/glfw.c b/src/glfw.c new file mode 100644 index 0000000..8afdfe4 --- /dev/null +++ b/src/glfw.c @@ -0,0 +1,30 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* glfw.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/05/11 01:58:00 by charles #+# #+# */ +/* Updated: 2020/05/11 02:16:58 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "scop.h" + +GLFWwindow *glfw_init(int width, int height) +{ + GLFWwindow *window; + + if (!glfwInit()) + return (NULL); + window = glfwCreateWindow(width, height, "scop", NULL, NULL); + if (window == NULL) + { + glfwTerminate(); + return (NULL); + } + glfwMakeContextCurrent(window); + glewInit(); + return (window); +} -- cgit