19 #ifndef RE_ElementArray_h
20 #define RE_ElementArray_h
31 class re_ElementChunk;
43 int64 getMemoryUsage(
bool inclusive)
const;
46 void setCacheName(
const char *cachename);
64 void setPrimitiveType(
RE_PrimType type,
int vertices_per_patch = 0);
68 void setNumPoints(
int points);
73 void tessellateToTriangles(
bool enable);
77 void requirePrimInfo(
bool enable);
81 void requireVertexInfo(
bool enable);
91 bool clear_old =
false,
92 int num_vertex_hint = 0);
97 bool addPrim(
RE_Render *r,
int npnts,
int *pnt_indices,
98 int *prim_info =
nullptr,
99 uint8 *vert_info =
nullptr,
104 bool addPrims(
RE_Render *r,
int npnts,
int *prim_indices,
105 int *prim_info =
nullptr,
106 uint8 *vert_info =
nullptr,
107 bool simple_pindex =
false,
108 int pindex_start = 0);
111 bool addTriangle(
RE_Render *r,
int *pnt_indices,
int *prim_info,
118 bool addTriangleChunk(
RE_Render *r,
int num_triangles,
119 const int *pnt_indices,
120 const int *prim_info =
nullptr,
121 const uint8 *vert_info =
nullptr);
131 void drawInstanced(
RE_Render *r,
int num_instances,
138 int getMinEdges()
const;
139 int getMaxEdges()
const;
144 int getNumArrays()
const;
146 int getNumVertices()
const;
147 int getNumOrigVertices()
const;
153 int64 getSizeBytes()
const;
159 void print(std::ostream &os);
162 void completeElementBuffer(
RE_Render *r);
165 void drawPrivate(
RE_Render *r,
int num_instances,
168 void bumpBufferSizes(
int nprims);
174 bool myUseBaseVertex;
176 bool myUsePrimRestart;
177 bool myLineSegmentMode;
179 bool myRequirePrimInfo;
180 bool myRequireVertInfo;
181 bool myTessellateToTriangles;
187 int myNumOrigVertices;
189 int myVerticesPerPatch;
201 int *myElementBuffer;
203 int myHasGeoPrimInfo;
206 int *myPrimInfoBuffer;
208 int myHasGeoVertInfo;
218 int myLastShaderSerial;
219 int myLastShaderPrimInfoIndex;
220 int myLastShaderVertInfoIndex;
227 return myMinPrimEdges;
233 return myMaxPrimEdges;
245 drawPrivate(r, 0, geo, prim);
256 drawPrivate(r, num_instances, geo, prim);
GLdouble GLdouble GLint GLint const GLdouble * points
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
int getVerticesPerPatch() const
RE_PrimType getPrimitiveType() const
GLint GLint GLsizei GLint GLenum GLenum type
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
void draw(RE_Render *r, RE_Geometry *geo=nullptr, RE_PrimType prim=RE_PRIM_AS_IS)
bool hasGLExtension(RE_Extension e) const
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
int getNumPrimitives() const
Simple class for a mutli-integer cache tag.
void drawInstanced(RE_Render *r, int num_instances, RE_Geometry *geo=nullptr, RE_PrimType prim=RE_PRIM_AS_IS)
FMT_INLINE void print(format_string< T...> fmt, T &&...args)