Dont use new keyword with unique_ptr

This commit is contained in:
Riyyi
2021-01-18 11:22:26 +01:00
parent 839bef091f
commit e08eec3b36
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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