diff --git a/Makefile b/Makefile index c26c7f3..ca5aeee 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ LINKFLAGS := -pthread -lAntTweakBar $(shell sdl2-config --libs) $(shell freetype ARCH = $(shell uname -s) ifeq ($(ARCH),Linux) -LINKFLAGS += -lGLEW -lGL +LINKFLAGS += -lepoxy -lGL else ifeq ($(ARCH),Darwin) LINKFLAGS += -framework OpenGL @@ -74,7 +74,6 @@ OFILES=\ solid.o \ cloud.o \ final.o \ - glprocs.o \ myTwEventSDL20.o \ icon.o \ widget.o \ diff --git a/glprocs.cc b/glprocs.cc deleted file mode 100644 index 0f3dd52..0000000 --- a/glprocs.cc +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of the Electron Orbital Explorer. The Electron - * Orbital Explorer is distributed under the Simplified BSD License - * (also called the "BSD 2-Clause License"), in hopes that these - * rendering techniques might be used by other programmers in - * applications such as scientific visualization, video gaming, and so - * on. If you find value in this software and use its technologies for - * another purpose, I would love to hear back from you at bjthinks (at) - * gmail (dot) com. If you improve this software and agree to release - * your modifications under the below license, I encourage you to fork - * the development tree on github and push your modifications. The - * Electron Orbital Explorer's development URL is: - * https://github.com/bjthinks/orbital-explorer - * (This paragraph is not part of the software license and may be - * removed.) - * - * Copyright (c) 2013, Brian W. Johnson - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * + Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * + Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include - -#include "glprocs.hh" - -void initGLProcs() -{ -#ifndef __APPLE__ - GLenum glewInitResult = glewInit(); - if (glewInitResult != GLEW_OK) { - fprintf(stderr, "glewInit(): %s\n", glewGetErrorString(glewInitResult)); - exit(1); - } -#endif -} diff --git a/glprocs.hh b/glprocs.hh index 5ff2d8d..e28b1b7 100644 --- a/glprocs.hh +++ b/glprocs.hh @@ -49,9 +49,7 @@ #ifdef __APPLE__ #include #else -#include +#include #endif -void initGLProcs(); - #endif diff --git a/sdl_main.cc b/sdl_main.cc index 6128efa..2743557 100644 --- a/sdl_main.cc +++ b/sdl_main.cc @@ -97,13 +97,10 @@ static int go() set_sdl_attr(SDL_GL_MULTISAMPLEBUFFERS, 1); set_sdl_attr(SDL_GL_MULTISAMPLESAMPLES, 4); -#ifdef __APPLE__ - // Apple defaults to an OpenGL 2.1 Compatibility context unless you - // specify otherwise. + // Use an OpenGL 3.2 Core Profile context. set_sdl_attr(SDL_GL_CONTEXT_MAJOR_VERSION, 3); set_sdl_attr(SDL_GL_CONTEXT_MINOR_VERSION, 2); set_sdl_attr(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); -#endif Viewport viewport(640, 480); @@ -128,12 +125,6 @@ static int go() exit(1); } - // - // Get access to OpenGL functions - // - - initGLProcs(); - // // Initialize orbital rendering pipeline //