Dont use new keyword with unique_ptr
This commit is contained in:
@@ -131,7 +131,7 @@ namespace Inferno {
|
||||
// ---------------------------------
|
||||
|
||||
// Create array for storing quads vertices
|
||||
m_vertexBufferBase = std::unique_ptr<QuadVertex[]>(new QuadVertex[vertexCount]);
|
||||
m_vertexBufferBase = std::make_unique<QuadVertex[]>(vertexCount);
|
||||
m_vertexBufferPtr = m_vertexBufferBase.get();
|
||||
|
||||
// Set default quad vertex positions
|
||||
@@ -288,7 +288,7 @@ namespace Inferno {
|
||||
// ---------------------------------
|
||||
|
||||
// Create array for storing quads vertices
|
||||
m_vertexBufferBase = std::unique_ptr<CharacterVertex[]>(new CharacterVertex[vertexCount]);
|
||||
m_vertexBufferBase = std::make_unique<CharacterVertex[]>(vertexCount);
|
||||
m_vertexBufferPtr = m_vertexBufferBase.get();
|
||||
|
||||
// Generate indices
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define RENDERER_H
|
||||
|
||||
#include <cstdint> // std::uint32_t
|
||||
#include <memory> // std::shared_ptr, std::unique_ptr
|
||||
#include <memory> // std::shared_ptr, std::unique_ptr, std::make_shared, std::make_unique
|
||||
|
||||
#include "glm/ext/matrix_float4x4.hpp" // glm::mat4
|
||||
#include "glm/ext/vector_float2.hpp" // glm::vec2
|
||||
|
||||
Reference in New Issue
Block a user