GCP Assignment 1
Object.h
Go to the documentation of this file.
1 //DISCLAMER - This is a modified version of code from one of my other assignments.
2 
3 #pragma once
4 
5 #include <SDL.h>
6 #include <SDL_image.h>
7 #include <iostream>
8 #include <string>
9 #include "GL/glew.h"
10 #include "FileLoader.h"
11 
15 class Object
16 {
17 public:
22  Object(std::string objFileName);
23 
29  Object(std::string objFileName, std::string material);
30 
34  ~Object();
35 
40  GLuint getVAO();
41 
46  GLuint getTextureID();
47 
52  unsigned int getNumberOfVertices();
53 
54 private:
58  unsigned int numberOfVertices;
60  std::string material;
62  GLuint textureID;
63 
68  void initialiseTexture(std::vector<float> vertexTextures);
69 
74  void InitialiseVAO(std::string objFileName);
75 };
GLuint getVAO()
Returns the vertex array object.
Definition: Object.cpp:166
Object(std::string objFileName)
Creates a vertex array object using a obj file location and OpenGL.
Definition: Object.cpp:5
GLuint vertexArrayObject
The Vertex Array Object for use with OpenGL.
Definition: Object.h:56
std::string material
The name of the material.
Definition: Object.h:60
~Object()
Destructs an Object.
Definition: Object.cpp:23
void InitialiseVAO(std::string objFileName)
Initialise the vertex array object.
Definition: Object.cpp:30
unsigned int numberOfVertices
Number of vertices in the model.
Definition: Object.h:58
GLuint getTextureID()
Returns the Texture ID.
Definition: Object.cpp:172
Creates an object from an text file, this can then be used with OpenGL.
Definition: Object.h:15
void initialiseTexture(std::vector< float > vertexTextures)
Initialise the texture.
Definition: Object.cpp:96
unsigned int getNumberOfVertices()
Returns the number of vertices.
Definition: Object.cpp:178
GLuint textureID
The Texture.
Definition: Object.h:62