please help(ERROR's)

Posts 110 of 10 · Page 1 of 1
please help(ERROR's)
Okay I went over this code all night I havnt went to sleep yet and I have 2 main errors I cant fix tell e if this is correct

Code:
using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;




namespace D3D_basics
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        Devise DX_Device = null; // Drawing device
        

public dx()
{
    
   this.ClientSize = new Size(256,256); // Specify the client size
   this.Text = "My First DirectX Program"; // Specify the title
}

        public bool InitializeDirect3D()
{
   try
   {
     PresentParameters pps = new PresentParameters();
     pps.Windowed = true; // Specify that it will be in a window
     pps.SwapEffect = SwapEffect.Discard; // After the current screen is drawn, it will be automatically // deleted from memory
     DX_Device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, pps); // Put everything into the device
     return true;
   }
   catch(DirectXException e)
   {
     MessageBox.Show(e.ToString(), "Error"); // Handle all the exceptions
     return false;
   }
}
        
            static void Main()
{
dx form = new dx(); // Create the form
   
   if (form.InitializeDirect3D() == false) // Check if D3D could be initialized
   {
       
      MessageBox.Show("Could not initialize Direct3D.", "Error");
      return;
   }

   form.Show(); // When everything is initialized, show the form
   while(form.Created) // This is our message loop
   {
      form.Render(); // Keep rendering until the program terminates
      Application.DoEvents(); // Process the events, like keyboard and mouse input
   }
            }


    private void Render()
{ 
   if(DX_Device == null) // If the device is empty don't bother rendering
   {
      return;
   }



   DX_Device.Clear(ClearFlags.Target, Color.White, 1.0f, 0); // Clear the window to white
   DX_Device.BeginScene();

   // Rendering is done here

   DX_Device.EndScene();
   DX_Device.Present();
}
    }
 

}
Would you like to tell what are the errors ?
What the fuck are you trying to do? Main() method in there? How many Main() methods do you need? You know you have one in Program.cs right?

I guess not.. You C&Ped that crap.. For god sake, start learning the BASICS!

I'm not going to fix your stupid errors because you just want to C&P without trying to learn the structure of a program first.

Pretty much you have this:

In the Program Class you have the Main() which is calling the Form1 Class which has another Main method inside.. Ofc the program will freak out.
so SHould I go and delte the other one, and yes I c&p this to study it and edit it so I can learn more

And it only says it dx must have return value and I have one
You are using Windows Forms -> Wrong
You are creating the Main() Method inside blalbalb (already on the last post) -> Wrong
You are creating a Constructor of a Class which you don't have -> Wrong

Forget the damt windows forms..
Go learn about C# program structures
Go learn about Classes..
THEN try D3D with C#.
Ok but I cant find any good tut the tuts dont explain it I need somthing that explaines every thing
Quote Originally Posted by tremaster View Post
Ok but I cant find any good tut the tuts dont explain it I need somthing that explaines every thing
you need to start from 0, thats what you need. Buy a book and read it.
And a book about C#. TO START.
I cant my mom refuses to buy me one I am only 15

Did you see my hack thats good tho right?
Quote Originally Posted by tremaster View Post
I cant my mom refuses to buy me one I am only 15

Did you see my hack thats good tho right?
Find a .PDF online
I found a good youtube sieres
Posts 110 of 10 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?