Archived

This topic is now archived and is closed to further replies.

keyboard func not working

This topic is 5651 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites