Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Ocean ocean1 = new Ocean();

            //Console.WriteLine(ocean1.Size);
            ocean1.initialise();
            ocean1.display();

            Console.ReadKey();
        }
Ejemplo n.º 2
0
        protected override void LoadContent()
        {
            lightDirection.Normalize();

            YrotationSpeed = (float)graphics.PreferredBackBufferWidth / 100000.0f;
            XrotatiobSpeed = (float)graphics.PreferredBackBufferHeight / 120000.0f;

            camera = new Camera(graphics.GraphicsDevice);
            ocean = new Ocean(Content.Load<Model>("Models/ocean"), Content.Load<Effect>("Effects/SimpleOceanShader"), Content.Load<Texture2D>("Textures/water"), Content.Load<Texture2D>("Textures/wavesbump"), lightDirection);
            sky = new SkyDome(Content.Load<Model>("Models/dome"), Content.Load<Texture2D>("Textures/SkyDay"));
            lensFlare = new LensFlareComponent(new SpriteBatch(graphics.GraphicsDevice), Content, graphics.GraphicsDevice);

            screenCenter = new Vector2(graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height) / 2;
        }
Ejemplo n.º 3
0
 public OceanGame()
 {
     m_ocean               = null;
     m_oceanRenderer       = null;
     m_disposed            = false;
     GraphicsDeviceManager = new GraphicsDeviceManager(this)
     {
         IsFullScreen              = c_isFullScreen,
         HardwareModeSwitch        = c_isHardwareFullScreen,
         PreferredBackBufferWidth  = c_windowWidth,
         PreferredBackBufferHeight = c_windowHeight
     };
     IsMouseVisible    = true;
     IsFixedTimeStep   = true;
     TargetElapsedTime = TimeSpan.FromSeconds(1) / c_targetFps;
 }
Ejemplo n.º 4
0
 public OceanRenderer(int screenWidth, int screenHeight, Ocean ocean, GraphicsDevice graphicsDevice)
 {
     m_use64BitApi    = Environment.Is64BitProcess;
     m_screenWidth    = screenWidth;
     m_screenHeight   = screenHeight;
     m_width          = ocean.Width;
     m_height         = ocean.Height;
     m_buffer         = new byte[m_width * m_height];
     m_colorBuffer    = new Color[m_width * m_height];
     m_graphicsDevice = graphicsDevice;
     m_spriteBatch    = new SpriteBatch(graphicsDevice);
     m_texture        = new Texture2D(graphicsDevice, m_width, m_height);
     m_oceanPtr       = ocean.OceanPtr;
     m_disposed       = false;
     OceanRendererPtr = m_use64BitApi ? AllocateOceanRenderer64(m_oceanPtr, IntPtr.Zero) : AllocateOceanRenderer(m_oceanPtr, IntPtr.Zero);
 }
Ejemplo n.º 5
0
        protected override void LoadContent()
        {
            lightDirection.Normalize();


            YrotationSpeed = (float)graphics.PreferredBackBufferWidth / 100000.0f;
            XrotatiobSpeed = (float)graphics.PreferredBackBufferHeight / 120000.0f;


            camera    = new Camera(graphics.GraphicsDevice);
            ocean     = new Ocean(Content.Load <Model>("Models/ocean"), Content.Load <Effect>("Effects/SimpleOceanShader"), Content.Load <Texture2D>("Textures/water"), Content.Load <Texture2D>("Textures/wavesbump"), lightDirection);
            sky       = new SkyDome(Content.Load <Model>("Models/dome"), Content.Load <Texture2D>("Textures/SkyDay"));
            lensFlare = new LensFlareComponent(new SpriteBatch(graphics.GraphicsDevice), Content, graphics.GraphicsDevice);


            screenCenter = new Vector2(graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height) / 2;
        }
Ejemplo n.º 6
0
 protected override void LoadContent()
 {
     m_ocean         = new Ocean(c_oceanWidth, c_oceanHeight);
     m_oceanRenderer = new OceanRenderer(c_windowWidth, c_windowHeight, m_ocean, GraphicsDevice);
     base.LoadContent();
 }