Search Forums
-
Definately organize your code into objects following Single Responsibility Principle and other good OOP design principles.
Unfortunately the SDK abandoned an object-oriented sample framework some time ago and gave us programming 3D graphics from a 1990 perspective of global variables, global functions and callbacks. The SDK samples have not been ...
-
The easiest thing is to use strongly typed pointers. Why are you trying to use IUnknown?
Also you say you are casting the IUnknown pointer. COM doesn't work this way. You have to use QueryInterface if you want to get from IUnknown to some other interface. Generally things aren't done this way in D3D, so its unclear if QueryInterface is ...
-
What OS are you using?
What does the debug output say?
Was the shared back buffer created by a D3D11 device?
-
Another approach is to use a polymorphic test double for the D3D interfaces and force the behavior you're trying to test in your code.
-
[quote user="indes"]Is it advisable to go the other way with solids and opposite with transparencies? or does sorting everything out tax more than drawing backwards?[/quote]
For opaque surfaces, its better to draw them front to back if you're using the depth buffer for hidden surface elimination. Drawing the closer objects first ...
-
Have you tried using the vendor supplied tools to gather metrics instead of writing your own metrics gathering code? Take a look at PIX and NVidia's perfhud tools.
-
This may or may not be a bug. It could just as easily be heap fragmentation by malloc that is out of the control of D3DX. I'd create a sample that reproduces the problem and send it to MS via the connect site or to directx@microsoft.com (connect is better, though).
-
As long as the two sprite textures are the same format, you can copy directly between them by using StretchRect. Get the surface interface for each texture's level and then StretchRect from one to the other. This is ultimately what D3DX utility functions will do, but in your case you don't need the extra functionality of D3DX, a simple ...
-
[quote user="dimple"]I am little confused when you say disable the last stage. What do i need to do to disable it.[/quote] You disable a stage by setting its texture to 0 and setting the color and alpha ops to D3DTOP_DISABLE.
-
In addition to what Ralf said, if you're targetting Windows 7 you might want to look at the "Ex" version of the 9 interfaces as they simplify some resource management and expose a few more features.