예제 #1
0
        public EngineWindow(Form1 f, CLI.DirectZobWrapper directZobWrapper)
        {
            InitializeComponent();
            m_mainForm                  = f;
            m_directZobWrapper          = directZobWrapper;
            m_engineWrapper             = new CLI.EngineWrapper();
            m_width                     = m_engineWrapper.GetBufferWidth();
            m_height                    = m_engineWrapper.GetBufferHeight();
            EngineRender.Width          = m_width;
            EngineRender.Height         = m_height;
            m_EngineGraphics            = EngineRender.CreateGraphics();
            m_engineThread              = new Thread(RunEngineThread);
            m_engineThread.IsBackground = true;
            UpdateEngineWindowDelegate  = new UpdateEngineWindow(UpdateEngineWindowMethod);

            m_engineThread.Start();
            if (OnBeginFrame != null)
            {
                OnBeginFrame(this, EventArgs.Empty);
            }
            m_directZobWrapper.RunAFrame();
            IntPtr p = m_engineWrapper.GetBufferData();

            m_engineBitmap = new System.Drawing.Bitmap(m_width, m_height, 4 * m_width, System.Drawing.Imaging.PixelFormat.Format32bppRgb, p);
            if (OnEndFrame != null)
            {
                OnEndFrame(this, EventArgs.Empty);
            }
        }
예제 #2
0
 public EngineControl(CLI.EngineWrapper e)
 {
     InitializeComponent();
     m_engineWrapper   = e;
     showGrid.Checked  = true;
     wireframe.Checked = false;
     m_engineWrapper.ShowGrid(showGrid.Checked);
     m_engineWrapper.WireFrame(wireframe.Checked);
 }