using
namespace
{
InitializeComponent();
}
presentParams.BackBufferWidth = 800;
presentParams.BackBufferHeight = 600;
presentParams.BackBufferFormat =
presentParams.Windowed =
presentParams.SwapEffect =
presentParams.AutoDepthStencilFormat =
presentParams.EnableAutoDepthStencil =
device =
device.RenderState.Lighting =
device.Lights[0].Type =
device.Lights[0].Diffuse =
device.Lights[0].Direction =
device.Lights[0].Update();
device.Lights[0].Enabled =
device.Lights[1].Type =
device.Lights[1].Diffuse =
device.Lights[1].Direction =
device.Lights[1].Update();
device.Lights[1].Enabled =
device.SamplerState[0].MinFilter =
device.SamplerState[0].MagFilter =
device.SamplerState[0].AddressU =
device.SamplerState[0].AddressV =
device.RenderState.PointSpriteEnable =
device.RenderState.PointScaleEnable =
device.RenderState.PointScaleA = 0f;
device.RenderState.PointScaleB = 0f;
device.RenderState.PointScaleC = 100f;
device.RenderState.SourceBlend =
device.RenderState.DestinationBlend =
ReadUserInput(gamespeed);
UpdatePosition(
UpdateListenerPosition();
spacemeshposition =
spacemeshangles =
gamespeed = 0;
score /= 2;
device.Clear(
device.BeginScene();
text.DrawText(
device.RenderState.Ambient =
device.Transform.World =
device.VertexFormat =
device.Material = material;
device.SetTexture(0, scenerytexture);
device.DrawUserPrimitives(
DrawMesh(spacemesh, spacemeshmaterials, spacemeshtextures);
DrawMesh(skyboxmesh, skyboxmaterials, skyboxtextures);
device.EndScene();
device.Present();
SoundAffairs();
device.Transform.Projection =
device.Transform.View =
material =
material.Diffuse =
material.Ambient =
scenerytexture =
WIDTH = 20;
HEIGHT = 15;
int_Floorplan =
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
};
mesh =
meshmaterials =
meshtextures =
meshmaterials[i] = materialarray[i].Material3D;
meshmaterials[i].Ambient = meshmaterials[i].Diffuse;
meshtextures[i] =
mesh = mesh.Clone(mesh.Options.Value,
mesh.ComputeNormals();
meshradius =
LoadMesh(
device.Material = meshmaterials[i];
device.SetTexture(0, meshtextures[i]);
mesh.DrawSubset(i);
addvector.X += (
addvector.Y += (
addvector.Z -= (
addvector.Normalize();
position += addvector * speed;
keyb =
keyb.SetCooperativeLevel(
keyb.Acquire();
gamespeed = gamespeed + 0.001f;
gamespeed = gamespeed - 0.001f;
spacemeshangles.X += 2.5f * speed;
spacemeshangles.X -= 2.5f * speed;
spacemeshangles.Z -= (
spacemeshangles.Y -= (
spacemeshangles.Z += (
spacemeshangles.Y += (
currentsound.Dispose();
soundlist.RemoveAt(i);
backmusic.SeekCurrentPosition(0,
lastmusicposition = backmusic.CurrentPosition;
sounddevice =
sounddevice.SetCooperativeLevel(
description.ControlEffects =
description3D.ControlEffects =
description3D.Control3D =
explosionsound =
explosion3D =
descriptionlistener.ControlEffects =
descriptionlistener.Control3D =
descriptionlistener.PrimaryBuffer =
primary =
listener =
backmusic =
backmusic.Play();
listener.Position = spacemeshposition;
orientation.Front =
orientation.Top =
listener.Orientation = orientation;
System.Drawing.
text =
verticeslist.Add(
verticesarray = (
components.Dispose();
our_directx_form.InitializeDevice();
our_directx_form.SetUpCamera();
our_directx_form.LoadFloorplan();
our_directx_form.VertexDeclaration();
our_directx_form.LoadTexturesAndMaterials();
our_directx_form.LoadMeshes();
our_directx_form.InitializeInputDevices();
our_directx_form.InitializeSound();
our_directx_form.InitializeFont();