Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: solvespace/solvespace
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a60d4df179e2
Choose a base ref
...
head repository: solvespace/solvespace
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0501f0c99e75
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Nov 26, 2019

  1. Remove unused offscreen GL renderer.

    This was used for Gtk 2 and old macOS, but all of those use direct
    rendering now.
    whitequark committed Nov 26, 2019
    Copy the full SHA
    07992ce View commit details
  2. CMake: update policy to 3.11.

    In particular this enables linking with GLVND on Linux by default.
    whitequark committed Nov 26, 2019
    Copy the full SHA
    22525e6 View commit details
  3. Don't call GL functions in OpenGl3Renderer::GetIdent.

    GetIdent is called from an UI event callback, at which point there
    might well not be an active GL context. Before this commit, that
    would return a NULL pointer and result in a crash.
    whitequark committed Nov 26, 2019
    Copy the full SHA
    0501f0c View commit details
Showing with 11 additions and 78 deletions.
  1. +1 −1 CMakeLists.txt
  2. +0 −16 src/render/render.h
  3. +0 −58 src/render/rendergl.cpp
  4. +10 −3 src/render/rendergl3.cpp
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
endif()

cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR)
cmake_policy(VERSION 3.2.0)
cmake_policy(VERSION 3.11)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake/")
set(CMAKE_CXX_STANDARD 11)
16 changes: 0 additions & 16 deletions src/render/render.h
Original file line number Diff line number Diff line change
@@ -375,22 +375,6 @@ class CairoPixmapRenderer final : public CairoRenderer {
std::shared_ptr<Pixmap> ReadFrame() override;
};

//-----------------------------------------------------------------------------
// 3d renderers
//-----------------------------------------------------------------------------

// An offscreen renderer based on OpenGL framebuffers.
class GlOffscreen {
public:
unsigned int framebuffer = 0;
unsigned int colorRenderbuffer = 0;
unsigned int depthRenderbuffer = 0;
std::vector<uint8_t> data;

bool Render(int width, int height, std::function<void()> renderFn);
void Clear();
};

//-----------------------------------------------------------------------------
// Factories
//-----------------------------------------------------------------------------
58 changes: 0 additions & 58 deletions src/render/rendergl.cpp

This file was deleted.

13 changes: 10 additions & 3 deletions src/render/rendergl3.cpp
Original file line number Diff line number Diff line change
@@ -87,6 +87,9 @@ class OpenGl3Renderer final : public ViewportCanvas {
Fill *fill;
std::weak_ptr<const Pixmap> texture;
} current;
const char *vendor = "<uninitialized>";
const char *renderer = "<uninitialized>";
const char *version = "<uninitialized>";

// List-initialize current to work around MSVC bug 746973.
OpenGl3Renderer() :
@@ -440,6 +443,10 @@ void OpenGl3Renderer::Init() {
meshRenderer.Init();
imeshRenderer.Init();

vendor = (const char *)glGetString(GL_VENDOR);
renderer = (const char *)glGetString(GL_RENDERER);
version = (const char *)glGetString(GL_VERSION);

#if !defined(HAVE_GLES) && !defined(__APPLE__)
GLuint array;
glGenVertexArrays(1, &array);
@@ -696,9 +703,9 @@ std::shared_ptr<Pixmap> OpenGl3Renderer::ReadFrame() {
}

void OpenGl3Renderer::GetIdent(const char **vendor, const char **renderer, const char **version) {
*vendor = (const char *)glGetString(GL_VENDOR);
*renderer = (const char *)glGetString(GL_RENDERER);
*version = (const char *)glGetString(GL_VERSION);
*vendor = this->vendor;
*renderer = this->renderer;
*version = this->version;
}

void OpenGl3Renderer::SetCamera(const Camera &c) {