Added VertexArray

This commit is contained in:
grayson committed 2021-08-22 03:16:54 -05:00
1 parent 99404714e8
commit 0724c6a84a
11 files changed
+78 -13

No files matched your search

+2
View File
@@ -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 -2
View File
@@ -1,6 +1,5 @@
#pragma once
#include "Renderer.h"
#include "GL/glew.h"
namespace nf {
class IndexBuffer {
+1
View File
@@ -5,6 +5,7 @@
#include <string>
#include <fstream>
#include <sstream>
#include <Windows.h>
namespace nf {
#ifdef _DEBUG
+23 -1
View File
@@ -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;
};
}
+3 -2
View File
@@ -1,6 +1,7 @@
#pragma once
#include "Renderer.h"
#ifdef NFENGINE
#include "GL/glew.h"
#endif
namespace nf {
class VertexBuffer {