⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wdxmutdata.cs

📁 VC中使用C#作为脚本引擎编程
💻 CS
📖 第 1 页 / 共 2 页
字号:
        private bool isDeviceCreateCalled; // if true, then CreateDevice*() or SetDevice() was called

        private bool isDeviceObjectsCreated; // if true, then DeviceCreated callback has been called (if non-NULL)
        private bool isDeviceObjectsReset; // if true, then DeviceReset callback has been called (if non-NULL)
        private bool isInsideDeviceCallback; // if true, then the framework is inside an app device callback
        private bool isInsideMainloop; // if true, then the framework is inside the main loop
        private bool isActive; // if true, then the app is the active top level window
        private bool isTimePaused; // if true, then time is paused
        private bool isRenderingPaused; // if true, then rendering is paused
        private int pauseRenderingCount; // pause rendering ref count
        private int pauseTimeCount; // pause time ref count
        private bool isDeviceLost; // if true, then the device is lost and needs to be reset
        private bool isMinimized; // if true, then the window is minimized
        private bool isMaximized; // if true, then the window is maximized
        private bool isSizeChangesIgnored; // if true, the sample framework won't reset the device upon window size change (for public use only)
        private bool isNotifyOnMouseMove; // if true, include WM_MOUSEMOVE in mousecallback

        private int overrideAdapterOrdinal; // if != -1, then override to use this adapter ordinal
        private bool overrideWindowed; // if true, then force to start windowed
        private bool overrideFullScreen; // if true, then force to start full screen
        private int overrideStartX; // if != -1, then override to this X position of the window
        private int overrideStartY; // if != -1, then override to this Y position of the window
        private int overrideWidth; // if != 0, then override to this width
        private int overrideHeight; // if != 0, then override to this height
        private bool overrideForceHAL; // if true, then force to Hardware device (failing if one doesn't exist)
        private bool overrideForceREF; // if true, then force to Reference device (failing if one doesn't exist)
        private bool overrideForcePureHWVP; // if true, then force to use pure Hardware VertexProcessing (failing if device doesn't support it)
        private bool overrideForceHWVP; // if true, then force to use Hardware VertexProcessing (failing if device doesn't support it)
        private bool overrideForceSWVP; // if true, then force to use Software VertexProcessing 
        private bool overrideConstantFrameTime; // if true, then force to constant frame time
        private float overrideConstantTimePerFrame; // the constant time per frame in seconds if overrideConstantFrameTime==true
        private int overrideQuitAfterFrame; // if != 0, then it will force the app to quit after that frame

        private IDeviceCreation deviceCallback; // Callback for device creation and acceptability
        private IFrameworkCallback frameworkCallback; // Framework callback interface
        private WndProcCallback wndFunc; // window messages callback

        private SettingsDialog settings; // The settings dialog
        private bool isShowingD3DSettingsDlg; // if true, then show the settings dialog

        private ArrayList timerList = new ArrayList(); // list of TimerData structs
        private string staticFrameStats; // static part of frames stats 
        private string frameStats; // frame stats (fps, width, etc)
        private string deviceStats; // device stats (description, device type, etc)
        private string windowTitle; // window title

        #endregion

        #region Properties
        public Device Device { get { return device; } set { device = value; } }
        public DeviceSettings CurrentDeviceSettings { get { return currentDeviceSettings; } set { currentDeviceSettings = value; } }
        public SurfaceDescription BackBufferSurfaceDesc { get { return backBufferSurfaceDesc; } set { backBufferSurfaceDesc = value; } }
        public Capabilities Capabilities { get { return caps; } set { caps = value; } }

        public System.Windows.Forms.Control WindowFocus { get { return windowFocus; } set { windowFocus = value; } }
        public System.Windows.Forms.Control WindowDeviceFullScreen { get { return windowDeviceFullScreen; } set { windowDeviceFullScreen = value; } }
        public System.Windows.Forms.Control WindowDeviceWindowed { get { return windowDeviceWindowed; } set { windowDeviceWindowed = value; } }
        public IntPtr AdapterMonitor { get { return adapterMonitor; } set { adapterMonitor = value; } }
        public double CurrentTime { get { return currentTime; } set { currentTime = value; } }
        public float ElapsedTime { get { return elapsedTime; } set { elapsedTime = value; } }

        public System.Windows.Forms.FormStartPosition DefaultStartingLocation { get { return defaultStartingLocation; } set { defaultStartingLocation = value; } }
        public System.Drawing.Rectangle ClientRectangle { get { return clientRect; } set { clientRect = value; } }
        public System.Drawing.Rectangle FullScreenClientRectangle { get { return fullScreenClientRect; } set { fullScreenClientRect = value; } }
        public System.Drawing.Rectangle WindowBoundsRectangle { get { return windowBoundsRect; } set { windowBoundsRect = value; } }
        public System.Drawing.Point ClientLocation { get { return windowLocation; } set { windowLocation = value; } }
        public System.Windows.Forms.MainMenu Menu { get { return windowMenu; } set { windowMenu = value; } }
        public double LastStatsUpdateTime { get { return lastStatsUpdateTime; } set { lastStatsUpdateTime = value; } }
        public uint LastStatsUpdateFrames { get { return lastStatsUpdateFrames; } set { lastStatsUpdateFrames = value; } }
        public float CurrentFrameRate { get { return frameRate; } set { frameRate = value; } }
        public int CurrentFrameNumber { get { return currentFrameNumber; } set { currentFrameNumber = value; } }

        public bool IsHandlingDefaultHotkeys { get { return isHandlingDefaultHotkeys; } set { isHandlingDefaultHotkeys = value; } }
        public bool IsShowingMsgBoxOnError { get { return isShowingMsgBoxOnError; } set { isShowingMsgBoxOnError = value; } }
        public bool IsCursorClippedWhenFullScreen { get { return isClipCursorWhenFullScreen; } set { isClipCursorWhenFullScreen = value; } }
        public bool IsShowingCursorWhenFullScreen { get { return isShowingCursorWhenFullScreen; } set { isShowingCursorWhenFullScreen = value; } }
        public bool IsUsingConstantFrameTime { get { return isConstantFrameTime; } set { isConstantFrameTime = value; } }
        public float TimePerFrame { get { return timePerFrame; } set { timePerFrame = value; } }
        public bool IsInWireframeMode { get { return isInWireframeMode; } set { isInWireframeMode = value; } }
        public bool CanAutoChangeAdapter { get { return canAutoChangeAdapter; } set { canAutoChangeAdapter = value; } }
        public bool IsWindowCreatedWithDefaultPositions { get { return isWindowCreatedWithDefaultPositions; } set { isWindowCreatedWithDefaultPositions = value; } }
        public int ApplicationExitCode { get { return applicationExitCode; } set { applicationExitCode = value; } }

        public bool IsInited { get { return isInited; } set { isInited = value; } }
        public bool WasWindowCreated { get { return wasWindowCreated; } set { wasWindowCreated = value; } }
        public bool WasDeviceCreated { get { return wasDeviceCreated; } set { wasDeviceCreated = value; } }

        public bool WasInitCalled { get { return isInitCalled; } set { isInitCalled = value; } }
        public bool WasWindowCreateCalled { get { return isWindowCreateCalled; } set { isWindowCreateCalled = value; } }
        public bool WasDeviceCreateCalled { get { return isDeviceCreateCalled; } set { isDeviceCreateCalled = value; } }

        public bool AreDeviceObjectsCreated { get { return isDeviceObjectsCreated; } set { isDeviceObjectsCreated = value; } }
        public bool AreDeviceObjectsReset { get { return isDeviceObjectsReset; } set { isDeviceObjectsReset = value; } }
        public bool IsInsideDeviceCallback { get { return isInsideDeviceCallback; } set { isInsideDeviceCallback = value; } }
        public bool IsInsideMainloop { get { return isInsideMainloop; } set { isInsideMainloop = value; } }
        public bool IsActive { get { return isActive; } set { isActive = value; } }
        public bool IsTimePaused { get { return isTimePaused; } set { isTimePaused = value; } }
        public bool IsRenderingPaused { get { return isRenderingPaused; } set { isRenderingPaused = value; } }
        public int PauseRenderingCount { get { return pauseRenderingCount; } set { pauseRenderingCount = value; } }
        public int PauseTimeCount { get { return pauseTimeCount; } set { pauseTimeCount = value; } }
        public bool IsDeviceLost { get { return isDeviceLost; } set { isDeviceLost = value; } }
        public bool IsMinimized { get { return isMinimized; } set { isMinimized = value; } }
        public bool IsMaximized { get { return isMaximized; } set { isMaximized = value; } }
        public bool AreSizeChangesIgnored { get { return isSizeChangesIgnored; } set { isSizeChangesIgnored = value; } }
        public bool IsNotifiedOnMouseMove { get { return isNotifyOnMouseMove; } set { isNotifyOnMouseMove = value; } }

        public int OverrideAdapterOrdinal { get { return overrideAdapterOrdinal; } set { overrideAdapterOrdinal = value; } }
        public bool IsOverridingWindowed { get { return overrideWindowed; } set { overrideWindowed = value; } }
        public bool IsOverridingFullScreen { get { return overrideFullScreen; } set { overrideFullScreen = value; } }
        public int OverrideStartX { get { return overrideStartX; } set { overrideStartX = value; } }
        public int OverrideStartY { get { return overrideStartY; } set { overrideStartY = value; } }
        public int OverrideWidth { get { return overrideWidth; } set { overrideWidth = value; } }
        public int OverrideHeight { get { return overrideHeight; } set { overrideHeight = value; } }
        public bool IsOverridingForceHardware { get { return overrideForceHAL; } set { overrideForceHAL = value; } }
        public bool IsOverridingForceReference { get { return overrideForceREF; } set { overrideForceREF = value; } }
        public bool IsOverridingForcePureHardwareVertexProcessing { get { return overrideForcePureHWVP; } set { overrideForcePureHWVP = value; } }
        public bool IsOverridingForceHardwareVertexProcessing { get { return overrideForceHWVP; } set { overrideForceHWVP = value; } }
        public bool IsOverridingForceSoftwareVertexProcessing { get { return overrideForceSWVP; } set { overrideForceSWVP = value; } }
        public bool IsOverridingConstantFrameTime { get { return overrideConstantFrameTime; } set { overrideConstantFrameTime = value; } }
        public float OverrideConstantTimePerFrame { get { return overrideConstantTimePerFrame; } set { overrideConstantTimePerFrame = value; } }
        public int OverrideQuitAfterFrame { get { return overrideQuitAfterFrame; } set { overrideQuitAfterFrame = value; } }

        public IDeviceCreation DeviceCreationInterface { get { return deviceCallback; } set { deviceCallback = value; } }
        public IFrameworkCallback CallbackInterface { get { return frameworkCallback; } set { frameworkCallback = value; } }
        public WndProcCallback WndProcFunction { get { return wndFunc; } set { wndFunc = value; } }

        public SettingsDialog Settings { get { return settings; } set { settings = value; } }
        public bool IsD3DSettingsDialogShowing { get { return isShowingD3DSettingsDlg; } set { isShowingD3DSettingsDlg = value; } }

        public ArrayList Timers { get { return timerList; } set { timerList = value; } }
        public string StaticFrameStats { get { return staticFrameStats; } set { staticFrameStats = value; } }
        public string FrameStats { get { return frameStats; } set { frameStats = value; } }
        public string DeviceStats { get { return deviceStats; } set { deviceStats = value; } }
        public string WindowTitle { get { return windowTitle; } set { windowTitle = value; } }
        #endregion

        /// <summary>
        /// Initialize data
        /// </summary>
        public FrameworkData()
        {
            // Set some initial data
            overrideStartX = -1;
            overrideStartY = -1;
            overrideAdapterOrdinal = -1;
            canAutoChangeAdapter = true;
            isShowingMsgBoxOnError = true;
            isActive = true;
            defaultStartingLocation = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation;
        }
    }
    #endregion

    #region Framework's Default Window
    /// <summary>
    /// The main window that will be used for the sample framework
    /// </summary>
    public class GraphicsWindow : System.Windows.Forms.Form
    {
        private Framework parent = null;
        public GraphicsWindow(Framework frame)
        {
            parent = frame;
            this.MinimumSize = Framework.MinWindowSize;
        }

        /// <summary>
        /// Will call into the sample framework's window proc
        /// </summary>
        protected override void WndProc(ref Message m)
        {
            parent.WindowsProcedure(ref m);
            base.WndProc(ref m);
        }
    }
    #endregion
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -