#include #include #include #include #define GL_VERSION_1_2_DEPRECATED #define GL_VERSION_1_3_DEPRECATED #define GL_VERSION_1_4_DEPRECATED #define GL_VERSION_1_5_DEPRECATED #include #include #include #include #include #define EMPTY_MATRIX4 { 0.0, 0.0, 0.0, 0.0,\ 0.0, 0.0, 0.0, 0.0,\ 0.0, 0.0, 0.0, 0.0,\ 0.0, 0.0, 0.0, 0.0 } #define IDENTITY_MATRIX4 { 1.0, 0.0, 0.0, 0.0,\ 0.0, 1.0, 0.0, 0.0,\ 0.0, 0.0, 1.0, 0.0,\ 0.0, 0.0, 0.0, 1.0 } typedef enum { X_AXIS, Y_AXIS, Z_AXIS } AXIS; class test : public QGLWidget{ Q_OBJECT public: test(QWidget *parent=0); protected: void initializeGL(); void paintGL(); private: void multiply4x4(GLfloat *m1, GLfloat *m2); void perspective(GLfloat *matrix, GLfloat fov, GLfloat aspect, GLfloat nearz, GLfloat farz); void translate(GLfloat *matrix, GLfloat x, GLfloat y, GLfloat z); void rotate(GLfloat *matrix, GLfloat angle, AXIS axis); char* filetobuf(char *file); void initapi(const QGLContext *cont); };