Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Kako napravit poštansko pismo pomoću DX - zabavno

[es] :: .NET :: Kako napravit poštansko pismo pomoću DX - zabavno

[ Pregleda: 2426 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

artriba
Split

Član broj: 158342
Poruke: 109
*.adsl.net.t-com.hr.



Profil

icon Kako napravit poštansko pismo pomoću DX - zabavno19.03.2008. u 20:15 - pre 195 meseci
1. Napravite novu windows form (C#)
2. Dodajte ovaj kod u public partial class Form1 : Form
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;

namespace MyDirectX
{
    public partial class Form1 : Form
    {
        public Form1 ()
        {
            InitializeComponent ();
        }
        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, CreateFlags.SoftwareVertexProcessing, presentParams );
        }
        protected override void OnPaint ( System.Windows.Forms.PaintEventArgs e )
        {
            device.Clear ( ClearFlags.Target, System.Drawing.Color.CornflowerBlue, 1.0f, 0 );
            device.Present ();
        }

    }
}

a ovaj kod umijesto default Main-a
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace MyDirectX
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main ()
        {
            using ( Form1 frm = new Form1 () )
            {
                // Show our form and initialize our graphics engine
                frm.Show ();
                frm.InitializeGraphics ();
                Application.Run ( frm );
            }

        }
    }
}

Dobije se plava forma.
3. Resize-ajte formu do minimuma i...dobije se pismo
 
Odgovor na temu

[es] :: .NET :: Kako napravit poštansko pismo pomoću DX - zabavno

[ Pregleda: 2426 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.