private void InitObjects() { VertexBuffers.LargeGround ground = new VertexBuffers.LargeGround(dx_device); m_Objects.Add(ground); VertexBuffers.MyBillBoard bill = new VertexBuffers.MyBillBoard(dx_device); m_Objects.Add(bill); VertexBuffers.SmallGround sground = new VertexBuffers.SmallGround(dx_device); m_Objects.Add(sground); VertexBuffers.ShadowFullScreen shadows = new VertexBuffers.ShadowFullScreen(dx_device, 500, 500); m_Objects.Add(shadows); m_Walls = DxLib.WallHide.CreateRandomWalls(dx_device, 5, -3, 3, -3, 3); m_Mesh = Mesh.Teapot(dx_device); m_Material = dx_device.Material; m_Material.Diffuse = Color.Green; m_Material.Ambient = Color.Green; m_Material.Emissive = Color.Green; m_Material.Specular = Color.Green; Bitmap Bits = new Bitmap(512,512); Graphics g = Graphics.FromImage(Bits); Pen pen = new Pen(Color.Magenta); pen.Width = 5.0f; g.Clear(Color.White); g.DrawRectangle(pen, 50, 50, 100, 100); Bits.Save("test.bmp"); m_Tex = TextureLoader.FromFile(dx_device, "test.bmp"); // System.IO.Stream infile = new System.IO.FileStream("test.bmp",System.IO.FileMode.Open); // m_Tex = Texture.FromStream(dx_device, infile, Usage.None, Pool.Default); }
private void Form1_KeyDown(object sender, KeyEventArgs e) { float value = 1.0f; if (e.Control) value *= 10; switch (e.KeyCode) { case Keys.Up: m_Camera.m_Position.pos.Y -= value; break; case Keys.Down: m_Camera.m_Position.pos.Y += value; break; case Keys.Left: m_Camera.m_Position.pos.X += value; break; case Keys.Right: m_Camera.m_Position.pos.X -= value; break; case Keys.R: { m_Walls = DxLib.WallHide.CreateRandomWalls(dx_device, 100, -3, 3, -3, 3); break; } } }