refactor: format code
This commit is contained in:
@@ -14,53 +14,53 @@
|
||||
className& operator=(const className &) = delete
|
||||
|
||||
|
||||
namespace GL{
|
||||
namespace GL {
|
||||
|
||||
struct VertexAttribPointer{
|
||||
struct VertexAttribPointer {
|
||||
unsigned int m_Index, m_Size;
|
||||
int m_Offset;
|
||||
};
|
||||
|
||||
class VertexBuffer{
|
||||
private:
|
||||
unsigned int m_ID, m_DataStride;
|
||||
std::vector<VertexAttribPointer> m_VertexAttribs;
|
||||
public:
|
||||
REMOVE_COPY(VertexBuffer);
|
||||
VertexBuffer(VertexBuffer&& other){
|
||||
m_VertexAttribs = std::move(other.m_VertexAttribs);
|
||||
m_ID = other.m_ID;
|
||||
m_DataStride = other.m_DataStride;
|
||||
other.m_ID = 0;
|
||||
other.m_DataStride = 0;
|
||||
}
|
||||
VertexBuffer(const std::vector<float>& data, unsigned int stride);
|
||||
~VertexBuffer();
|
||||
void bind() const;
|
||||
void unbind() const;
|
||||
void addVertexAttribPointer(unsigned int index, unsigned int coordinateSize, unsigned int offset);
|
||||
void bindVertexAttribs() const;
|
||||
class VertexBuffer {
|
||||
private:
|
||||
unsigned int m_ID, m_DataStride;
|
||||
std::vector<VertexAttribPointer> m_VertexAttribs;
|
||||
public:
|
||||
REMOVE_COPY(VertexBuffer);
|
||||
VertexBuffer(VertexBuffer&& other) {
|
||||
m_VertexAttribs = std::move(other.m_VertexAttribs);
|
||||
m_ID = other.m_ID;
|
||||
m_DataStride = other.m_DataStride;
|
||||
other.m_ID = 0;
|
||||
other.m_DataStride = 0;
|
||||
}
|
||||
VertexBuffer(const std::vector<float>& data, unsigned int stride);
|
||||
~VertexBuffer();
|
||||
void bind() const;
|
||||
void unbind() const;
|
||||
void addVertexAttribPointer(unsigned int index, unsigned int coordinateSize, unsigned int offset);
|
||||
void bindVertexAttribs() const;
|
||||
};
|
||||
|
||||
class VertexArray{
|
||||
private:
|
||||
unsigned int m_ID, m_VertexCount;
|
||||
std::vector<VertexBuffer> m_VertexBuffers; //use to destroy vbos when become unused
|
||||
public:
|
||||
REMOVE_COPY(VertexArray);
|
||||
VertexArray(VertexArray&& other){
|
||||
m_ID = other.m_ID;
|
||||
m_VertexCount = other.m_VertexCount;
|
||||
m_VertexBuffers = std::move(other.m_VertexBuffers);
|
||||
other.m_VertexCount = 0;
|
||||
other.m_ID = 0;
|
||||
}
|
||||
VertexArray(unsigned int vertexCount);
|
||||
~VertexArray();
|
||||
unsigned int getVertexCount() const {return m_VertexCount;}
|
||||
void bindVertexBuffer(VertexBuffer& vbo);
|
||||
void bind() const;
|
||||
void unbind() const;
|
||||
class VertexArray {
|
||||
private:
|
||||
unsigned int m_ID, m_VertexCount;
|
||||
std::vector<VertexBuffer> m_VertexBuffers; //use to destroy vbos when become unused
|
||||
public:
|
||||
REMOVE_COPY(VertexArray);
|
||||
VertexArray(VertexArray&& other) {
|
||||
m_ID = other.m_ID;
|
||||
m_VertexCount = other.m_VertexCount;
|
||||
m_VertexBuffers = std::move(other.m_VertexBuffers);
|
||||
other.m_VertexCount = 0;
|
||||
other.m_ID = 0;
|
||||
}
|
||||
VertexArray(unsigned int vertexCount);
|
||||
~VertexArray();
|
||||
unsigned int getVertexCount() const { return m_VertexCount; }
|
||||
void bindVertexBuffer(VertexBuffer& vbo);
|
||||
void bind() const;
|
||||
void unbind() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef RENDER_LOADER_TEXTURELOADER_H_
|
||||
#define RENDER_LOADER_TEXTURELOADER_H_
|
||||
|
||||
namespace TextureLoader{
|
||||
namespace TextureLoader {
|
||||
const unsigned int loadGLTexture(const char* fileName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user