- Joined
- Feb 22, 2008
- Messages
- 23
- Reaction score
- 0
So in reality, if you aren't familiar with English, don't bother to think to hard, just learn to use Google translator, because most of VB Code posted in here will be straight English, unless its invloving naming a Class.
Example of Naming a Class: class Coniki:Form
Explanation: Coniki is the name if the class you want to make under Form.
Purpose of tutorial: So you learn basic of OpenGL? Realize how easy it really is? Wonder why people make games all the time and you can't?
Tools:
A Mind (Very Important)
VC# 2008 (Use google to get it Google)
SDK DirectX10+ (Downloadable From Google and the various 10,000's of sites that house it Google)
Some Type of Focus (You need to be able to keep making mistakes and correcting them, you learn from doing wrong)
Inspiration (Without it your pretty much screwed)
First step in the tutorial is the hardest. You must find and add referneces to your project. WHY IS IT HARD? Cuz everyone forgets to do it!!
References used are
using System;
using System.Windows.Forms;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
Why these? OpenGL and its various forms mainly use these for basic function and error handling methods. Ultimately you can make your own Video Card Check, but it'll be based off these. In my tutorial I basically use a error message, standard and to the point, to alert uses of not only the error but to prompt them to take action.
A example is placed here for you to implement, but I did not include one in my own application.
{
MessageBox.Show(null,
"Your too stupid to realize your GFX Card is Fucking Up "
+ e.Message, "Error");
Close();
}
Well the above part is pretty much in English, The message box pops up if the basic preset for the graphic card initialization isn't able to execute. It will then close the application after telling you, you are dumb, along with the error.
Instead if dissecting my tutorial into pieces, I'll place it in a clump, then break it down slowly. I want people to ask questions, so limited information will be given at first, and as questions arise along with concerns and optimized code, the tutorial will "evolve".
Download my completed project below, and let me know if it works for you
It includes the .PDB :O
WARNING AGAINST FLAMMERS: /IGNORE ON
Example of Naming a Class: class Coniki:Form
Explanation: Coniki is the name if the class you want to make under Form.
Purpose of tutorial: So you learn basic of OpenGL? Realize how easy it really is? Wonder why people make games all the time and you can't?
Tools:
A Mind (Very Important)
VC# 2008 (Use google to get it Google)
SDK DirectX10+ (Downloadable From Google and the various 10,000's of sites that house it Google)
Some Type of Focus (You need to be able to keep making mistakes and correcting them, you learn from doing wrong)
Inspiration (Without it your pretty much screwed)
First step in the tutorial is the hardest. You must find and add referneces to your project. WHY IS IT HARD? Cuz everyone forgets to do it!!
References used are
using System;
using System.Windows.Forms;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
Why these? OpenGL and its various forms mainly use these for basic function and error handling methods. Ultimately you can make your own Video Card Check, but it'll be based off these. In my tutorial I basically use a error message, standard and to the point, to alert uses of not only the error but to prompt them to take action.
A example is placed here for you to implement, but I did not include one in my own application.
{
MessageBox.Show(null,
"Your too stupid to realize your GFX Card is Fucking Up "
+ e.Message, "Error");
Close();
}
Well the above part is pretty much in English, The message box pops up if the basic preset for the graphic card initialization isn't able to execute. It will then close the application after telling you, you are dumb, along with the error.
Instead if dissecting my tutorial into pieces, I'll place it in a clump, then break it down slowly. I want people to ask questions, so limited information will be given at first, and as questions arise along with concerns and optimized code, the tutorial will "evolve".
PHP:
using System;
using System.Windows.Forms;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
namespace ConikitikiIsHotzor
{
class MainClass:Form
{
private Device m_device = null;
MainClass()
{
this.Text = "Coniki Triangle Tutorial";
}
void InitGraphics()
{
PresentParameters present_params = new PresentParameters();
present_params.Windowed = true;
present_params.SwapEffect = SwapEffect.Discard;
m_device = new Device(0, DeviceType.Hardware, this,
CreateFlags.SoftwareVertexProcessing, present_params);
}
protected override void OnPaint(PaintEventArgs e)
{
CustomVertex.TransformedColored[] vertexes = new CustomVertex.TransformedColored[3];
vertexes[0].Position = new Vector4(50, 50, 0, 1.0f);
vertexes[0].Color = System.Drawing.Color.FromArgb(0, 255, 0).ToArgb();
vertexes[1].Position = new Vector4(250, 50, 0, 1.0f);
vertexes[1].Color = System.Drawing.Color.FromArgb(0, 0, 255).ToArgb();
vertexes[2].Position = new Vector4(50, 250, 0, 1.0f);
vertexes[2].Color = System.Drawing.Color.FromArgb(255, 0, 0).ToArgb();
m_device.Clear(ClearFlags.Target, System.Drawing.Color.FromArgb(0, 0, 0).ToArgb(), 1.0f, 0);
m_device.BeginScene();
m_device.VertexFormat = CustomVertex.TransformedColored.Format;
m_device.DrawUserPrimitives(PrimitiveType.TriangleList, 1, vertexes);
m_device.EndScene();
m_device.Present();
}
static void Main()
{
MainClass MainForm = new MainClass();
MainForm.InitGraphics();
Application.Run(MainForm);
}
}
}
WARNING AGAINST FLAMMERS: /IGNORE ON
Attachments
Last edited:

