From c980a94172da2abe5dc7cf3ea7d755b9e0dc5d19 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 28 Mar 2019 22:55:00 +0000 Subject: non-GL and C++ patch from bowman git-svn-id: svn://tug.org/texlive/trunk@50636 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/utils/asymptote/drawpath3.cc | 2 ++ Build/source/utils/asymptote/drawsurface.cc | 2 ++ Build/source/utils/asymptote/glrender.cc | 6 ++---- Build/source/utils/asymptote/shaders.cc | 10 ++++------ Build/source/utils/asymptote/shaders.h | 3 +-- 5 files changed, 11 insertions(+), 12 deletions(-) (limited to 'Build') 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 #include #include +#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 #include +#ifdef HAVE_GL #include #include #include +#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 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 compilerFlags={}); + size_t Nmaterials, bool explicitcolor=false); #endif -- cgit v1.2.3