Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/Source Code/Hardware/Video/OpenGL/Buffers/PixelBuffer/glPixelBuffer.cpp

Diff revisions: vs.
  @@ -94,7 +94,13 @@
94 94 GL_API::bindTexture(unit, _textureId, _textureType);
95 95 }
96 96
97 - bool glPixelBuffer::Create(GLushort width, GLushort height,GLushort depth, GFXImageFormat internalFormatEnum, GFXImageFormat formatEnum,GFXDataFormat dataTypeEnum) {
97 + bool glPixelBuffer::Create(GLushort width,
98 + GLushort height,
99 + GLushort depth,
100 + GFXImageFormat internalFormatEnum,
101 + GFXImageFormat formatEnum,
102 + GFXDataFormat dataTypeEnum) {
103 +
98 104 _internalFormat = GLUtil::GL_ENUM_TABLE::glImageFormatTable[internalFormatEnum];
99 105 _format = GLUtil::GL_ENUM_TABLE::glImageFormatTable[formatEnum];
100 106 _dataType = GLUtil::GL_ENUM_TABLE::glDataFormat[dataTypeEnum];
  @@ -131,13 +137,13 @@
131 137 void *pixels = nullptr;
132 138
133 139 switch(_dataType){
134 - default: pixels = New GLubyte[size]; break;
135 - case GL_FLOAT: pixels = New GLfloat[size]; break;
136 - case GL_UNSIGNED_INT: pixels = New GLuint[size]; break;
137 - case GL_UNSIGNED_SHORT: pixels = New GLushort[size]; break;
138 - case GL_BYTE: pixels = New GLbyte[size]; break;
139 - case GL_SHORT: pixels = New GLshort[size]; break;
140 - case GL_INT: pixels = New GLint[size]; break;
140 + default : pixels = MemoryManager_NEW GLubyte[size]; break;
141 + case GL_FLOAT : pixels = MemoryManager_NEW GLfloat[size]; break;
142 + case GL_UNSIGNED_INT : pixels = MemoryManager_NEW GLuint[size]; break;
143 + case GL_UNSIGNED_SHORT : pixels = MemoryManager_NEW GLushort[size]; break;
144 + case GL_BYTE : pixels = MemoryManager_NEW GLbyte[size]; break;
145 + case GL_SHORT : pixels = MemoryManager_NEW GLshort[size]; break;
146 + case GL_INT : pixels = MemoryManager_NEW GLint[size]; break;
141 147 };
142 148
143 149 memset(pixels, 0, size * sizeOf(_dataType) );
  @@ -153,7 +159,7 @@
153 159 glTexImage3D(_textureType, 0, _internalFormat, _width, _height,_depth, 0, _format, _dataType, pixels);
154 160 break;
155 161 };
156 - MemoryManager::SAFE_DELETE_ARRAY( pixels );
162 + MemoryManager::DELETE_ARRAY( pixels );
157 163
158 164 glGenBuffers(1, &_pixelBufferHandle);
159 165 GL_API::setActiveBuffer(GL_PIXEL_UNPACK_BUFFER, _pixelBufferHandle);