Помогите исправить ошибки C++
//---------------------------------------------------------------------------
#include
#include
#include
#include
#include
#include
#pragma hdrstop
int alpha=0, beta=0, gamma=0;
GLfloat m[16] = { matrix.xx, matrix.yx, matrix.zx, 0, E2451 Undefined symbol 'matrix' E2238 Multipledeclaration for 'matrix' E2449 Size of 'matrix' is unknow or zero E2141 Declaratoin syntax error
matrix.xy, matrix.yy, matrix.zy, 0,
matrix.xz, matrix.yz, matrix.zz, 0,
0, 0, 0, 1}; E2190 Unexpected } E2190 Unexpected }
float diffuse[]={0.5, 0.5, 0.5, 1.0};
float lpos[]={-4.0, 4.0, -4.0, 1.0};
float black[]={0.0, 0.0, 0.0, 0.5};
#include "MainForms.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
HDC dc = Canvas->Handle;
PIXELFORMATDESCRIPTOR pfd;
memset( &pfd, 0, sizeof pfd );
pfd.nSize = sizeof pfd;
pfd.cColorBits = 8;
pfd.cDepthBits = 8;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.iLayerType = PFD_MAIN_PLANE;
pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_GENERIC_ACCELERATED;
int index = ChoosePixelFormat( dc, &pfd );
SetPixelFormat( dc, index, NULL );
HGLRC context = wglCreateContext( dc );
wglMakeCurrent( dc, context );
glClearColor( 0, 0.2, 0.4, 1.0 );
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
glDepthFunc(GL_LEQUAL);
glShadeModel(GL_SMOOTH);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, black);
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
glLightfv(GL_LIGHT0, GL_POSITION, lpos);
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientState( GL_COLOR_ARRAY );
template< class T > E2104 Invalid use of template keyword E2040 Declaration terminated incorrectly
struct Matrix3
{
T xx, xy, xz, yx, yy, yz, zx, zy, zz;
Matrix3( const T &xx, const T &xy, const T &xz,
const T &yx, const T &yy, const T &yz,
const T &zx, const T &zy, const T &zz );
Matrix3< T > &operator *=( const Matrix3< T > &other );
Matrix3< T > operator *( const Matrix3< T > &other ) const;
static const Matrix3< T > IDENTITY;
};
template< class T > E2104 Invalid use of template keyword E2040 Declaration terminated incorrectly
Matrix3< T > &Matrix3< T >::operator *=( const Matrix3< T > &other )
{
}
template< class T >
Matrix3< T > Matrix3< T >::operator *( const Matrix3< T > &other ) const
{
}
const Matrix3< int > ROTATION_ABOUT_X( 1, 0, 0, 0, 0, -1, 0, 1, 0 );
const Matrix3< int > ROTATION_ABOUT_Y( 0, 0, 1, 0, 1, 0, -1, 0, 0 ); E2304 Constant variable 'Matrix3' must be initialized E2141 Declaration syntax error E2344 Earlier declaration of 'Matrix3'
const Matrix3< int > ROTATION_ABOUT_Z( 0, -1, 0, 1, 0, 0, 0, 0, 1 ); E2238 Multiple declaration for 'Matrix3' E3204 Constant variable 'Matrix3' must be initialized E2141 Declaration syntax error