| Member with 64 posts. THREAD STARTER | | | |
Quote:
Originally Posted by ckphilli Hi CyberFog. Don't take any offense, please, but I'm not in the habit of downloading files from an unknown source. Can you do me a favor and paste the offending code and what you think is relevant to that code in a post? Just wrap it in code tags (the hash button) in the menu bar please. We'll see if we can help you out. | Hi ckphili,
No offense taken  . Code: using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace programd3d
{
class Program
{
private Device device = null;
public void InitializeGraphics()
{
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed = true;
presentParams.SwapEffect = SwapEffect.Discard;
device = new Device(0, DeviceType.Hardware, this, <------------ this is line 28 responsible for errors
CreateFlags.SoftwareVertexProcessing, presentParams); <------------ this is line 29 resonsible for errors
}
static void Main()
{
using (Form1 frm = new Form1())
{
frm.Show();
frm.InitializeGraphics();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(frm);
}
}
}
}
And these are the three error codes.
Error 1 The best overloaded method match for 'Microsoft.DirectX.Direct3D.Device.Device(int, Microsoft.DirectX.Direct3D.DeviceType, System.IntPtr, Microsoft.DirectX.Direct3D.CreateFlags, params Microsoft.DirectX.Direct3D.PresentParameters[])' has some invalid arguments C:\Users\Barichke\Documents\Visual Studio 2008\Projects\programd3d\programd3d\Program.cs 28
Error 3 Argument '5': cannot convert from 'Microsoft.DirectX.Direct3D.PresentParameters' to 'Microsoft.DirectX.Direct3D.PresentParameters[]' C:\Users\Barichke\Documents\Visual Studio 2008\Projects\programd3d\programd3d\Program.cs 29
Error 2 Argument '3': cannot convert from 'programd3d.Program' to 'System.IntPtr' C:\Users\Barichke\Documents\Visual Studio 2008\Projects\programd3d\programd3d\Program.cs 28
[/COLOR] |