diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-23 12:07:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-23 12:08:54 +0300 |
commit | 906332df8779bca71641c6bcdc84d04a1de6d2eb (patch) | |
tree | 3571dab23663919ed9c6536c19ba14e850ab4581 /src/render/mobileopenglgraphics.cpp | |
parent | dee232be436909e84a39e9bc3e8949dbaba38e05 (diff) | |
download | mv-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.cpp | 26 |
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, |