예제 #1
0
파일: Game.cs 프로젝트: Keilerr/csat
        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();
        }
예제 #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();
        }
예제 #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();
        }
예제 #4
0
        public override void Render()
        {
            GL.Clear(ClearFlags);
            camera.SetFPSCamera();

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

            Camera.Set2D();
            font.Write("Particles");
            Camera.Set3D();
            base.Render();
        }
예제 #5
0
파일: TestPath.cs 프로젝트: Keilerr/csat
        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();
        }
예제 #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();
        }
예제 #7
0
파일: BaseGame.cs 프로젝트: Keilerr/csat
 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();
 }
예제 #8
0
파일: Test2D.cs 프로젝트: Keilerr/csat
        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();
        }
예제 #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();
        }
예제 #10
0
 public override void Init()
 {
     back = Texture2D.Load("bg.jpg");
     Camera.Set2D();
     base.Init();
 }