I'll try your code aswell.
Though:
#include <cmath>#include <deque>#include <fstream>#include <map>
I've never worked with those headers before...
Any tuts on them somewhere available?
#include <cmath>#include <deque>#include <fstream>#include <map>
/* Does this line contain texture information? */ else if (reader.peek() == 't') { readTexture(reader); }
/* Does this line contain texture information? */ else if (reader.peek() == 't') { try { readTexture(reader); } catch (std::string& exception) { MessageBox(nullptr, exception.c_str(), "Texture Error", MB_OK | MB_ICONINFORMATION); return false; } }
t filename.bmp identifier
t data/filename.bmp identifier
struct Triangle{ Vertex vertex[3];};
/* Read a triangle from a file stream */void readTriangle(std::ifstream& reader){ Triangle triangle; readVertex(reader, triangle.vertex[0]); readVertex(reader, triangle.vertex[1]); readVertex(reader, triangle.vertex[2]); /* We use a deque, so push the triangle onto the back of it */ sector1.triangle.push_back(triangle);}
int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing{ // code glBindTexture(GL_TEXTURE_2D, textures["1"]); // Process Each Triangle for (int loop_m = 0; loop_m < sector1.triangle.size(); loop_m++) { // code } return TRUE; // Everything Went OK}