aboutsummaryrefslogtreecommitdiff
path: root/src/glfw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glfw.c')
-rw-r--r--src/glfw.c30
1 files changed, 30 insertions, 0 deletions
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 <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* 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);
+}