• 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: Adam <email@hidden>
  • Date: Sat, 16 Dec 2006 05:15:34 -0800


On Dec 15, 2006, at 10:06 PM, Laurence Harris wrote:


On Dec 16, 2006, at 12:54 AM, Adam wrote:

I spoke too soon. Whenever I call the function (by way of pressing a key), it invokes the debugger, which says that redisp = 139396. Is there something wrong with the way that I looped my for() statements? Is there some way that redisp could get that high? Or am I misinterpreting the debugger somehow? What is wrong with my code?

for (GLfloat redisp = 0; redisp <= 7; redisp ++)
{
for (GLfloat redisp2 = 0; redisp2 <= 14; redisp ++)

Don't you want to increment redisp2 in the second one?

Larry




Yeah, that would probably be good. I did that when I was writing it out as well as typing it up. Whoops again...




On Dec 15, 2006, at 10:12 PM, Chris Espinosa wrote:


On Dec 15, 2006, at 10:06 PM, Laurence Harris wrote:
I spoke too soon. Whenever I call the function (by way of pressing a key), it invokes the debugger, which says that redisp = 139396. Is there something wrong with the way that I looped my for() statements? Is there some way that redisp could get that high? Or am I misinterpreting the debugger somehow? What is wrong with my code?

for (GLfloat redisp = 0; redisp <= 7; redisp ++)
{
for (GLfloat redisp2 = 0; redisp2 <= 14; redisp ++)

Don't you want to increment redisp2 in the second one?

The man's got a point there.

And rather than having your program "invoke the debugger" (which is the politest euphemism for "crash" I've ever heard), you may want to start in the debugger, setting a breakpoint at your outer for loop and stepping through with the "Step Over" command.  Look at each variable after each line executes to make sure it's changing the way you expect it to.

Chris

Ok, I think I have it now... nope... in this code:

void kybrd(unsigned char key, int x, int y)
{
switch (key)
{
//...
case 'a':
{
srand (time(NULL));
for (int looptemp = 0; looptemp <= 5; looptemp++)
{
arr_tetris_screen[rand()%7][rand()%14] = box;
} 
redisplay();
}
default: exit(123);
}
}

This code keeps giving me "exit code 123" when I press 'a'. Any thoughts? Caps lock is not on... Thank you both for helping!



All help is appreciated and thanks in advance.

~ < [ / Adam-o \ ] > ~

+-------------------------------------------+
| My computer's Stats                      |
| Mac OS 10.4.8                               |
| 1 Ghz Apple Powerbook G4        |
| Xcode v. 2.4.1                                 |
+-------------------------------------------+

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please keep your posts straight and 
to the point. Also please comment 
the code you use as I am still learning 
OpenGL and Xcode and may not yet 
understand the meaning of the command.
 Thank you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


 _______________________________________________
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: Ricky Sharp <email@hidden>
References: 
 >Redisplaying the Window (From: Adam <email@hidden>)
 >Re: Redisplaying the Window (From: Chris Espinosa <email@hidden>)
 >Re: Redisplaying the Window (From: Adam <email@hidden>)
 >Re: Redisplaying the Window (From: Adam <email@hidden>)
 >Re: Redisplaying the Window (From: Laurence Harris <email@hidden>)

  • Prev by Date: Re: Dev on mac, build on a sparc
  • 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