mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Update mesh include class to match updated Mesh chapter.
This commit is contained in:
@@ -9,9 +9,6 @@
|
|||||||
#include <learnopengl/shader.h>
|
#include <learnopengl/shader.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <fstream>
|
|
||||||
#include <sstream>
|
|
||||||
#include <iostream>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -36,13 +33,12 @@ struct Texture {
|
|||||||
|
|
||||||
class Mesh {
|
class Mesh {
|
||||||
public:
|
public:
|
||||||
/* Mesh Data */
|
// mesh Data
|
||||||
vector<Vertex> vertices;
|
vector<Vertex> vertices;
|
||||||
vector<unsigned int> indices;
|
vector<unsigned int> indices;
|
||||||
vector<Texture> textures;
|
vector<Texture> textures;
|
||||||
unsigned int VAO;
|
unsigned int VAO;
|
||||||
|
|
||||||
/* Functions */
|
|
||||||
// constructor
|
// constructor
|
||||||
Mesh(vector<Vertex> vertices, vector<unsigned int> indices, vector<Texture> textures)
|
Mesh(vector<Vertex> vertices, vector<unsigned int> indices, vector<Texture> textures)
|
||||||
{
|
{
|
||||||
@@ -93,10 +89,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/* Render data */
|
// render data
|
||||||
unsigned int VBO, EBO;
|
unsigned int VBO, EBO;
|
||||||
|
|
||||||
/* Functions */
|
|
||||||
// initializes all the buffer objects/arrays
|
// initializes all the buffer objects/arrays
|
||||||
void setupMesh()
|
void setupMesh()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user