2 #pragma warning( disable : 4482 4996 4800 )
8 #include <glm/gtx/transform.hpp>
11 #include <aiPostProcess.h>
33 bool fileExists(
const string &filename);
34 string readFile(
const string &filename);
37 void printMatrix(glm::mat3 matrix);
38 void printMatrix(glm::mat4 matrix);
39 void printVector(glm::vec2 vec);
40 void printVector(glm::vec3 vec);
41 void printVector(glm::vec4 vec);
42 void printArray(
float *printarray,
int arraysize);
43 float randFloat(
float a,
float b);
44 int randInt(
int a,
int b);
46 GLbyte *gltReadTGABits(
const char *szFileName, GLint *iWidth, GLint *iHeight, GLint *iComponents, GLenum *eFormat);
47 GLuint load2dTexture(
const string& path,
bool projection =
false);
48 float *calculateNormals(
const float *vertices_in,
int arraysize);
50 void setupCubeMap(GLuint& texture);
51 GLuint loadCubeMap(
string paths[]);
52 void unloadCubeMap(GLuint& texture);
53 void initVboVao(
const Shader& shader, GLuint *vbo_id, GLuint *vao_id,
const GLfloat *positions, GLfloat *normals,
const GLfloat *texcoordinates,
int sizeofarray,
int buffermode,
bool update);
54 void initVboVaoFromModel(
const Shader &shader, Model *model,
const string& path,
int buffermode);
55 void releaseVboVao(GLuint *vbo_id, GLuint *vao_id);
65 bool initFbo(GLuint &fboId, GLuint &imgId,
int width,
int height);
66 int readPixel(
unsigned int x,
unsigned int y, GLuint fboId, GLuint imgId);
78 int *
readPixels(
unsigned int xFrom,
unsigned int yFrom,
unsigned int width,
unsigned int height, GLuint fboId, GLuint imgId);
79 template <
class T>
string string_tostring(
const T& t,
const int digits = 1) { std::stringstream ss; ss << std::setw(digits) << std::setfill(
'0') << t;
return ss.str(); }
int * readPixels(unsigned int xFrom, unsigned int yFrom, unsigned int width, unsigned int height, GLuint fboId, GLuint imgId)
Reads pixels from the GPU in a rectangular form.
bool initFbo(GLuint &fboId, GLuint &imgId, int width, int height)
Initializes the FBO, which is used as PickBuffer (render objectIds for object picking).