diff options
Diffstat (limited to 'Build/source/utils/asymptote/glrender.h')
-rw-r--r-- | Build/source/utils/asymptote/glrender.h | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/Build/source/utils/asymptote/glrender.h b/Build/source/utils/asymptote/glrender.h index 53f121b1c59..47388b748a0 100644 --- a/Build/source/utils/asymptote/glrender.h +++ b/Build/source/utils/asymptote/glrender.h @@ -8,6 +8,7 @@ #include "common.h" #include "triple.h" +#include "pen.h" #ifdef HAVE_LIBGLM #define GLM_ENABLE_EXPERIMENTAL @@ -34,25 +35,36 @@ #ifdef __APPLE__ #define GL_SILENCE_DEPRECATION #include <OpenGL/gl.h> + #ifdef HAVE_LIBGLUT #include <GLUT/glut.h> +#ifndef GLUT_3_2_CORE_PROFILE +#undef HAVE_GL +#endif + #endif + #ifdef HAVE_LIBOSMESA #include <GL/osmesa.h> #endif + #else + #ifdef __MSDOS__ #undef _WIN32 #include <GL/gl.h> #include <GL/wglew.h> #include <GL/wglext.h> #endif + #ifdef HAVE_LIBGLUT #include <GL/glut.h> #endif + #ifdef HAVE_LIBOSMESA #include <GL/osmesa.h> #endif + #endif #else @@ -241,19 +253,6 @@ public: } }; -class vertexData1 { -public: - GLfloat position[3]; - GLint material; - vertexData1() {}; - vertexData1(const triple& v) { - position[0]=v.getx(); - position[1]=v.gety(); - position[2]=v.getz(); - material=MaterialIndex; - } -}; - class vertexData0 { public: GLfloat position[3]; @@ -270,19 +269,20 @@ public: class vertexBuffer { public: + GLint type; std::vector<vertexData> vertices; std::vector<VertexData> Vertices; - std::vector<vertexData1> vertices1; std::vector<vertexData0> vertices0; std::vector<GLuint> indices; std::vector<Material> materials; std::vector<GLint> materialTable; + vertexBuffer(GLint type=GL_TRIANGLES) : type(type) {} + void clear() { vertices.clear(); Vertices.clear(); - vertices1.clear(); vertices0.clear(); indices.clear(); materials.clear(); @@ -293,10 +293,6 @@ public: vertices0.reserve(nbuffer); } - void reserve1() { - vertices1.reserve(nbuffer); - } - void reserve() { vertices.reserve(Nbuffer); indices.reserve(Nbuffer); @@ -328,13 +324,6 @@ public: return nvertices; } -// Store the vertex v. - GLuint vertex1(const triple &v) { - size_t nvertices=vertices1.size(); - vertices1.push_back(vertexData1(v)); - return nvertices; - } - // Store the pixel v and its width. GLuint vertex0(const triple &v, double width) { size_t nvertices=vertices0.size(); @@ -363,11 +352,6 @@ public: Vertices.insert(Vertices.end(),b.Vertices.begin(),b.Vertices.end()); } - void append1(const vertexBuffer& b) { - appendOffset(indices,b.indices,vertices1.size()); - vertices1.insert(vertices1.end(),b.vertices1.begin(),b.vertices1.end()); - } - void append0(const vertexBuffer& b) { appendOffset(indices,b.indices,vertices0.size()); vertices0.insert(vertices0.end(),b.vertices0.begin(),b.vertices0.end()); |