Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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

Erutangis a si tahw
Posted

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

Posted
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".
Posted (edited)
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.

Edited by ArKz
  • Administrators
Posted

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

Game.Initialize(Me, False)

rather than

Game.Initialize(Me, True)

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted (edited)

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

Edited by ArKz

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...