Esempio n. 1
0
        /// <summary>
        /// Application constructor.
        /// </summary>
        public LightingForm()
        {
            // the number of traingles in the wall mesh
            numberTriangles = (int)((numberVertsX - 1) * (numberVertsZ - 1) * 2);

            // Set the window text
            this.Text = "Lighting";

            // Now let's setup our D3D parameters
            PresentParameters presentParams = new PresentParameters();

            presentParams.Windowed               = true;
            presentParams.SwapEffect             = SwapEffect.Discard;
            presentParams.AutoDepthStencilFormat = DepthFormat.D16;
            presentParams.EnableAutoDepthStencil = true;
            device = new Device(0, DeviceType.Default, this,
                                CreateFlags.None, presentParams);

            // setup those objects which persist through reset
            InitializeDeviceObjects();
            // attach the device reset handler
            device.DeviceReset += new EventHandler(RestoreDeviceObjects);
            // setup any device resources that will not persist through reset
            RestoreDeviceObjects(device, EventArgs.Empty);
        }
Esempio n. 2
0
 //public DirectSound.Device sound = null;
 //public DirectInput.Device keyboard = null;
 //public DirectInput.Device mouse = null;
 //public DirectInput.Device gameinput = null;
 public D3DState()
 {
     Direct3D.Device graphics = null;
     //DirectSound.Device sound = null;
     //DirectInput.Device keyboard = null;
     //DirectInput.Device mouse = null;
     //DirectInput.Device gameinput = null;
 }
        /* i_width x i_heightのテクスチャを格納するインスタンスを生成します。
         * 確保されるテクスチャのサイズは指定したサイズと異なり、i_width x i_heightのサイズを超える
         * 2のべき乗サイズになります。
         *
         */
        public NyARSurface_RGB565(Microsoft.WindowsMobile.DirectX.Direct3D.Device i_dev, int i_width, int i_height)
        {
            this.m_ref_dev = i_dev;

            this._height = i_height;
            this._width  = i_width;

            this._surface   = i_dev.CreateImageSurface(i_width, i_height, Format.R5G6B5);
            this.m_src_rect = new Rectangle(0, 0, i_width, i_height);

            //OK、完成だ。
            return;
        }
        /* i_width x i_heightのテクスチャを格納するインスタンスを生成します。
         * 確保されるテクスチャのサイズは指定したサイズと異なり、i_width x i_heightのサイズを超える
         * 2のべき乗サイズになります。
         * 
         */
        public NyARSurface_RGB565(Microsoft.WindowsMobile.DirectX.Direct3D.Device i_dev, int i_width, int i_height)
        {
            this.m_ref_dev = i_dev;

            this._height = i_height;
            this._width = i_width;

            this._surface = i_dev.CreateImageSurface(i_width, i_height, Format.R5G6B5);
            this.m_src_rect = new Rectangle(0, 0, i_width,i_height);

            //OK、完成だ。
            return;
        }
        /* i_width x i_heightのテクスチャを格納するインスタンスを生成します。
         * 確保されるテクスチャのサイズは指定したサイズと異なり、i_width x i_heightのサイズを超える
         * 2のべき乗サイズになります。
         *
         */
        public NyARTexture_RGB565(Microsoft.WindowsMobile.DirectX.Direct3D.Device i_dev, int i_width, int i_height)
        {
            this.m_ref_dev = i_dev;

            this.m_height = i_height;
            this.m_width  = i_width;

            //テクスチャサイズの確定(2^n)
            this.m_texture_height = GetSquareSize(i_height);
            this.m_texture_width  = GetSquareSize(i_width);

            //テクスチャを作るよ!
            this._texture = new Texture(i_dev, this.m_texture_width, this.m_texture_height, 0, Usage.None | Usage.Lockable, Format.R5G6B5, Pool.Managed);

            //OK、完成だ。
            return;
        }
        /* i_width x i_heightのテクスチャを格納するインスタンスを生成します。
         * 確保されるテクスチャのサイズは指定したサイズと異なり、i_width x i_heightのサイズを超える
         * 2のべき乗サイズになります。
         * 
         */
        public NyARTexture_RGB565(Microsoft.WindowsMobile.DirectX.Direct3D.Device i_dev, int i_width, int i_height)
        {
            this.m_ref_dev = i_dev;

            this.m_height = i_height;
            this.m_width = i_width;

            //テクスチャサイズの確定(2^n)
            this.m_texture_height = GetSquareSize(i_height);
            this.m_texture_width = GetSquareSize(i_width);

            //テクスチャを作るよ!
            this._texture = new Texture(i_dev, this.m_texture_width ,this.m_texture_height, 0, Usage.None | Usage.Lockable, Format.R5G6B5, Pool.Managed);

            //OK、完成だ。
            return;
        }
Esempio n. 7
0
 public virtual void Draw(Direct3D.Device graphics)
 {
 }