Functions not being initialised onKeyDown

Nibbie
Posts: 1
Joined: 2014.04
Post: #1
Hey everyone,

Sorry if this has been answered before. For some reason my functions aren't being initialised properly in my switch statement within glutKeyboardFunc. I have debugged glutKeyboardFunc to see if it is initialising my keyDown, and it is.

Here is my code:
Code:
void keyDown(unsigned char key, int x, int y)
{
  switch(key)
  {
   /*Switch to filled mode or line mode*/
    case 'o':
      drawXYZ();
      drawn = !drawn;
      break;
    case 'n':
      printf("N pressed\n");
      drawNormals();
      glEnable(GL_LIGHTING);
      glEnable(GL_LIGHT0);
      break;
    default:
      break;

  }
}

These functions are located above keyDown() in terms of layout. I assume this is happening because of placement of the functions themself.

[Image: QVJdXcW.jpg]

Thanks for any help
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
From your console log, it’s clear this function is in fact being called, so what exactly is the problem?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Some quick help getting started with certain Carbon functions zmwworm 12 8,111 Jan 10, 2008 01:14 AM
Last Post: zmwworm
  Intel Mac -> Many Warnings (deprecated functions) dave05 3 4,479 Sep 6, 2006 03:19 PM
Last Post: aarku
  Arrays or variables containing executable functions Jones 4 4,702 Jun 2, 2006 08:35 AM
Last Post: Zekaric
  Struct based functions Jones 9 5,463 May 9, 2006 02:37 PM
Last Post: Zekaric
  Using OpenGL 1.5 functions ermitgilsukaru 8 7,003 Nov 14, 2005 08:41 PM
Last Post: ermitgilsukaru