• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Redisplaying the Window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redisplaying the Window


  • Subject: Re: Redisplaying the Window
  • From: Chris Espinosa <email@hidden>
  • Date: Fri, 15 Dec 2006 21:02:49 -0800


On Dec 15, 2006, at 8:39 PM, Adam wrote:

void redisplay()
{
for (GLfloat redisp = 0; redisp <= 7; redisp ++)
{
for (GLfloat redisp2 = 0; redisp2 <= 14; redisp ++)
{
switch (arr_tetris_screen [redisp] [redisp2])
{
case box:
{
glBegin(GL_QUADS);
glColor3f(1.0, 0.0, 0.0);
glVertex3f(redisp+1, redisp2+1, 0.0); glVertex3f(redisp, redisp2+1, 0.0);
glVertex3f(redisp, redisp2+1, 0.0); glVertex3f(redisp, redisp2, 0.0);
}
default: exit(1234);
}
}
}
glutPostRedisplay();
}

This gives me two errors: 
"jam exited with exit code 1"
"invalid types 'GLfloat[7][14][GLfloat]' for array subscript"

I know this has OpenGL code in it, but this isn't GL-specific, so I felt that these lists are more appropriate for this question. 

You should probably use integers, rather than floating-point values, for the array indicies, and for the array content as well.  The compiler does not like to index into arrays using floats.

Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Redisplaying the Window
      • From: Adam <email@hidden>
References: 
 >Redisplaying the Window (From: Adam <email@hidden>)

  • Prev by Date: Re: Redisplaying the Window
  • Next by Date: Re: Redisplaying the Window
  • Previous by thread: Re: Redisplaying the Window
  • Next by thread: Re: Redisplaying the Window
  • Index(es):
    • Date
    • Thread