New to Managed DirectX

eh?
Send a few snippets of your code rather than a doc, right when you declare your Device and when you instantiate it should be fine.

Dont give up on MDX :),
Its hard to get started, I agree - it took me about a half-a-year to get my thoughts organized o_O, and things started to click.

Well anyways - send snippets of your code, and tell us what DLLs (actually theyre .libs in C++ arent they?) you imported.

-Pent
 
Thanx for the support

This is what I have.

private:
Device* device;


public:
bool InitializeGraphics()
{
PresentParameters* pres = new PresentParameters();

pres->Windowed = true;
pres->SwapEffect = SwapEffect::Discard;
device = new Device(0, DeviceType::Hardware, this, CreateFlags::SoftwareVertexProcessing, pres);
return true;
}


I get an error when creating the device.
I have references to
Microsoft.DirectX.Direct3D
Microsoft.DirectX
Micosoft.DirectX.Direct3DX.
And I also included the namesaces
using namespace Microsoft::DirectX;
using namespace Microsoft::DirectX::Direct3D;
 
It seems to me that youre not setting enough flags for the PresentParameters. Mine looks something like this (just ignore the vb and look at the main source :):

Protected D3Dpp As PresentParameters = Nothing
Protected DP As DisplayMode = Nothing

DP = Manager.Adapters.Default.CurrentDisplayMode

D3Dpp = New PresentParameters()
D3Dpp.BackBufferFormat = DP.Format
D3Dpp.BackBufferWidth = DP.Width
D3Dpp.BackBufferHeight = DP.Height
D3Dpp.SwapEffect = SwapEffect.Discard
D3Dpp.PresentationInterval = PresentInterval.Immediate

D3Dpp.Windowed =
True


Also, shouldnt the argument for instantiating the device be, "this.Handle" or your hWnd? (Im not sure if it is in C++)

If that doesnt help, what does the error say? Maybe then we can help you more.

-The Pentium Guy
 
Thank you

Thanks a lot, but my problem is that it seems like the syntax for MC++ is slightly different from the syntax in VB or C#; and I
 
Could you please specifically state the error?
Also, I dont know why the PresentParams is an array (maybe its supposed to be in C++?)
Whats the error in your code?

-The Pentium Guy
 
Here are some of my errors Im getting

Yes, as far as I know in MC++ the PresentParameters is an array. Theres a few differences from VB and CSharp.

error C3635: Microsoft.DirectX.PrivateImplementationDetails.IDirect3DDevice9: undefined native type used in Microsoft.DirectX.Direct3D.Device; imported native types must be defined in the importing source code

error C3377: Microsoft.DirectX.Direct3D:Device..ctor : cannot import method - a parameter type or the return type is inaccessible

Note:
I changed the :: for . because it was not letting me post the reply
 
Back
Top