Advertisement

keyboard func not working

Started by June 23, 2002 06:15 AM
1 comment, last by maxmagnus 22 years, 8 months ago
Hi to all, I m beginer in openGL and I have this problem problem: my compiler is giving me this eror: --------------------Configuration: vezba 06 23 gl - Win32 Debug-------------------- Compiling... vezba 06 23 gl.cpp C:\MY DOCUMENTS\PROGRAMI C++\vezba 06 23 gl.cpp(44) : error C2018: unknown character ''0x60'' C:\MY DOCUMENTS\PROGRAMI C++\vezba 06 23 gl.cpp(44) : error C2001: newline in constant C:\MY DOCUMENTS\PROGRAMI C++\vezba 06 23 gl.cpp(44) : error C2065: ''d'' : undeclared identifier C:\MY DOCUMENTS\PROGRAMI C++\vezba 06 23 gl.cpp(44) : error C2143: syntax error : missing '':'' before ''constant'' ........................................... ........................................... Error executing cl.exe. vezba 06 23 gl.obj - 23 error(s), 1 warning(s) since the kode is from red book I think that my settings are not right.As fo code here it is: void keyboard (unsigned char key, int x, int y) { switch (key) { case `d'': day = (day + 10) % 360; glutPostRedisplay(); break; case `D'': day = (day - 10) % 360; glutPostRedisplay(); break; case `y'': ........................... ............................ Please help me with this Martin Martin Miljkovic
Martin Miljkovic
quote:
Original post by maxmagnus
since the kode is from red book I think that my settings are
not right.As fo code here it is:
void keyboard (unsigned char key, int x, int y)
{
switch (key) {
case `d'':
day = (day + 10) % 360;
glutPostRedisplay();
break;
case `D'':
day = (day - 10) % 360;
glutPostRedisplay();
break;
case `y'':
...........................
............................
Please help me with this
Martin



it should read
case ''d'':

not

case `d'':

it''s a classical typo in programming books...

/Please excuse my bad spelling - My native language is binary not english
|Visit me
\Take my advice - I don''''t use it...
/Please excuse my bad spelling - My native language is binary not english|Visit meTake my advice - I don''t use it...
Advertisement
Thanks,
I would have never thought of
such simple answer
(and the things I''(`)ve tried)
maxmagnus

Martin Miljkovic
Martin Miljkovic

This topic is closed to new replies.

Advertisement