Jump to content
  • Advertisement
Sign in to follow this  
kapil1089theking

Starting with DirectX

This topic is 3621 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

inside my Program.cs: using System; using System.Collections.Generic; using System.Windows.Forms; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; namespace Game { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { using (WinForm our_directx_form = new WinForm()) { Application.Run(our_directx_form); } } } } I am getting Buid Error: Error 1 The type or namespace name 'WinForm' could not be found (are you missing a using directive or an assembly reference?) Error 2 The type or namespace name 'WinForm' could not be found (are you missing a using directive or an assembly reference?) Error 3 The best overloaded method match for 'System.Windows.Forms.Application.Run(System.Windows.Forms.Form)' has some invalid arguments Error 4 Argument '1': cannot convert from 'WinForm' to 'System.Windows.Forms.Form' Chamging WinForm to Form1 works well. Plz help me to debug

Share this post


Link to post
Share on other sites
Advertisement
I never deal with XNA, only normal windows form programming. But are you sure you have a class called "WinForm", instead of "Form1" (which is default class name)? Else you need to refactor you class name.

Share this post


Link to post
Share on other sites
The reason "Form1" works but "WinForm" doesn't is that, by default, the class that defines your basic Windows form is called Form1.

When you new-up an object as in your "WinForm our_directx_form = new WinForm()" you're trying to create an object of type WinForm, which sounds like it isn't defined.

If you are learning Managed DirectX, have you thought about trying XNA? It's similar (C# based) but much simpler to get your head around, and MDX is kind of dead now i.e. no future support I gather.

Share this post


Link to post
Share on other sites
Hi,
Is there anything called WinForm inside directX?
Can anybody suggest DirectX SDK(april 2007) is supported by WindowsXp or not? I have Visual studio 2005. and the above directX, I want to make 3D game plz help me with the basic with URLs.

Share this post


Link to post
Share on other sites
As others have mentioned, Managed DirectX is effectively dead. XNA is the closest thing to an official replacement, and can be used as a Direct3D wrapper if need be (though, as a beginner, using the built-in helper classes will make life much easier).

If you want to use something that looks more like classic Direct3D, SlimDX is your best bet.

Both have samples that should get you up and running in no time. [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by kapil1089theking
Hi,
Is there anything called WinForm inside directX?

Why you insist to use "WinForm"? Under this assembly/namespace('System.Windows.Forms.Form'), I do not think it has. You can re-factor it easily

Quote:
Original post by kapil1089theking

Can anybody suggest DirectX SDK(april 2007) is supported by WindowsXp or not? I have Visual studio 2005. and the above directX, I want to make 3D game plz help me with the basic with URLs.



even June 2008 support Windows XP (but not DX10.1):
Supported Operating Systems: Windows Server 2003; Windows Server 2003 R2 (32-Bit x86); Windows Server 2003 R2 Datacenter Edition (32-Bit x86); Windows Server 2003 R2 Datacenter x64 Edition; Windows Server 2003 R2 Enterprise Edition (32-Bit x86); Windows Server 2003 R2 Enterprise x64 Edition; Windows Server 2003 R2 Standard Edition (32-bit x86); Windows Server 2003 R2 Standard x64 Edition ; Windows Server 2003 R2 x64 editions; Windows Server 2003 Service Pack 1; Windows Server 2003 Service Pack 2; Windows Server 2003 Service Pack 2 x64 Edition; Windows Server 2003 x64 editions; Windows Server 2003, Datacenter Edition (32-bit x86); Windows Server 2003, Datacenter x64 Edition; Windows Server 2003, Enterprise Edition (32-bit x86); Windows Server 2003, Enterprise x64 Edition; Windows Server 2003, Standard Edition (32-bit x86); Windows Server 2003, Standard x64 Edition; Windows Server 2003, Web Edition; Windows Server 2008; Windows Server 2008 Datacenter; Windows Server 2008 Datacenter without Hyper-V; Windows Server 2008 Enterprise; Windows Server 2008 Enterprise without Hyper-V; Windows Server 2008 Standard; Windows Server 2008 Standard without Hyper-V; Windows Small Business Server 2003 ; Windows Vista; Windows Vista 64-bit Editions Service Pack 1; Windows Vista Business; Windows Vista Business 64-bit edition; Windows Vista Business N; Windows Vista Enterprise; Windows Vista Enterprise 64-bit edition; Windows Vista Home Basic; Windows Vista Home Basic 64-bit edition; Windows Vista Home Basic N; Windows Vista Home Premium; Windows Vista Home Premium 64-bit edition; Windows Vista Service Pack 1; Windows Vista Starter; Windows Vista Starter N; Windows Vista Ultimate; Windows Vista Ultimate 64-bit edition; Windows Web Server 2008; Windows XP; Windows XP 64-bit; Windows XP Home Edition ; Windows XP Home Edition N; Windows XP Media Center Edition; Windows XP Professional Edition ; Windows XP Professional N; Windows XP Professional x64 Edition ; Windows XP Service Pack 1; Windows XP Service Pack 2; Windows XP Service Pack 3; Windows XP Starter Edition; Windows XP Tablet PC Edition

Share this post


Link to post
Share on other sites
Hi guys Kapil is obviously very new to game programming. I know managed DirectX has been superseded but there are some very good basic tutorials in it to help you get around some of the fundamentals of DirectX which can then make C++ with DirectX a lot easier (this is the way I learnt, there is plenty of support for beginners to get through the basics) so this is why he is doing it with C# or am I wrong?

Kapil, I have already told you that you would get this problem. You need to either rename your Form1 class to WinForm or change your WinForm to Form1, it has nothing to do with DirectX it is an implementation of a Windows Form object which is automatically generated when you create a new visual studio project. You could even delete everything in the Program.cs file and paste in all the code at the bottom of the Riemers tutorial pages, this would also fix your problem.

Yes the DX9 April 2007 SDK is fully compatible with WinXP, all versions of DirectX 9 are.

Andy

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!