Skip to content

Commit

Permalink
Remove support for OpenGL < 2
Browse files Browse the repository at this point in the history
  • Loading branch information
kintel committed Mar 13, 2023
1 parent dbb29a2 commit 1f5c79e
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions src/glview/GLView.cc
Expand Up @@ -7,11 +7,6 @@
#include "degree_trig.h"
#include <cmath>
#include <cstdio>
#ifdef _WIN32
#include <GL/wglew.h>
#elif !defined(__APPLE__)
#include <GL/glxew.h>
#endif

#ifdef ENABLE_OPENCSG
#include <opencsg.h>
Expand Down Expand Up @@ -202,33 +197,12 @@ void glCompileCheck(GLuint shader) {

void GLView::enable_opencsg_shaders()
{
const char *openscad_disable_gl20_env = getenv("OPENSCAD_DISABLE_GL20");
if (openscad_disable_gl20_env && !strcmp(openscad_disable_gl20_env, "0")) {
openscad_disable_gl20_env = nullptr;
}

// All OpenGL 2 contexts are OpenCSG capable
if (GLEW_VERSION_2_0) {
if (!openscad_disable_gl20_env) {
this->is_opencsg_capable = true;
this->has_shaders = true;
}
this->is_opencsg_capable = true;
this->has_shaders = true;
}
#ifndef GLEW_EGL
// If OpenGL < 2, check for extensions
else if (GLEW_ARB_framebuffer_object || (GLEW_EXT_framebuffer_object && GLEW_EXT_packed_depth_stencil)
#ifdef _WIN32
|| (WGLEW_ARB_pbuffer && WGLEW_ARB_pixel_format)
#elif !defined(__APPLE__)
// not supported by GLEW when built with EGL
|| (GLXEW_SGIX_pbuffer && GLXEW_SGIX_fbconfig)
#endif
) {
this->is_opencsg_capable = true;
}
#endif // ifndef GLEW_EGL

if (!GLEW_VERSION_2_0 || !this->is_opencsg_capable) {
else {
display_opencsg_warning();
}
}
Expand Down

0 comments on commit 1f5c79e

Please sign in to comment.