israel Posted August 5, 2004 Posted August 5, 2004 (edited) I just downloaded managed directX and I�m trying to run my first application but I cannot even create the device. I always get this error (with another six that I think are related) 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 Does anybody know what I�m doing wrong? My code is in the txt file attached Thanx Edited August 6, 2004 by mutant Quote
ThePentiumGuy Posted August 6, 2004 Posted August 6, 2004 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. Don't 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 they're .libs in C++ arent they?) you imported. -Pent Quote 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
israel Posted August 6, 2004 Author Posted August 6, 2004 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; Quote
ThePentiumGuy Posted August 6, 2004 Posted August 6, 2004 It seems to me that you're 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, shouldn't the argument for instantiating the device be, "this.Handle" or your hWnd? (I'm not sure if it is in C++) If that doesn't help, what does the error say? Maybe then we can help you more. -The Pentium Guy Quote 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
israel Posted August 6, 2004 Author Posted August 6, 2004 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�ve found almost nothing about MC++ and Managed DirectX, not even in the msdn I found a snippet of code but it doesn�t compile either. Here�s what I found: public: bool InitializeGraphics(void) { try { // Now let's setup our D3D stuff PresentParameters *presentParams[] = new PresentParameters *[1]; presentParams[0] = new PresentParameters; presentParams[0]->Windowed = true; presentParams[0]->SwapEffect = SwapEffect::Discard; device = new Device(0, DeviceType::Hardware, this->get_Handle(), CreateFlags::SoftwareVertexProcessing, presentParams ); return true; } Quote
ThePentiumGuy Posted August 6, 2004 Posted August 6, 2004 Could you please specifically state the error? Also, I don't know why the PresentParams is an array (maybe it's supposed to be in C++?) What's the error in your code? -The Pentium Guy Quote 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
israel Posted August 6, 2004 Author Posted August 6, 2004 Here are some of my errors I'm getting Yes, as far as I know in MC++ the PresentParameters is an array. There's 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 Quote
ThePentiumGuy Posted August 6, 2004 Posted August 6, 2004 Sorry man, I cant help you out http://www.xtremedotnettalk.com/x_images/images/smilies/frown.gif. I guess your last resort is to paste your entire source in here, with [ code ] //your code [ /code ] tags (no space in between the brackets). If the mods don't allow that then just PM me with the source. -Pent Quote 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
ThePentiumGuy Posted August 10, 2004 Posted August 10, 2004 Hey yo, before you give up this link may help you out. Check out the text file there http://www.xtremedotnettalk.com/showthread.php?t=86046 Quote 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
israel Posted August 12, 2004 Author Posted August 12, 2004 Thx Thanks man, I�m writing some examples in C# now but before I work on the definitive application I�m giving one more try to MC++ Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.