Jump to content
  • Advertisement

Archived

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

maxmagnus

keyboard func not working

This topic is 6022 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
Advertisement
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
Thanks,
I would have never thought of
such simple answer
(and the things I''(`)ve tried)
maxmagnus

Martin Miljkovic

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!