Added VertexArray
This commit is contained in:
1 parent
99404714e8
commit
0724c6a84a
11 files changed
+78
-13
No files matched your search
@@ -8,6 +8,8 @@
|
||||
#include "Utility.h"
|
||||
#include "IntroGamestate.h"
|
||||
#include "Renderer.h"
|
||||
//TODO: Check #include consistency
|
||||
//TODO: Document ALL frontend functions
|
||||
|
||||
namespace nf {
|
||||
class Application {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "Renderer.h"
|
||||
#include "GL/glew.h"
|
||||
|
||||
namespace nf {
|
||||
class IndexBuffer {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <Windows.h>
|
||||
|
||||
namespace nf {
|
||||
#ifdef _DEBUG
|
||||
|
||||
@@ -1,13 +1,35 @@
|
||||
#pragma once
|
||||
#ifdef NFENGINE
|
||||
#include "GL/glew.h"
|
||||
#endif
|
||||
#include <vector>
|
||||
|
||||
#include "VertexBuffer.h"
|
||||
#include "Utility.h"
|
||||
|
||||
namespace nf {
|
||||
struct VertexBufferElement {
|
||||
unsigned int type;
|
||||
unsigned int count;
|
||||
unsigned char normalized;
|
||||
|
||||
static unsigned int getSizeOfType(unsigned int type);
|
||||
};
|
||||
|
||||
class VertexArray {
|
||||
public:
|
||||
VertexArray(VertexBuffer& buffer);
|
||||
VertexArray(const void* bufferData, size_t bufferSize);
|
||||
|
||||
void bind();
|
||||
template<typename T>
|
||||
void push(unsigned int count);
|
||||
|
||||
~VertexArray();
|
||||
private:
|
||||
unsigned int m_id;
|
||||
VertexBuffer m_vb;
|
||||
bool m_hasLayout;
|
||||
std::vector<VertexBufferElement> m_layoutElements;
|
||||
unsigned int m_vertexStride;
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Renderer.h"
|
||||
#ifdef NFENGINE
|
||||
#include "GL/glew.h"
|
||||
#endif
|
||||
|
||||
namespace nf {
|
||||
class VertexBuffer {
|
||||
|
||||
Reference in new issue
Block a user