Jump to content
  • Advertisement
Sign in to follow this  
ArchangelMorph

Playing with stateblocks...

This topic is 4319 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a problem.. I have a game app that i'm working on at the moment.. In my app I have a class which i'm using to render a textured quad in the scene.. Now when I tested my class on its own in a seperate project it works fine, no problem.. But when I try to utilise it within my game engine to render several textured quads within the scene I get a windows run-time error.. On debugging it comes up with..: "Unhandled exception in DotAyo.exe: 0xC0000005: Access Violation." and stops dead on a call in the rendering method..: savedStates->Capture(); Where savedStates is a LPDIRECTSTATEBLOCK9 which i'm using to store the current state of the device before I apply my rendering states using within my textured quad rendering class.. I'm thinking maybe there's an issue with the way I setup the stateblock "savedStates" that it doesn't like something my other rendered elements in the app are doing to the device states..? Any help you could give to maybe steer me in the right direction..? Thnx Gamedev!!

Share this post


Link to post
Share on other sites
Advertisement
When you run your application in the debugger, once you get the access violation, does it stop on the "savedStates->Capture();" line?

If it does, then the savedStates pointer is almost certainly invalid - it may never have been initialised so still be set to a value such as 0x00000000 or 0xCDCDCDCD, or something may have overwritten it with something invalid.

The best advice I can offer is to run it in the debugger and put a breakpoint where the savedStates pointer is first set (your call to IDirect3DDevice9::CreateStateBlock) to ensure a)the stateblock is still being created, b)that the call isn't failing (use the debug D3D runtime to diagnose the problem if it is), and c)to step-by-step debug from the creation point to the capture point to see if anything goes awry with the pointer.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!