summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-03-28 22:55:00 +0000
committerKarl Berry <karl@freefriends.org>2019-03-28 22:55:00 +0000
commitc980a94172da2abe5dc7cf3ea7d755b9e0dc5d19 (patch)
tree184e3a2d52714afe8727e4a526353acb0d3a8589 /Build/source
parenta1d1540c2ab9ebd6f45819df58e3dbaf4cf6d167 (diff)
non-GL and C++ patch from bowman
git-svn-id: svn://tug.org/texlive/trunk@50636 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/utils/asymptote/drawpath3.cc2
-rw-r--r--Build/source/utils/asymptote/drawsurface.cc2
-rw-r--r--Build/source/utils/asymptote/glrender.cc6
-rw-r--r--Build/source/utils/asymptote/shaders.cc10
-rw-r--r--Build/source/utils/asymptote/shaders.h3
5 files changed, 11 insertions, 12 deletions
diff --git a/Build/source/utils/asymptote/drawpath3.cc b/Build/source/utils/asymptote/drawpath3.cc
index 878a58a66fb..22e5c918996 100644
--- a/Build/source/utils/asymptote/drawpath3.cc
+++ b/Build/source/utils/asymptote/drawpath3.cc
@@ -8,9 +8,11 @@
#include "drawsurface.h"
#include "material.h"
+#ifdef HAVE_GL
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
+#endif
namespace camp {
diff --git a/Build/source/utils/asymptote/drawsurface.cc b/Build/source/utils/asymptote/drawsurface.cc
index 892e3de1eef..80b77117c12 100644
--- a/Build/source/utils/asymptote/drawsurface.cc
+++ b/Build/source/utils/asymptote/drawsurface.cc
@@ -12,9 +12,11 @@
#include <iomanip>
#include <fstream>
+#ifdef HAVE_GL
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
+#endif
using namespace prc;
#include "material.h"
diff --git a/Build/source/utils/asymptote/glrender.cc b/Build/source/utils/asymptote/glrender.cc
index ab5f1383615..ed626bf9bfe 100644
--- a/Build/source/utils/asymptote/glrender.cc
+++ b/Build/source/utils/asymptote/glrender.cc
@@ -1339,11 +1339,9 @@ void initshader()
shaderProgColor=glCreateProgram();
vertShaderCol=createShaderFile(vs.c_str(),
- GL_VERTEX_SHADER,Nlights,Nmaterials,
- {"EXPLICIT_COLOR"});
+ GL_VERTEX_SHADER,Nlights,Nmaterials,true);
fragShaderCol=createShaderFile(fs.c_str(),
- GL_FRAGMENT_SHADER,Nlights,Nmaterials,
- {"EXPLICIT_COLOR"});
+ GL_FRAGMENT_SHADER,Nlights,Nmaterials,true);
glAttachShader(shaderProgColor,vertShaderCol);
glAttachShader(shaderProgColor,fragShaderCol);
diff --git a/Build/source/utils/asymptote/shaders.cc b/Build/source/utils/asymptote/shaders.cc
index 5d7ea6ad6fb..dc8936fa447 100644
--- a/Build/source/utils/asymptote/shaders.cc
+++ b/Build/source/utils/asymptote/shaders.cc
@@ -46,8 +46,7 @@ GLuint createShaders(GLchar const* src, int shaderType)
}
GLuint createShaderFile(std::string file, int shaderType, size_t Nlights,
- size_t Nmaterials,
- std::unordered_set<std::string> compilerFlags)
+ size_t Nmaterials, bool explicitcolor)
{
std::ifstream shaderFile;
shaderFile.open(file);
@@ -59,10 +58,9 @@ GLuint createShaderFile(std::string file, int shaderType, size_t Nlights,
shaderSrc << "#extension GL_ARB_shading_language_packing : enable"
<< "\r\n";
- for(std::string const& flag : compilerFlags)
- {
- shaderSrc << "#define " << flag << "\r\n";
- }
+
+ if(explicitcolor)
+ shaderSrc << "#define EXPLICIT_COLOR" << "\r\n";
shaderSrc << "const int Nlights=" << Nlights << ";\r\n";
shaderSrc << "const int Nmaterials=" << Nmaterials << ";\r\n";
diff --git a/Build/source/utils/asymptote/shaders.h b/Build/source/utils/asymptote/shaders.h
index 1151de667e9..0c261ffc315 100644
--- a/Build/source/utils/asymptote/shaders.h
+++ b/Build/source/utils/asymptote/shaders.h
@@ -20,6 +20,5 @@
GLuint createShaders(GLchar const *src, int shaderType);
GLuint createShaderFile(std::string file, int shaderType, size_t Nlights,
- size_t Nmaterials,
- std::unordered_set<std::string> compilerFlags={});
+ size_t Nmaterials, bool explicitcolor=false);
#endif