GLfloat not working in header file

I'm tring to declare GLfloat inside my header file, but its not working; I've included all the necessary files but still isn't working on this project. I'm receiving the errors:
1>j:\open gl snake game\open gl snake game\glutlightcolour.h(18) : error C2059: syntax error : '{'
1>j:\open gl snake game\open gl snake game\glutlightcolour.h(18) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body

and also that(the ifndef)doesn't work. What does it mean? It works on my other header file though:

1>j:\open gl snake game\open gl snake game\glutlightcolour.h(91) : fatal error C1070: mismatched #if/#endif pair in file 'j:\open gl snake game\open gl snake game\glutlightcolour.h'




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef _glight_h_
#define _glight_h_

#include<glut.h>

class CLight_Colour
{
public:
	void Snake_Material(); //colour and lighting 
	void Food_Red();//sets colour to objects (want 2 use it 4 food)
	void Food_Green();//sets colour to objects (want 2 use it 4 food)
	void Food_Yellow();//sets colour to objects (want 2 use it 4 food)
	void Food_Blue();//sets colour to objects (want 2 use it 4 food)

	void init_lighting();//this func must be initilised before game starts
private:
//colours 
	GLfloat qaGrey[] = {4.0, 4.0, 4.0, 1.0};
	GLfloat qaRed[] = {1.0, 0.0, 0.0, 1.0};
	GLfloat qaWhite[] = {1.0, 1.0, 1.0, 1.0};
	GLfloat qaGreen[] = {0.0, 1.0, 0.0, 1.0};
	GLfloat qaYellow[] = {1.0, 1.0, 0.0, 1.0};
	GLfloat qaBlue[] = {0.0, 0.0, 1.0, 1.0};
};
great I fixed it "#endif" has to be added at the end of the file
Topic archived. No new replies allowed.