Cocytus

Greetings,

        I have been going through the begining game development articles and haave reached an impass. I have just finished the Second article so everyone knows where i am at in the code. I tried to run what i have so far and i get the following:

 

Microsoft.DirectX.Direct3D.InvalidCallException was unhandled
  Message="Error in the application."
  Source="Microsoft.DirectX.Direct3D"
  ErrorCode=-2005530516
  ErrorString="D3DERR_INVALIDCALL"
  StackTrace:
       at Microsoft.DirectX.Direct3D.Device..ctor(Int32 adapter, DeviceType deviceType, Control renderWindow, CreateFlags behaviorFlags, PresentParameters[] presentationParameters)
       at BattleTank.GameEngine..ctor() in C:\Documents and Settings\Jason\My Documents\Visual Studio 2005\Projects\BattleTank\BattleTank\GameEngine.cs:line 68
       at BattleTank.Program.Main() in C:\Documents and Settings\Jason\My Documents\Visual Studio 2005\Projects\BattleTank\BattleTank\Program.cs:line 15
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

 

This happens at the following line:

device = new Device( adapterOrdinal,

                               DeviceType.Hardware,

                               this,

                               createFlags,

                               presentParams

                              );

 

Any help with solving this problem would be wonderful as i would like to test out the code. Thank you for your help.

 

-Cocytus



Re: Game Technologies: DirectX 101 Beginning Game Development problem

CyberLord_Dan

Be sure that adapterOrdinal is an integer, and then instead of simply createFlags write CreateFlags.SoftwareVertex............. or whatever u want the flags to be. Also make sure that the presentParams are valid