Unknown Error Causing Game to Freeze

ArKz

Newcomer
Joined
Sep 16, 2004
Messages
4
O.K. here is the situation, i am trying to make a space shooter. I tried to add an fps limiter so it has 60 frames per second and i also tried to use dinput for keystrokes. I dont know which one is wrong or maybe its a combination but anyways here is the code. It compiles fine but when it runs, it hangs the game up. I can alt+tab and ctrl+alt+delete but i am tottaly blind because the game doesn't go away so i can't see what i am doing and end up just shutting off/on my computer.
thanks for any help, and yes, it is based off of ThePentiumGuy's tuts and assistance.
 
I had problems like this in the beginning too... What i did was pressing Ctrl+Alt+Delete and then open taskmanager. Kill the application, and when you return to VS there is an unhandled exception...

Hope this helps -- Loffen
 
When I CTRL+ALT+DELETED, the box came up but I couldn't see anything. But on this computer at school, it goes into standby if i tap power button. And when i did that, the program was alt+tabbed and the task manager showed so i could exit that way. This is the error i got:
An unhandled exception of type 'System.NullReferenceException' occurred in TexturingAQuad.exe

Additional information: Object reference not set to an instance of an object.

any help on which is the null refernce and which object is not set to n instance of an object? codes above btw
 
I had the same problem too, there is no way to debug it because once directX is initialized, it steals your computer from you. Once I initialized DirectInput, I couldn't move the mouse after an exception occured. The best way to figure out where this is happening, is to have a breakpoint where you "think" the error is. Then, change the window state to minimize the window before the breakpoint occurs. This way, when the breakpoint happens, you don't lose your computer to the menace that is "DirectX".
 
PlausiblyDamp said:
Any chance you could post some code? A null reference means you are failing to initialize a variable before trying to use it.

the code is here: code

i would paste some but that would take up a lot of room because I don't know where the error is occuring. and i would put a breakpoint where i think the error is but i truly have no clue, but my best guess is its something to do with the FPS limiting,next best guess is directinput if i did something wrong there. thanks and if you are wondering, yes i am a complete nub at vb.net
in fact, this is like my second .net program and my first d3d program ever.
 
Last edited:
Haven't got the DirectX SDK on this PC (yet) - however have you tried running the application in a window rather than full screen to see what line the error occurs on.
Just change the Form_load event so the next to last line reads
Visual Basic:
Game.Initialize(Me, False)
rather than
Visual Basic:
Game.Initialize(Me, True)
 
You're using DirectInput - it "takes over" your keyboard functions and such. Be sure that you're not having any errors, did you forget to instantiate..etc.

The DInput class I gave you - did you remember to type in DInput.Poll() and use that CheckForKeyPress() sub?

-The Pentium Guy
 
yeah i remembered to do that, but i think the error lies more in the FPS counter since it does render but then it just hangs
[edit] now that i look, yeah, i forgot to instantiate myFPSCounter >.< doh! i hate those small problems
thanks for all you guy's help
 
Last edited:
Back
Top