26 #include "render/graphics.h"
32 OpenGLGraphicsVertexes::OpenGLGraphicsVertexes() :
45 mFloatTexPool.reserve(30);
46 mIntVertPool.reserve(30);
47 mShortVertPool.reserve(30);
48 mIntTexPool.reserve(30);
53 OpenGLGraphicsVertexes::~OpenGLGraphicsVertexes()
60 for (STD_VECTOR<GLfloat*>::iterator it = mFloatTexPool.begin();
61 it != mFloatTexPool.end(); ++ it)
65 mFloatTexPool.clear();
67 for (STD_VECTOR<GLint*>::iterator it = mIntVertPool.begin();
68 it != mIntVertPool.end(); ++ it)
74 for (STD_VECTOR<GLshort*>::iterator it = mShortVertPool.begin();
75 it != mShortVertPool.end(); ++ it)
79 mShortVertPool.clear();
81 for (STD_VECTOR<GLint*>::iterator it = mIntTexPool.begin();
82 it != mIntTexPool.end(); ++ it)
88 const int sz =
CAST_S32(mVbo.size());
99 delete []mFloatTexArray;
100 mFloatTexArray =
nullptr;
101 delete []mIntTexArray;
102 mIntTexArray =
nullptr;
103 delete []mIntVertArray;
104 mIntVertArray =
nullptr;
105 delete []mShortVertArray;
106 mShortVertArray =
nullptr;
115 GLfloat *OpenGLGraphicsVertexes::switchFloatTexArray()
restrict2
118 mFloatTexPool.push_back(mFloatTexArray);
119 return mFloatTexArray;
122 GLint *OpenGLGraphicsVertexes::switchIntVertArray()
restrict2
125 mIntVertPool.push_back(mIntVertArray);
126 return mIntVertArray;
129 GLshort *OpenGLGraphicsVertexes::switchShortVertArray()
restrict2
132 mShortVertPool.push_back(mShortVertArray);
133 return mShortVertArray;
136 GLint *OpenGLGraphicsVertexes::switchIntTexArray()
restrict2
139 mIntTexPool.push_back(mIntTexArray);
143 void OpenGLGraphicsVertexes::switchVp(
const int n)
restrict2
148 int OpenGLGraphicsVertexes::continueVp()
restrict2
156 const int val = mVp.back();
162 void OpenGLGraphicsVertexes::updateVp(
const int n)
restrict2
169 GLfloat *OpenGLGraphicsVertexes::continueFloatTexArray()
restrict2
171 if (mFloatTexPool.empty())
174 mFloatTexPool.push_back(mFloatTexArray);
178 mFloatTexArray = mFloatTexPool.back();
180 return mFloatTexArray;
183 GLint *OpenGLGraphicsVertexes::continueIntVertArray()
restrict2
185 if (mIntVertPool.empty())
188 mIntVertPool.push_back(mIntVertArray);
192 mIntVertArray = mIntVertPool.back();
194 return mIntVertArray;
197 GLshort *OpenGLGraphicsVertexes::continueShortVertArray()
restrict2
199 if (mShortVertPool.empty())
202 mShortVertPool.push_back(mShortVertArray);
206 mShortVertArray = mShortVertPool.back();
208 return mShortVertArray;
211 GLint *OpenGLGraphicsVertexes::continueIntTexArray()
restrict2
213 if (mIntTexPool.empty())
216 mIntTexPool.push_back(mIntTexArray);
220 mIntTexArray = mIntTexPool.back();
virtual void removeArray(const uint32_t sz, uint32_t *const arr)
unsigned int vertexBufSize