Exemple #1
0
        public override void Init()
        {
            Settings.TextureDir = "../../data/texture/";
            string AudioDir = "../../data/";

            back      = Texture2D.Load("bg.jpg");
            img[0]    = Texture2D.Load("head.png", true);
            img[1]    = Texture2D.Load("ball.png", true);
            crosshair = Texture2D.Load("cross.png", true);

            font = BitmapFont.Load("fonts/comic12.png");

            BaseGame.Instance.CursorVisible = false; // hide mouse cursor
            //System.Windows.Forms.Cursor.Hide();

            if (player == null)
            {
                player = new OggPlayerFBN();
                player.SetCurrentFile(AudioDir + "music.ogg");
            }
            player.Play();

            snd1 = new AudioClip(AudioDir + "snd2.ogg");
            snd2 = new AudioClip(AudioDir + "snd1.ogg");

            Camera.Set2D();
            base.Init();
        }
Exemple #2
0
        public override void Render()
        {
            ShadowMapping.SetupShadows(world, 0, true);
            GL.Clear(ClearFlags);
            camera.SetFPSCamera();

            // render scene to colorFBO
            world.RenderSceneWithParticles(colorFBO);
            colorFBO.BindFBO();
            lightImg.RenderBillboard(Light.Lights[0].Position, 0, 100, true);
            colorFBO.UnBindFBO();

            Camera.Set2D();
            {
                PostEffect.Begin(colorFBO);
                if (Keyboard[Key.R])
                {
                    blurH.RenderEffect();
                    blurV.RenderEffect();
                }
                if (Keyboard[Key.T])
                {
                    bloom.RenderEffect();
                }

                PostEffect.End().DrawFullScreen(0, 0);
                font.Write("Soft particles + effects (press R / T)");
            }
            Camera.Set3D();

            base.Render();
        }
Exemple #3
0
        public override void Init()
        {
            Settings.TextureDir = "../../data/texture/";
            string AudioDir = "../../data/";

            back   = Texture2D.Load("bg.jpg");
            img[0] = Texture2D.Load("head.png");
            font   = BitmapFont.Load("fonts/comic12.png");

            Camera.Set2D();
            base.Init();
        }
Exemple #4
0
        public override void Render()
        {
            GL.Clear(ClearFlags);
            camera.SetFPSCamera();

            world.Render();
            Particles.Render();

            Camera.Set2D();
            font.Write("Particles");
            Camera.Set3D();
            base.Render();
        }
Exemple #5
0
        public override void Render()
        {
            ShadowMapping.SetupShadows(world, 0, false);
            GL.Clear(ClearFlags);
            camera.SetCameraMatrix();
            world.Render();

            Camera.Set2D();
            font.Write(str);
            Camera.Set3D();

            base.Render();
        }
Exemple #6
0
        public override void Init()
        {
            Settings.TextureDir = "../../data/texture/";

            back      = Texture2D.Load("menu.jpg");
            crosshair = Texture2D.Load("cross.png", true);

            font = BitmapFont.Load("fonts/comic12.png");

            BaseGame.Instance.CursorVisible = false; // hide mouse cursor

            Camera.Set2D();
            base.Init();
        }
Exemple #7
0
 void Loading()
 {
     GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
     try
     {
         BitmapFont font = BitmapFont.Load("fonts/comic12.png");
         Texture.UnBind(0);
         Camera.Set2D();
         font.Write("Loading...", 0, 0);
         font.Dispose();
         Texture.UnBind(0);
     }
     catch (Exception) { }
     SwapBuffers();
 }
Exemple #8
0
        public override void Init()
        {
            // random positions for images
            for (int q = 0; q < 100; q++)
            {
                x[q] = Rnd.Next(600) + 100;
                y[q] = Rnd.Next(300) + 100;
                z[q] = (float)Rnd.NextDouble();
            }

            BaseGame.Instance.CursorVisible = false;

            back = Texture2D.Load("photo.jpg");
            img  = Texture2D.Load("mousecursor.png", true); // center origo (because rotating cursor)
            font = BitmapFont.Load("fonts/comic12.png");

            Camera.Set2D();
            base.Init();
        }
Exemple #9
0
        public override void Render()
        {
            ShadowMapping.SetupShadows(world, 0, false);
            GL.Clear(ClearFlags);
            camera.SetFPSCamera();
            world.Render();

            if (Keyboard[Key.Space])
            {
                AnimatedModel self = actors[0] as AnimatedModel;
                self.RenderSkeleton(); // note: ei näy gl3:ssa
            }

            lightImg.RenderBillboard(Light.Lights[0].Position, 0, 50, true);
            Camera.Set2D();
            font.Write("Arrow keys: move the ugly.\n" + (Settings.UseGL3 == false ? "Space: show skeleton.\n" : "") + "A,D,W,S: move the camera.\nHold left mouse button to rotate the camera.", 0, 0);
            Camera.Set3D();

            base.Render();
        }
Exemple #10
0
 public override void Init()
 {
     back = Texture2D.Load("bg.jpg");
     Camera.Set2D();
     base.Init();
 }