From ecb6550b5c126aab1624dc3a3c96b0f956b70a56 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 6 Apr 2017 07:11:23 +0000 Subject: [PATCH] Change mentions of OpenGL 2 to OpenGL 3. We ended up in a confusing state where OpenGL 2 (like in "gl2") actually refers to OpenGL ES 2, which roughly corresponds to OpenGL 3. Rectify that. --- CMakeLists.txt | 4 ++-- src/CMakeLists.txt | 8 ++++---- src/platform/w32main.cpp | 14 +++++++------- src/render/{gl2shader.cpp => gl3shader.cpp} | 2 +- src/render/{gl2shader.h => gl3shader.h} | 4 ++-- src/render/rendergl1.cpp | 2 +- src/render/{rendergl2.cpp => rendergl3.cpp} | 8 ++++---- 7 files changed, 21 insertions(+), 21 deletions(-) rename src/render/{gl2shader.cpp => gl3shader.cpp} (99%) rename src/render/{gl2shader.h => gl3shader.h} (99%) rename src/render/{rendergl2.cpp => rendergl3.cpp} (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ff97f97..b8c1d89d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ set(ENABLE_COVERAGE OFF CACHE BOOL set(ENABLE_SANITIZERS OFF CACHE BOOL "Whether to enable Clang's AddressSanitizer and UndefinedBehaviorSanitizer") -set(OPENGL 2 CACHE STRING "OpenGL version to use (one of: 1 2)") +set(OPENGL 3 CACHE STRING "OpenGL version to use (one of: 1 3)") set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) @@ -137,7 +137,7 @@ if(WIN32) list(APPEND CAIRO_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/extlib/cairo/src) if(ENABLE_GUI) - if(OPENGL STREQUAL "2") + if(OPENGL STREQUAL "3") message(STATUS "Using in-tree ANGLE") set(ANGLE_STATIC ON CACHE INTERNAL "") set(ANGLE_ENABLE_D3D9 ON CACHE INTERNAL "") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cff58c28..19f5e3f5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -80,10 +80,10 @@ if(SPACEWARE_FOUND) ${SPACEWARE_INCLUDE_DIR}) endif() -if(OPENGL STREQUAL 2) +if(OPENGL STREQUAL 3) set(gl_SOURCES - render/gl2shader.cpp - render/rendergl2.cpp) + render/gl3shader.cpp + render/rendergl3.cpp) elseif(OPENGL STREQUAL 1) set(gl_SOURCES render/rendergl1.cpp) @@ -143,7 +143,7 @@ set(solvespace_core_HEADERS ui.h platform/platform.h render/render.h - render/gl2shader.h + render/gl3shader.h srf/surface.h) set(solvespace_core_SOURCES diff --git a/src/platform/w32main.cpp b/src/platform/w32main.cpp index d9df8c32..4175cd38 100644 --- a/src/platform/w32main.cpp +++ b/src/platform/w32main.cpp @@ -27,7 +27,7 @@ # undef uint32_t // thanks but no thanks #endif -#if HAVE_OPENGL == 2 +#if HAVE_OPENGL == 3 #define EGLAPI /*static linkage*/ #include #endif @@ -40,7 +40,7 @@ HINSTANCE Instance; HWND TextWnd; HWND TextWndScrollBar; HWND TextEditControl; -#if HAVE_OPENGL == 2 +#if HAVE_OPENGL == 3 EGLDisplay TextGlDisplay; EGLSurface TextGlSurface; EGLContext TextGlContext; @@ -50,7 +50,7 @@ HGLRC TextGl; HWND GraphicsWnd; HWND GraphicsEditControl; -#if HAVE_OPENGL == 2 +#if HAVE_OPENGL == 3 EGLDisplay GraphicsGlDisplay; EGLSurface GraphicsGlSurface; EGLContext GraphicsGlContext; @@ -457,7 +457,7 @@ void SolveSpace::SetMousePointerToHand(bool yes) { static void PaintTextWnd() { -#if HAVE_OPENGL == 2 +#if HAVE_OPENGL == 3 eglMakeCurrent(TextGlDisplay, TextGlSurface, TextGlSurface, TextGlContext); SS.TW.Paint(); @@ -760,7 +760,7 @@ void SolveSpace::ShowTextWindow(bool visible) ShowWindow(TextWnd, visible ? SW_SHOWNOACTIVATE : SW_HIDE); } -#if HAVE_OPENGL == 2 +#if HAVE_OPENGL == 3 static void CreateGlContext(HWND hwnd, EGLDisplay *eglDisplay, EGLSurface *eglSurface, EGLContext *eglContext) { ssassert(eglBindAPI(EGL_OPENGL_ES_API), "Cannot bind EGL API"); @@ -830,7 +830,7 @@ static void CreateGlContext(HWND hwnd, HGLRC *glrc) void SolveSpace::PaintGraphics() { SS.GW.Paint(); -#if HAVE_OPENGL == 2 +#if HAVE_OPENGL == 3 eglSwapBuffers(GraphicsGlDisplay, GraphicsGlSurface); #else SwapBuffers(GetDC(GraphicsWnd)); @@ -1422,7 +1422,7 @@ static void CreateMainWindows() WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS, 50, 50, 100, 21, TextWnd, NULL, Instance, NULL); -#if HAVE_OPENGL == 2 +#if HAVE_OPENGL == 3 // Now that all our windows exist, set up gl contexts. CreateGlContext(TextWnd, &TextGlDisplay, &TextGlSurface, &TextGlContext); CreateGlContext(GraphicsWnd, &GraphicsGlDisplay, &GraphicsGlSurface, &GraphicsGlContext); diff --git a/src/render/gl2shader.cpp b/src/render/gl3shader.cpp similarity index 99% rename from src/render/gl2shader.cpp rename to src/render/gl3shader.cpp index 062bc89a..2ee8bb37 100644 --- a/src/render/gl2shader.cpp +++ b/src/render/gl3shader.cpp @@ -4,7 +4,7 @@ // Copyright 2016 Aleksey Egorov //----------------------------------------------------------------------------- #include "solvespace.h" -#include "gl2shader.h" +#include "gl3shader.h" namespace SolveSpace { diff --git a/src/render/gl2shader.h b/src/render/gl3shader.h similarity index 99% rename from src/render/gl2shader.h rename to src/render/gl3shader.h index ab7138f4..86e87b45 100644 --- a/src/render/gl2shader.h +++ b/src/render/gl3shader.h @@ -3,8 +3,8 @@ // // Copyright 2016 Aleksey Egorov //----------------------------------------------------------------------------- -#ifndef SOLVESPACE_GL2UTILS_H -#define SOLVESPACE_GL2UTILS_H +#ifndef SOLVESPACE_GL3SHADER_H +#define SOLVESPACE_GL3SHADER_H #ifdef WIN32 # define GL_APICALL /*static linkage*/ diff --git a/src/render/rendergl1.cpp b/src/render/rendergl1.cpp index 96b3297c..edc21347 100644 --- a/src/render/rendergl1.cpp +++ b/src/render/rendergl1.cpp @@ -465,7 +465,7 @@ void OpenGl1Renderer::DoStippledLine(const Vector &a, const Vector &b, hStroke h } //----------------------------------------------------------------------------- -// A canvas implemented using OpenGL 2 immediate mode. +// A canvas implemented using OpenGL 3 immediate mode. //----------------------------------------------------------------------------- void OpenGl1Renderer::DrawLine(const Vector &a, const Vector &b, hStroke hcs) { diff --git a/src/render/rendergl2.cpp b/src/render/rendergl3.cpp similarity index 99% rename from src/render/rendergl2.cpp rename to src/render/rendergl3.cpp index 30cb7ebe..3256691c 100644 --- a/src/render/rendergl2.cpp +++ b/src/render/rendergl3.cpp @@ -4,7 +4,7 @@ // Copyright 2016 Aleksey Egorov //----------------------------------------------------------------------------- #include "solvespace.h" -#include "gl2shader.h" +#include "gl3shader.h" namespace SolveSpace { @@ -39,7 +39,7 @@ public: } }; -// A canvas that uses the core OpenGL 2 profile, for desktop systems. +// A canvas that uses the core OpenGL 3 profile, for desktop systems. class OpenGl2Renderer : public ViewportCanvas { public: struct SEdgeListItem { @@ -419,7 +419,7 @@ void OpenGl2Renderer::DoStippledLine(const Vector &a, const Vector &b, hStroke h } //----------------------------------------------------------------------------- -// A canvas implemented using OpenGL 2 vertex buffer objects. +// A canvas implemented using OpenGL 3 vertex buffer objects. //----------------------------------------------------------------------------- void OpenGl2Renderer::Init() { @@ -692,7 +692,7 @@ void OpenGl2Renderer::SetLighting(const Lighting &l) { } //----------------------------------------------------------------------------- -// A batch canvas implemented using OpenGL 2 vertex buffer objects. +// A batch canvas implemented using OpenGL 3 vertex buffer objects. //----------------------------------------------------------------------------- class DrawCall {