Full-screen DirectX Mobile (HTC Touch Pro)?

Started by
-1 comments, last by BeanDog 15 years, 3 months ago
I'm just going crazy trying to get full-screen mode to work with the Touch Pro. Windowed mode works as expected (black screen, or whatever color I Clear to), but full-screen just does nothing at all. No exceptions are thrown (all the calls are supposedly working fine), but all I see on the screen is the white form background. I'm using C# and DirectX Mobile. The project is targeting Windows Mobile 6 Professional. Here's the entire code of the only source file in the project:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile.DirectX.Direct3D;
using Microsoft.WindowsMobile.DirectX;

namespace Tilt {
    public class frmMain : Form {
        [MTAThread]
        static void Main() {
            frmMain f = new frmMain();
            f.InitializeGraphics();
            f.Show();
            while (f.Created) {
                f.Render();
                Application.DoEvents();
            }
            f.DisposeGraphics();
        }


        public Device device;
        public bool Created;

        protected bool InitializeGraphics() {
            Created = true;

            PresentParameters p = new PresentParameters();
            p.SwapEffect = SwapEffect.CopyVSync;
            p.Windowed = true;

            /*
             * For some reason, these settings allow the device to be created,
             * but nothing gets drawn (the form's white background is just shown
             * full-screen).  WTFmate?

            DisplayMode dm = Manager.Adapters.Default.CurrentDisplayMode;
            p.Windowed = false;
            p.BackBufferWidth = dm.Width;
            p.BackBufferHeight = dm.Height;
            p.BackBufferFormat = dm.Format;
            */

            device = new Device(0, DeviceType.Default, this, CreateFlags.None, p);

            return true;
        }

        protected void Render() {
            device.Clear(ClearFlags.Target, Color.Black, 1.0F, 0);
            device.BeginScene();


            device.EndScene();
            device.Present();
        }

        protected void DisposeGraphics() {
            device.Dispose();
        }
    }
}
Any help would be greatly appreciated!

This topic is closed to new replies.

Advertisement