aboutsummaryrefslogtreecommitdiff
path: root/src/glfw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glfw.c')
-rw-r--r--src/glfw.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/glfw.c b/src/glfw.c
deleted file mode 100644
index 17b1de3..0000000
--- a/src/glfw.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* glfw.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/05/11 01:58:00 by charles #+# #+# */
-/* Updated: 2020/05/13 13:16:32 by charles ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "scop.h"
-
-bool g_window_resized = false;
-
-static void st_resize_callback(GLFWwindow *window, int width, int height)
-{
- (void)window;
- g_window_resized = true;
- glViewport(0, 0, width, height);
-}
-
-GLFWwindow *glfw_init(int width, int height)
-{
- GLFWwindow *window;
-
- if (!glfwInit())
- return (NULL);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
- glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
- window = glfwCreateWindow(width, height, "scop", NULL, NULL);
- if (window == NULL)
- {
- glfwTerminate();
- return (NULL);
- }
- glfwMakeContextCurrent(window);
- glfwSetFramebufferSizeCallback(window, st_resize_callback);
- if (glewInit() != GLEW_OK)
- {
- glfwDestroyWindow(window);
- glfwTerminate();
- return (NULL);
- }
- glfwSwapInterval(1);
- GL_CALL(glViewport(0, 0, width, height));
- GL_CALL(glEnable(GL_DEPTH_TEST));
- return (window);
-}