Jump to content

  • Log In with Google      Sign In   
  • Create Account


Full-screen DirectX Mobile (HTC Touch Pro)?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 BeanDog   Members   -  Reputation: 1063

Like
0Likes
Like

Posted 31 December 2008 - 06:28 AM

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!

~BenDilts( void );

Lucidchart: Online Flow Chart Software; Lucidpress: Digital Publishing Software


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS