Sign in to follow this  
Drazgal

[.net] Draw2D with managed sprites

Recommended Posts

In normal mode this works fine. However I cannot for the life of me get this working in when run with the debugger. No exceptions are thrown, just no image apears. One thing I find is that I get the message: D3D9 Helper: Enhanced D3DDebugging disabled; Application was not compiled with D3D_DEBUG_INFO even though I define D3D_DEBUG_INFO in the project settings and at the top of my files. Anyone else had this problem?

Share this post


Link to post
Share on other sites
You want to do 2d by 3d? that's overkill...
microsoft has a newer verion of directdraw i'd like to call (you guessed it ) managed directdraw.

there had been a lot of changes with it like the difficulty of directly accessing the contents of a surface and the simplicity of loading image file of any type.

just how advanced do you want your graphics engine to be?
if you want special lighting effects and whatnot, stick to directgraphics(aka: direct3d8) if you want true 2d performance, easy access to image memory, and speed, stick to managed directdraw or for the direct memory access use directdraw 7 by means of dxvblib , an old com library meant for visual basic 5 and above.
(then again I'm one of the few who chose the simplest path and chose visual basic.net not c++)

Share this post


Link to post
Share on other sites
I don't think 2D by 3D is overkill at all. It's just as simple as DirectDraw.

Are you getting DX debug information? If not, you may want to get your debug spew, pump up your Direct3D settings to max and run dbmon.exe at the same time. If it's not displaying in debug mode, I think there's a good chance some debug information is being created.

I have had things run correctly in "normal mode" but not "debug" mode. Debug mode sometimes helps you fix problems in your application by *not* working when something is wrong (that way you know there's a problem). In the regular mode, it will sometimes gloss over or ignore problem areas (which, obviously, you do NOT want when designing software).

Share this post


Link to post
Share on other sites
Thanks for the replies.

I also wondered if it was because something was going wrong, the annoying thing is that the billboarded sprites work great with the current setup, its just when I coworker desided to try for an interface we noticed this problem.

What really gets me confused is that the none managed version works fine with similar setup once again.

@machine_gun_man using a none c# approach isnt viable for this project as the other three major components are written in C++ and C# although Im not actually working on this project I have been assured that getting the dlls working together has been hell and nobody wants to add another language to the mix :) (there was a breakdown in communication over which langauge was being used).

Share this post


Link to post
Share on other sites
Are you using the "sprite" interface provided with Direct3D? One thing that caused me problems in the past with the sprite interface is that sprites (even 2D sprites called by Draw2D()) are still affected by the world matrix. So, right before you call sprite.End() or sprite.Flush() make sure to set the world transform back to the identity.

I also had a problem before with quads (NOT using the Sprite interface) where I had forgotten to set Device.VertexFormat to CustomVertex.TransformedTexturedNormal... it still worked correctly in non-debug mode but it crapped out in debug mode.

Share this post


Link to post
Share on other sites
Hmmm, I first thought that it might have been a project matrix problem, never occured to me that Draw2D would use the world matrix. Ill try that first thing tomorrow.

Thanks!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this