Sign in to follow this  

New C# project with DirectX (problems with wizard)

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

I'm trying to learn some C# and managed DirectX so I set up a new "DirectX 9 Visual C# Wizard" project in VS.NET. No matter what options I set in it, I can't get it to compile. I get the following errors:
------ Build started: Project: Editor, Configuration: Debug .NET ------

Preparing resources...
Updating references...
Performing main compilation...
C:\Documents and Settings\beoch\My Documents\My Projects\Editor\d3dfont.cs(40,13): error CS0246: The type or namespace name 'TextureState' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\beoch\My Documents\My Projects\Editor\d3dfont.cs(41,13): error CS0246: The type or namespace name 'TextureState' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\beoch\My Documents\My Projects\Editor\d3dfont.cs(42,13): error CS0246: The type or namespace name 'Sampler' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\beoch\My Documents\My Projects\Editor\d3dapp.cs(62,15): error CS0246: The type or namespace name 'SamplerStates' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\beoch\My Documents\My Projects\Editor\d3dapp.cs(63,15): error CS0246: The type or namespace name 'TextureStates' could not be found (are you missing a using directive or an assembly reference?)

Build complete -- 5 errors, 0 warnings
Building satellite assemblies...
Satellite assemblies could not be built because the main project output is missing.


---------------------- Done ----------------------

    Build: 0 succeeded, 1 failed, 0 skipped

Why won't this compile out of the box? I haven't touched a thing and I have the latest DirectX 9 SDK installed.

Share this post


Link to post
Share on other sites
Try adding something like

using.Microsoft.DirectX;
using.Microsoft.DirectX.Direct3D;

I think the problem is it creates the necessary project, but you need to include more refrences for the commands you're using.

I'm still new to C#/MDX though, so this is only a suggustion.

:)

Share this post


Link to post
Share on other sites
Thanks for the suggestion but the code already has those included. Seems like the problem is that TextureState (etc) don't exist anywhere I can find. What's up with that?

Share this post


Link to post
Share on other sites

This topic is 4728 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.

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