Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Stupid errors :@

Author
Message
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 11th May 2009 09:55
When i run my program, the window just freezes, and i cant even click the x on it, i have to ctrl+alt+delete it away, heres my code:

Main.cpp:


t_entity.h:


t_entity.cpp:


player.h:


player.cpp:


skybox.h:


skybox.cpp:


g_def.h:


Any help would be appreciated
Lucifer
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 11th May 2009 10:01 Edited at: 11th May 2009 10:03
in your main.cpp
Quote: "while(LoopGDK())
{
dbMakeMatrix(4, 10000, 10000, 100, 100);"


Why are you making the matrix inside the loop? Try moving the makematrix command out of the loop.

Goat
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 11th May 2009 10:34
Nah, that doesn't fix it, but thats for trying
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 11th May 2009 11:15
Add breakpoints and find where it freezes?

Also: 'dbSetCameraRange(5000, 5000);', that will result in you being able to see nothing.

tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 11th May 2009 11:19
Whats the technique i should use for setting breakpoints, like where should i place them, and how do i use them?

Quote: "Also: 'dbSetCameraRange(5000, 5000);', that will result in you being able to see nothing."


How would i fix that?
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 11th May 2009 13:02
Quote: "Whats the technique i should use for setting breakpoints, like where should i place them, and how do i use them?"


You use them by clicking in the margin if any of your source files, a red circle should then appear. Assuming you placed them in a location that actually gets run then just hit F5 if you compiled in debug mode and it should step out of the process when it hits one, you can then just step through your code or add more breakpoints after that and just skip through them until you hit an infinite loop or something. I'm sure you can find a much better explanation on MSDN or something.

Quote: "How would i fix that? "


By not setting the near and far clipping planes to the same distance.

puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 11th May 2009 14:04
dbSetCameraRange(1, 5000)
DnB
15
Years of Service
User Offline
Joined: 28th Feb 2009
Location:
Posted: 12th May 2009 21:21
Yea, and when you place a break point, right click on it and you can do a bunch of stuff with the break point. Like you could put a condition, a filter, or you can print a message when you hit the breakpoint.
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 13th May 2009 09:16
But what are they for and how can i use them to help me to fix my problem?
stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 14th May 2009 02:32
If you are using VC ++

Menu - Debug - toggle breakpoint.

I believe this sets a breakpoint to where your text cursor is on the left hand side, You will see the breakpoint as a small red circle. When the code gets to that position it will return
to the main C++ window.

Assuming it is not locked in a loop at that point etc.. You can set variables you wish to look at to see their values at that point. Using a WATCH window to set the variables you wish to look at...

Hope this does not sound too cryptic ???

Regards :- Steve

AMD Athlon64x2 3.1Ghz - Ram 4Gb DDR2 800Mhz - 500Gb HD
Ndivia 9600GT SLI - 24in LCD - WIN 7 - 64 bit BETA
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 16th May 2009 19:44
Quote: "But what are they for and how can i use them to help me to fix my problem?"


Breakpoints are generally used to stop execution of your program and examine the state of it by allowing you to look at the values you use to control it. You may have a loop that never exits only to find that you've never incremented the controlling variable or that it gets reset to something else inside the loop. You may have an unhandled exception only to find that some null value is being passed or used when you don't expect it.

Once a breakpoint is reached the debug session will let you step through execution of the program so you can watch your variables as they're acted on. You can step over execution of functions. Set up watches on your important variables and watch how they change while stepping through your code.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office

Login to post a reply

Server time is: 2024-11-05 18:47:11
Your offset time is: 2024-11-05 18:47:11