diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bcf3b2..508dd3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,4 +27,4 @@ link_directories(/usr/local/lib) add_executable(erc ${sources} src/main.c) # Graphics -target_link_libraries(erc ${opengl_library} glfw GLEW) +target_link_libraries(erc) diff --git a/include/vm_screen.h b/include/vm_screen.h index 8ef7d29..0e38b12 100644 --- a/include/vm_screen.h +++ b/include/vm_screen.h @@ -1,8 +1,6 @@ #ifndef _VM_SCREEN_H_ #define _VM_SCREEN_H_ -#include -#include #include #define VM_SCREEN_DEFWIDTH 800 @@ -17,8 +15,6 @@ vm_screen_draw_rect(screen, xpos, ypos, 1, 1) typedef struct { - GLFWwindow *window; - /* * These form the components of an RGBA composite color. */ diff --git a/src/vm_screen.c b/src/vm_screen.c index 1f8d438..5c14476 100644 --- a/src/vm_screen.c +++ b/src/vm_screen.c @@ -12,47 +12,15 @@ #include "log.h" #include "vm_screen.h" -/* - * Something to help us remember if we've already initialized glew or - * not. - */ -static bool init_glew = false; - -/* - * Initialize the glew library, if it is needed -- it may not be. - */ -static void -glew_init() -{ - if (!init_glew) { - glewExperimental = GL_TRUE; - glewInit(); - - init_glew = true; - } -} - int vm_screen_init() { - if (!glfwInit()) { - return ERR_GFXINIT; - } - - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); - - glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); - return OK; } void vm_screen_finish() { - glfwTerminate(); } /* @@ -76,21 +44,6 @@ vm_screen_create() int vm_screen_add_window(vm_screen *screen) { - screen->window = glfwCreateWindow(VM_SCREEN_DEFWIDTH, - VM_SCREEN_DEFHEIGHT, - "erc", NULL, NULL); - - if (screen->window == NULL) { - log_critical("Could not create a window"); - return ERR_GFXINIT; - } - - glfwMakeContextCurrent(screen->window); - - // glew can only be initialized _after_ the window is built; if you - // do so beforehand, you will be rudely presented with a segfault. - glew_init(); - return OK; } @@ -106,17 +59,12 @@ vm_screen_free(vm_screen *screen) bool vm_screen_active(vm_screen *screen) { - return !glfwWindowShouldClose(screen->window); + return false; } void vm_screen_refresh(vm_screen *screen) { - glClear(GL_COLOR_BUFFER_BIT); - - glfwSwapBuffers(screen->window); - - glfwPollEvents(); } /* diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d410bb4..eafc1e4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -33,4 +33,4 @@ add_executable(erc-test ${sources} ${test_sources}) target_link_libraries(erc-test criterion) # Graphics -target_link_libraries(erc-test ${opengl_library} glfw) +target_link_libraries(erc-test)