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.
pull/238/head
whitequark 2017-04-06 07:11:23 +00:00
parent 7eb6574f90
commit ecb6550b5c
7 changed files with 21 additions and 21 deletions

View File

@ -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 "")

View File

@ -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

View File

@ -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 <EGL/egl.h>
#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);

View File

@ -4,7 +4,7 @@
// Copyright 2016 Aleksey Egorov
//-----------------------------------------------------------------------------
#include "solvespace.h"
#include "gl2shader.h"
#include "gl3shader.h"
namespace SolveSpace {

View File

@ -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*/

View File

@ -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) {

View File

@ -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 {