GCP Assignment 1
FileLoader.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 <string>
6 #include <iostream>
7 #include <fstream>
8 #include <vector>
9 #include <sstream>
10 #include "../Core/Logging.h"
11 
15 namespace FileLoader
16 {
22  std::string loadShaderFile(std::string fileName);
23 
30  void loadOBJFile(std::string objFileName, std::vector<float> &vertices,
31  std::vector<float> &vertexNormals, std::vector<float> &vertexTextures);
32 
38  void loadXYZFloats(std::stringstream &streamLine, std::vector<float> &vectorArray);
39 
45  void loadUVFloats(std::stringstream &streamLine, std::vector<float> &vectorArray);
46 
57  void sortWithIndices(std::stringstream &streamLine,
58  std::vector<float> &loadedVertices, std::vector<float> &loadedVertexNormals,
59  std::vector<float> &loadedVertexTextures, std::vector<float> &vertices,
60  std::vector<float> &vertexNormals, std::vector<float> &vertexTextures);
61 }
void loadXYZFloats(std::stringstream &streamLine, std::vector< float > &vectorArray)
Load in the XYZ coordinate from the line.
Definition: FileLoader.cpp:120
std::string loadShaderFile(std::string fileName)
Load the contents of a text file in to a std::string.
Definition: FileLoader.cpp:5
void sortWithIndices(std::stringstream &streamLine, std::vector< float > &loadedVertices, std::vector< float > &loadedVertexNormals, std::vector< float > &loadedVertexTextures, std::vector< float > &vertices, std::vector< float > &vertexNormals, std::vector< float > &vertexTextures)
Sort the data using the indices of the faces to order the data.
Definition: FileLoader.cpp:148
void loadOBJFile(std::string objFileName, std::vector< float > &vertices, std::vector< float > &vertexNormals, std::vector< float > &vertexTextures)
Load the contents of an obj file.
Definition: FileLoader.cpp:47
A namespace that contains functions to load in files.
Definition: FileLoader.h:15
void loadUVFloats(std::stringstream &streamLine, std::vector< float > &vectorArray)
Load in the UV coordinate from the line.
Definition: FileLoader.cpp:134