StreamBuffer: Make factory function return a std::unique_ptr

This commit is contained in:
Lioncash
2015-12-21 10:15:17 -05:00
parent ec71452706
commit d20ba76ab3
5 changed files with 22 additions and 20 deletions

View File

@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <fstream>
#include <memory>
#include <string>
#include <vector>
@ -36,8 +37,8 @@ namespace OGL
const u32 MAX_IBUFFER_SIZE = 2*1024*1024;
const u32 MAX_VBUFFER_SIZE = 32*1024*1024;
static StreamBuffer *s_vertexBuffer;
static StreamBuffer *s_indexBuffer;
static std::unique_ptr<StreamBuffer> s_vertexBuffer;
static std::unique_ptr<StreamBuffer> s_indexBuffer;
static size_t s_baseVertex;
static size_t s_index_offset;
@ -65,8 +66,8 @@ void VertexManager::CreateDeviceObjects()
void VertexManager::DestroyDeviceObjects()
{
delete s_vertexBuffer;
delete s_indexBuffer;
s_vertexBuffer.reset();
s_indexBuffer.reset();
}
void VertexManager::PrepareDrawBuffers(u32 stride)