added noncopyable
This commit is contained in:
parent
de7cbdabbd
commit
5552d2b662
|
@ -1,8 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "Transformable.hpp"
|
#include <lol/Transformable.hpp>
|
||||||
#include "Drawable.hpp"
|
#include <lol/Drawable.hpp>
|
||||||
|
|
||||||
namespace lol
|
namespace lol
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <glad/glad.h>
|
#include <glad/glad.h>
|
||||||
#include "VertexArrayObject.hpp"
|
|
||||||
#include "Shader.hpp"
|
#include <lol/NonCopyable.hpp>
|
||||||
|
#include <lol/Shader.hpp>
|
||||||
|
|
||||||
namespace lol
|
namespace lol
|
||||||
{
|
{
|
||||||
|
@ -23,9 +24,6 @@ namespace lol
|
||||||
class Drawable
|
class Drawable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Drawable(const Drawable& other) = delete;
|
|
||||||
void operator=(const Drawable& other) = delete;
|
|
||||||
|
|
||||||
virtual void PreRender(const CameraBase& camera) const { };
|
virtual void PreRender(const CameraBase& camera) const { };
|
||||||
void Draw(const CameraBase& camera) const;
|
void Draw(const CameraBase& camera) const;
|
||||||
void SetPrimitiveType(PrimitiveType type);
|
void SetPrimitiveType(PrimitiveType type);
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace lol
|
||||||
* exist.
|
* exist.
|
||||||
*/
|
*/
|
||||||
template<typename Type>
|
template<typename Type>
|
||||||
class ObjectManager
|
class ObjectManager : public NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static ObjectManager<Type>& GetInstance()
|
static ObjectManager<Type>& GetInstance()
|
||||||
|
@ -27,10 +27,6 @@ namespace lol
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
|
||||||
ObjectManager(const ObjectManager<Type>&) = delete;
|
|
||||||
void operator=(const ObjectManager<Type>&) = delete;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add new (existing) object to manager
|
* Add new (existing) object to manager
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,16 +6,17 @@
|
||||||
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
|
#include <lol/NonCopyable.hpp>
|
||||||
|
|
||||||
namespace lol
|
namespace lol
|
||||||
{
|
{
|
||||||
|
|
||||||
class AbstractShader
|
class AbstractShader : public NonCopyable
|
||||||
{
|
{
|
||||||
friend class ShaderFactory;
|
friend class ShaderFactory;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AbstractShader(const std::string& vertexShader, const std::string& fragmentShader);
|
AbstractShader(const std::string& vertexShader, const std::string& fragmentShader);
|
||||||
AbstractShader(const AbstractShader& other) = delete;
|
|
||||||
~AbstractShader();
|
~AbstractShader();
|
||||||
|
|
||||||
inline bool Good() { return id != 0; }
|
inline bool Good() { return id != 0; }
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include <lol/NonCopyable.hpp>
|
||||||
|
|
||||||
namespace lol
|
namespace lol
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -13,7 +15,7 @@ namespace lol
|
||||||
unsigned int type;
|
unsigned int type;
|
||||||
bool normalized;
|
bool normalized;
|
||||||
unsigned int stride;
|
unsigned int stride;
|
||||||
const void* pointer;
|
const void* pointer;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Useful abbreviations
|
// Useful abbreviations
|
||||||
|
@ -28,7 +30,7 @@ namespace lol
|
||||||
};
|
};
|
||||||
|
|
||||||
// VAO structure that sets up the buffers and deletes them at the end of the lifecycle
|
// VAO structure that sets up the buffers and deletes them at the end of the lifecycle
|
||||||
class AbstractVertexArrayObject
|
class AbstractVertexArrayObject : public NonCopyable
|
||||||
{
|
{
|
||||||
friend class VAOFactory;
|
friend class VAOFactory;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue