summaryrefslogtreecommitdiff
path: root/src/render/mobileopenglgraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-23 12:07:25 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-23 12:08:54 +0300
commit906332df8779bca71641c6bcdc84d04a1de6d2eb (patch)
tree3571dab23663919ed9c6536c19ba14e850ab4581 /src/render/mobileopenglgraphics.cpp
parentdee232be436909e84a39e9bc3e8949dbaba38e05 (diff)
downloadmv-906332df8779bca71641c6bcdc84d04a1de6d2eb.tar.gz
mv-906332df8779bca71641c6bcdc84d04a1de6d2eb.tar.bz2
mv-906332df8779bca71641c6bcdc84d04a1de6d2eb.tar.xz
mv-906332df8779bca71641c6bcdc84d04a1de6d2eb.zip
Add functions for resize batch size (OpenGL).
Diffstat (limited to 'src/render/mobileopenglgraphics.cpp')
-rw-r--r--src/render/mobileopenglgraphics.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp
index 8150c4f66..34e5c334c 100644
--- a/src/render/mobileopenglgraphics.cpp
+++ b/src/render/mobileopenglgraphics.cpp
@@ -99,15 +99,12 @@ MobileOpenGLGraphics::MobileOpenGLGraphics():
MobileOpenGLGraphics::~MobileOpenGLGraphics()
{
- delete [] mFloatTexArray;
- delete [] mShortVertArray;
- delete [] mFloatTexArrayCached;
- delete [] mShortVertArrayCached;
+ deleteArraysInternal();
}
-void MobileOpenGLGraphics::initArrays()
+void MobileOpenGLGraphics::initArrays(const int vertCount)
{
- mMaxVertices = graphicsManager.getMaxVertices();
+ mMaxVertices = vertCount;
if (mMaxVertices < 500)
mMaxVertices = 500;
else if (mMaxVertices > 1024)
@@ -126,6 +123,23 @@ void MobileOpenGLGraphics::initArrays()
mShortVertArrayCached = new GLshort[sz];
}
+void MobileOpenGLGraphics::deleteArrays()
+{
+ deleteArraysInternal();
+}
+
+void MobileOpenGLGraphics::deleteArraysInternal()
+{
+ delete [] mFloatTexArray;
+ mFloatTexArray = nullptr;
+ delete [] mShortVertArray;
+ mShortVertArray = nullptr;
+ delete [] mFloatTexArrayCached;
+ mFloatTexArrayCached = nullptr;
+ delete [] mShortVertArrayCached;
+ mShortVertArrayCached = nullptr;
+}
+
bool MobileOpenGLGraphics::setVideoMode(const int w, const int h,
const int scale,
const int bpp,