Level H Engine
FileLoader.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 #include <sstream>
6 
7 #define shaderFolder "Assets/glsl/"
8 #define shaderExtension ".glsl"
9 #define meshFolder "Assets/obj/"
10 #define meshExtension ".obj"
11 
15 namespace FileLoader
16 {
17 
23  std::string loadShaderFile(std::string fileName);
24 
31  void loadOBJFile(std::string objFileName, std::vector<float> &vertices,
32  std::vector<float> &vertexNormals, std::vector<float> &vertexTextures);
33 
39  void loadXYZFloats(std::stringstream &streamLine, std::vector<float> &vectorArray);
40 
46  void loadUVFloats(std::stringstream &streamLine, std::vector<float> &vectorArray);
47 
58  void sortWithIndices(std::stringstream &streamLine,
59  std::vector<float> &loadedVertices, std::vector<float> &loadedVertexNormals,
60  std::vector<float> &loadedVertexTextures, std::vector<float> &vertices,
61  std::vector<float> &vertexNormals, std::vector<float> &vertexTextures);
62 }
void loadXYZFloats(std::stringstream &streamLine, std::vector< float > &vectorArray)
Load in the XYZ coordinate from the line.
Definition: FileLoader.cpp:127
std::string loadShaderFile(std::string fileName)
Load the contents of a text file in to a std::string.
Definition: FileLoader.cpp:12
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:155
void loadOBJFile(std::string objFileName, std::vector< float > &vertices, std::vector< float > &vertexNormals, std::vector< float > &vertexTextures)
Load the contents of an obj file. NOTE: This can only load in triangulated meshes.
Definition: FileLoader.cpp:54
A namespace that contains functions to load in files.
Definition: FileLoader.cpp:9
void loadUVFloats(std::stringstream &streamLine, std::vector< float > &vectorArray)
Load in the UV coordinate from the line.
Definition: FileLoader.cpp:141