//---------------------------------------------------------------------------
// Matrix.h
//---------------------------------------------------------------------------
#if !defined(Matrix_H)
* #define Matrix_H
* #include <windows.h>
* #include <GL/gl.h>
* #include <iostream>
* #include <vector>
using namespace std;
class Matrix
{
private:
* static const int NUM_ELEMENTS = 16;
* vector<GLfloat> elements(NUM_ELEMENTS);
public:
* Matrix( void );
* void loadMatrix( Matrix other );
* void matrixMultiply( Matrix other );
* GLfloat getElement( int index );
* void toString();
* ~Matrix();
};
#endif
-----------------------------------------------------------------------
Matrix::Matrix( void )
{
* for ( int i = 0; i < NUM_ELEMENTS; i++ )
* {
*** if ( i % 5 == 0 )
*** {
***** elements[i] = 1.0;
*** }
*** else
*** {
***** elements[i] = 0.0;
*** }
* }
}
const int Matrix::NUM_ELEMENTS;
-------------------------------------------------------------------------
Howver, if I change vector<GLfloat> elements(NUM_ELEMENTS) to vector<GLfloat> elements(), it allows me to compile.
Thanks
Kai
--
殘**紅半邊劍,愁海飄零一*燈(Kai)