texlive[50636] Build/source/utils/asymptote: non-GL and C++ patch
commits+karl at tug.org
commits+karl at tug.org
Thu Mar 28 23:55:00 CET 2019
Revision: 50636
http://tug.org/svn/texlive?view=revision&revision=50636
Author: karl
Date: 2019-03-28 23:55:00 +0100 (Thu, 28 Mar 2019)
Log Message:
-----------
non-GL and C++ patch from bowman
Modified Paths:
--------------
trunk/Build/source/utils/asymptote/drawpath3.cc
trunk/Build/source/utils/asymptote/drawsurface.cc
trunk/Build/source/utils/asymptote/glrender.cc
trunk/Build/source/utils/asymptote/shaders.cc
trunk/Build/source/utils/asymptote/shaders.h
Modified: trunk/Build/source/utils/asymptote/drawpath3.cc
===================================================================
--- trunk/Build/source/utils/asymptote/drawpath3.cc 2019-03-28 22:22:47 UTC (rev 50635)
+++ trunk/Build/source/utils/asymptote/drawpath3.cc 2019-03-28 22:55:00 UTC (rev 50636)
@@ -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 {
Modified: trunk/Build/source/utils/asymptote/drawsurface.cc
===================================================================
--- trunk/Build/source/utils/asymptote/drawsurface.cc 2019-03-28 22:22:47 UTC (rev 50635)
+++ trunk/Build/source/utils/asymptote/drawsurface.cc 2019-03-28 22:55:00 UTC (rev 50636)
@@ -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"
Modified: trunk/Build/source/utils/asymptote/glrender.cc
===================================================================
--- trunk/Build/source/utils/asymptote/glrender.cc 2019-03-28 22:22:47 UTC (rev 50635)
+++ trunk/Build/source/utils/asymptote/glrender.cc 2019-03-28 22:55:00 UTC (rev 50636)
@@ -1339,11 +1339,9 @@
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);
Modified: trunk/Build/source/utils/asymptote/shaders.cc
===================================================================
--- trunk/Build/source/utils/asymptote/shaders.cc 2019-03-28 22:22:47 UTC (rev 50635)
+++ trunk/Build/source/utils/asymptote/shaders.cc 2019-03-28 22:55:00 UTC (rev 50636)
@@ -46,8 +46,7 @@
}
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,11 +58,10 @@
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";
Modified: trunk/Build/source/utils/asymptote/shaders.h
===================================================================
--- trunk/Build/source/utils/asymptote/shaders.h 2019-03-28 22:22:47 UTC (rev 50635)
+++ trunk/Build/source/utils/asymptote/shaders.h 2019-03-28 22:55:00 UTC (rev 50636)
@@ -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
More information about the tex-live-commits
mailing list