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.
This commit is contained in:
parent
7eb6574f90
commit
ecb6550b5c
@ -43,7 +43,7 @@ set(ENABLE_COVERAGE OFF CACHE BOOL
|
|||||||
set(ENABLE_SANITIZERS OFF CACHE BOOL
|
set(ENABLE_SANITIZERS OFF CACHE BOOL
|
||||||
"Whether to enable Clang's AddressSanitizer and UndefinedBehaviorSanitizer")
|
"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(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
||||||
set(LIBRARY_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)
|
list(APPEND CAIRO_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/extlib/cairo/src)
|
||||||
|
|
||||||
if(ENABLE_GUI)
|
if(ENABLE_GUI)
|
||||||
if(OPENGL STREQUAL "2")
|
if(OPENGL STREQUAL "3")
|
||||||
message(STATUS "Using in-tree ANGLE")
|
message(STATUS "Using in-tree ANGLE")
|
||||||
set(ANGLE_STATIC ON CACHE INTERNAL "")
|
set(ANGLE_STATIC ON CACHE INTERNAL "")
|
||||||
set(ANGLE_ENABLE_D3D9 ON CACHE INTERNAL "")
|
set(ANGLE_ENABLE_D3D9 ON CACHE INTERNAL "")
|
||||||
|
@ -80,10 +80,10 @@ if(SPACEWARE_FOUND)
|
|||||||
${SPACEWARE_INCLUDE_DIR})
|
${SPACEWARE_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(OPENGL STREQUAL 2)
|
if(OPENGL STREQUAL 3)
|
||||||
set(gl_SOURCES
|
set(gl_SOURCES
|
||||||
render/gl2shader.cpp
|
render/gl3shader.cpp
|
||||||
render/rendergl2.cpp)
|
render/rendergl3.cpp)
|
||||||
elseif(OPENGL STREQUAL 1)
|
elseif(OPENGL STREQUAL 1)
|
||||||
set(gl_SOURCES
|
set(gl_SOURCES
|
||||||
render/rendergl1.cpp)
|
render/rendergl1.cpp)
|
||||||
@ -143,7 +143,7 @@ set(solvespace_core_HEADERS
|
|||||||
ui.h
|
ui.h
|
||||||
platform/platform.h
|
platform/platform.h
|
||||||
render/render.h
|
render/render.h
|
||||||
render/gl2shader.h
|
render/gl3shader.h
|
||||||
srf/surface.h)
|
srf/surface.h)
|
||||||
|
|
||||||
set(solvespace_core_SOURCES
|
set(solvespace_core_SOURCES
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
# undef uint32_t // thanks but no thanks
|
# undef uint32_t // thanks but no thanks
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_OPENGL == 2
|
#if HAVE_OPENGL == 3
|
||||||
#define EGLAPI /*static linkage*/
|
#define EGLAPI /*static linkage*/
|
||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
#endif
|
#endif
|
||||||
@ -40,7 +40,7 @@ HINSTANCE Instance;
|
|||||||
HWND TextWnd;
|
HWND TextWnd;
|
||||||
HWND TextWndScrollBar;
|
HWND TextWndScrollBar;
|
||||||
HWND TextEditControl;
|
HWND TextEditControl;
|
||||||
#if HAVE_OPENGL == 2
|
#if HAVE_OPENGL == 3
|
||||||
EGLDisplay TextGlDisplay;
|
EGLDisplay TextGlDisplay;
|
||||||
EGLSurface TextGlSurface;
|
EGLSurface TextGlSurface;
|
||||||
EGLContext TextGlContext;
|
EGLContext TextGlContext;
|
||||||
@ -50,7 +50,7 @@ HGLRC TextGl;
|
|||||||
|
|
||||||
HWND GraphicsWnd;
|
HWND GraphicsWnd;
|
||||||
HWND GraphicsEditControl;
|
HWND GraphicsEditControl;
|
||||||
#if HAVE_OPENGL == 2
|
#if HAVE_OPENGL == 3
|
||||||
EGLDisplay GraphicsGlDisplay;
|
EGLDisplay GraphicsGlDisplay;
|
||||||
EGLSurface GraphicsGlSurface;
|
EGLSurface GraphicsGlSurface;
|
||||||
EGLContext GraphicsGlContext;
|
EGLContext GraphicsGlContext;
|
||||||
@ -457,7 +457,7 @@ void SolveSpace::SetMousePointerToHand(bool yes) {
|
|||||||
|
|
||||||
static void PaintTextWnd()
|
static void PaintTextWnd()
|
||||||
{
|
{
|
||||||
#if HAVE_OPENGL == 2
|
#if HAVE_OPENGL == 3
|
||||||
eglMakeCurrent(TextGlDisplay, TextGlSurface, TextGlSurface, TextGlContext);
|
eglMakeCurrent(TextGlDisplay, TextGlSurface, TextGlSurface, TextGlContext);
|
||||||
|
|
||||||
SS.TW.Paint();
|
SS.TW.Paint();
|
||||||
@ -760,7 +760,7 @@ void SolveSpace::ShowTextWindow(bool visible)
|
|||||||
ShowWindow(TextWnd, visible ? SW_SHOWNOACTIVATE : SW_HIDE);
|
ShowWindow(TextWnd, visible ? SW_SHOWNOACTIVATE : SW_HIDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_OPENGL == 2
|
#if HAVE_OPENGL == 3
|
||||||
static void CreateGlContext(HWND hwnd, EGLDisplay *eglDisplay, EGLSurface *eglSurface,
|
static void CreateGlContext(HWND hwnd, EGLDisplay *eglDisplay, EGLSurface *eglSurface,
|
||||||
EGLContext *eglContext) {
|
EGLContext *eglContext) {
|
||||||
ssassert(eglBindAPI(EGL_OPENGL_ES_API), "Cannot bind EGL API");
|
ssassert(eglBindAPI(EGL_OPENGL_ES_API), "Cannot bind EGL API");
|
||||||
@ -830,7 +830,7 @@ static void CreateGlContext(HWND hwnd, HGLRC *glrc)
|
|||||||
void SolveSpace::PaintGraphics()
|
void SolveSpace::PaintGraphics()
|
||||||
{
|
{
|
||||||
SS.GW.Paint();
|
SS.GW.Paint();
|
||||||
#if HAVE_OPENGL == 2
|
#if HAVE_OPENGL == 3
|
||||||
eglSwapBuffers(GraphicsGlDisplay, GraphicsGlSurface);
|
eglSwapBuffers(GraphicsGlDisplay, GraphicsGlSurface);
|
||||||
#else
|
#else
|
||||||
SwapBuffers(GetDC(GraphicsWnd));
|
SwapBuffers(GetDC(GraphicsWnd));
|
||||||
@ -1422,7 +1422,7 @@ static void CreateMainWindows()
|
|||||||
WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS,
|
WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS,
|
||||||
50, 50, 100, 21, TextWnd, NULL, Instance, NULL);
|
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.
|
// Now that all our windows exist, set up gl contexts.
|
||||||
CreateGlContext(TextWnd, &TextGlDisplay, &TextGlSurface, &TextGlContext);
|
CreateGlContext(TextWnd, &TextGlDisplay, &TextGlSurface, &TextGlContext);
|
||||||
CreateGlContext(GraphicsWnd, &GraphicsGlDisplay, &GraphicsGlSurface, &GraphicsGlContext);
|
CreateGlContext(GraphicsWnd, &GraphicsGlDisplay, &GraphicsGlSurface, &GraphicsGlContext);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// Copyright 2016 Aleksey Egorov
|
// Copyright 2016 Aleksey Egorov
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
#include "solvespace.h"
|
#include "solvespace.h"
|
||||||
#include "gl2shader.h"
|
#include "gl3shader.h"
|
||||||
|
|
||||||
namespace SolveSpace {
|
namespace SolveSpace {
|
||||||
|
|
@ -3,8 +3,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2016 Aleksey Egorov
|
// Copyright 2016 Aleksey Egorov
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
#ifndef SOLVESPACE_GL2UTILS_H
|
#ifndef SOLVESPACE_GL3SHADER_H
|
||||||
#define SOLVESPACE_GL2UTILS_H
|
#define SOLVESPACE_GL3SHADER_H
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
# define GL_APICALL /*static linkage*/
|
# define GL_APICALL /*static linkage*/
|
@ -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) {
|
void OpenGl1Renderer::DrawLine(const Vector &a, const Vector &b, hStroke hcs) {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// Copyright 2016 Aleksey Egorov
|
// Copyright 2016 Aleksey Egorov
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
#include "solvespace.h"
|
#include "solvespace.h"
|
||||||
#include "gl2shader.h"
|
#include "gl3shader.h"
|
||||||
|
|
||||||
namespace SolveSpace {
|
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 {
|
class OpenGl2Renderer : public ViewportCanvas {
|
||||||
public:
|
public:
|
||||||
struct SEdgeListItem {
|
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() {
|
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 {
|
class DrawCall {
|
Loading…
Reference in New Issue
Block a user