diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-27 22:27:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-27 22:27:57 +0000 |
commit | 9121faed0cf54a08882acf41120cf28fc3a32998 (patch) | |
tree | fe7f0c5e9ed02fe4a1fc389c27c88750c2807e43 /Build/source/utils/asymptote/drawelement.h | |
parent | b8e24fbf964b4030f68a8484a53d405869693266 (diff) |
asy 2.48 sources
git-svn-id: svn://tug.org/texlive/trunk@50622 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/drawelement.h')
-rw-r--r-- | Build/source/utils/asymptote/drawelement.h | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/Build/source/utils/asymptote/drawelement.h b/Build/source/utils/asymptote/drawelement.h index cf77fef722b..22aae745524 100644 --- a/Build/source/utils/asymptote/drawelement.h +++ b/Build/source/utils/asymptote/drawelement.h @@ -19,12 +19,13 @@ #include "prcfile.h" #include "glrender.h" #include "arrayop.h" +#include "material.h" namespace camp { //extern double Tx[3]; // x-component of current transform //extern double Ty[3]; // y-component of current transform -extern double Tz[3]; // z-component of current transform +extern double* Tz; // z-component of current transform static const double pixel=1.0; // Adaptive rendering constant. @@ -118,6 +119,10 @@ typedef mem::list<bbox> bboxlist; typedef mem::map<CONST string,unsigned> groupmap; typedef mem::vector<groupmap> groupsmap; +#ifdef HAVE_GL +typedef mem::map<CONST Material,size_t> MaterialMap; +#endif + class drawElement : public gc { public: @@ -128,6 +133,13 @@ public: virtual ~drawElement() {} + +#ifdef HAVE_GL + static mem::vector<Material> material; + static MaterialMap materialMap; + static size_t materialIndex; +#endif + static pen lastpen; static const triple zero; @@ -209,9 +221,8 @@ public: virtual void displacement() {} // Render with OpenGL - virtual void render(GLUnurbs *nurb, double size2, - const triple& Min, const triple& Max, - double perspective, bool lighton, bool transparent) {} + virtual void render(double size2, const triple& Min, const triple& Max, + double perspective, bool transparent) {} // Transform as part of a picture. virtual drawElement *transformed(const transform&) { @@ -373,10 +384,6 @@ public: } void strokepath(psfile *out) { - // strokepath and evenodd are incompatible - static pen zerowinding=pen((FillRule) ZEROWINDING); - pentype=pentype+zerowinding; - out->setpen(pentype); out->strokepath(); } @@ -404,6 +411,23 @@ public: } }; +#ifdef HAVE_GL +template<class T> +void registerBuffer(std::vector<T>& buffervector, GLuint bufferIndex) { + if (!buffervector.empty()) { + glBindBuffer(GL_ARRAY_BUFFER,bufferIndex); + glBufferData(GL_ARRAY_BUFFER,sizeof(T)*buffervector.size(), + buffervector.data(),GL_STATIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER,0); + } +} + +void setcolors(bool colors, + const prc::RGBAColour& diffuse, + const prc::RGBAColour& ambient, + const prc::RGBAColour& emissive, + const prc::RGBAColour& specular, double shininess); +#endif } GC_DECLARE_PTRFREE(camp::box); |