示例#1
0
        private void newMapToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (NewMapDlg newMapDlg = new NewMapDlg())
            {
                if (newMapDlg.ShowDialog(this) == DialogResult.OK)
                {
                    int   w       = newMapDlg.GetHMapWidth();
                    int   h       = newMapDlg.GetHMapHeight();
                    float xScale  = newMapDlg.GetHMapXScale();
                    float yScale  = newMapDlg.GetHMapYScale();
                    float zScale  = newMapDlg.GetHMapZScale();
                    int   bits    = newMapDlg.GetHMapBits();
                    int   initVal = newMapDlg.GetInitValue();

                    CoreAPI.mgCreateMap(newMapDlg.GetMapName(),
                                        w, h,
                                        bits, initVal,
                                        xScale, yScale, zScale);

                    if (newMapDlg.GetInitType() == NewMapDlg.EInitType.Noise)
                    {
                        CoreAPI.mgHeightmapNoise(0, 0, -1, -1,
                                                 newMapDlg.GetNoiseOctaves(),
                                                 newMapDlg.GetNoiseAmplitude(),
                                                 newMapDlg.GetNoiseFrequency());
                    }
                }//endof if(OK)
            }
        }
 public void onInputMessage(ref Message m)
 {
     unchecked
     {
         CoreAPI.mgCameraDefaultInput(m.Msg, (uint)m.WParam, (uint)m.LParam);
     }
 }
        protected override void OnPaint(PaintEventArgs pe)
        {
            // TODO: Add custom paint code here
            CoreAPI.mgRender();

            // Calling the base class OnPaint
            base.OnPaint(pe);
        }
示例#4
0
        private void UpdateBrush()
        {
            int shape = 0;

            if (rbtnSquare.Checked)
            {
                shape = 1;
            }

            int lerpMode = cmbLerpMode.SelectedIndex;

            int innerRadius = tbInner.Value;
            int outerRadius = tbOuter.Value;
            int strength    = tbStrength.Value;

            CoreAPI.mgSetBrush(shape, lerpMode, innerRadius, outerRadius, strength);
        }
示例#5
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            int clientW = 800,
                clientH = 600;

            using (MainForm mainFrm = new MainForm(clientW, clientH))
            {
                CoreAPI.mgCreateEngine(mainFrm.getRenderTargetWnd(), clientW, clientH);
                mainFrm.Show();

                while (mainFrm.Created)
                {
                    CoreAPI.mgRender();
                    Application.DoEvents();
                }
            }//endof using

            CoreAPI.mgDestroyEngine();
        } //endo Main()