Example #1
0
        unsafe public GamePostRenderer(RenderSystem rs, RtsCamera camera)
        {
            this.factory = rs.ObjectFactory;

            this.renderSys = rs;
            this.camera    = camera;

            compEff      = new Composite(rs);
            gaussBlur    = new GaussBlur(rs);
            edgeEff      = new EdgeDetect(rs);
            depthViewEff = new DepthView(rs);

            vtxDecl = factory.CreateVertexDeclaration(RectVertex.Elements);

            whitePixel = factory.CreateTexture(1, 1, 1, TextureUsage.StaticWriteOnly, ImagePixelFormat.A8R8G8B8);
            *(uint *)whitePixel.Lock(0, LockMode.None).Pointer.ToPointer() = 0xffffffff;
            whitePixel.Unlock(0);

            LoadUnmanagedResources();
        }
Example #2
0
        public GameScene(RenderSystem rs)
        {
            renderSys = rs;

            Viewport vp = rs.Viewport;
            float aspectRatio = vp.Width / (float)vp.Height;
            camera = new RtsCamera(42.5f, aspectRatio);


            SceneRendererParameter sm = new SceneRendererParameter();
            sm.SceneManager = new OctplSceneManager(PlanetEarth.PlanetRadius);
            sm.UseShadow = true;
            sm.PostRenderer = new GamePostRenderer(renderSys, camera);




            renderer = new SceneRenderer(renderSys, sm);
            renderer.ClearColor = ColorValue.White;


            camera.NearPlane = 20;
            camera.FarPlane = 6000;
            camera.Mode = RenderMode.Final;
            camera.RenderTarget = renderSys.GetRenderTarget(0);

            renderer.RegisterCamera(camera);



            PlanetEarth earth = new PlanetEarth(renderSys);
            sm.SceneManager.AddObjectToScene(earth);

            OceanWater water = new OceanWater(renderSys);
            sm.SceneManager.AddObjectToScene(water);

            //Atmosphere atmos = new Atmosphere(renderSys);
            //sm.SceneManager.AddObjectToScene(atmos);

        }
Example #3
0
        unsafe public GamePostRenderer(RenderSystem rs, RtsCamera camera)
        {
            this.factory = rs.ObjectFactory;

            this.renderSys = rs;
            this.camera = camera;

            compEff = new Composite(rs);
            gaussBlur = new GaussBlur(rs);
            edgeEff = new EdgeDetect(rs);
            depthViewEff = new DepthView(rs);

            vtxDecl = factory.CreateVertexDeclaration(RectVertex.Elements);

            whitePixel = factory.CreateTexture(1, 1, 1, TextureUsage.StaticWriteOnly, ImagePixelFormat.A8R8G8B8);
            *(uint*)whitePixel.Lock(0, LockMode.None).Pointer.ToPointer() = 0xffffffff;
            whitePixel.Unlock(0);

            LoadUnmanagedResources();
        }
Example #4
0
        //float rot;

        public MiniMap(Code2015 game, Game parent, GameScene scene, GameState gamelogic)
        {
            this.parent = parent;
            this.game = game;
            this.renderSys = game.RenderSystem;
            this.scene = scene;
            this.gameLogic = gamelogic;
            this.camera = scene.Camera;

            FileLocation fl = FileSystem.Instance.Locate("nig_minimap.tex", GameFileLocs.GUI);
            background = UITextureManager.Instance.CreateInstance(fl);


            #region 内容显示
            fl = FileSystem.Instance.Locate("ig_map_view.tex", GameFileLocs.GUI);
            cameraView = UITextureManager.Instance.CreateInstance(fl);


            //fl = FileSystem.Instance.Locate("ig_mp_redpoint.tex", GameFileLocs.GUI);
            //redDot = UITextureManager.Instance.CreateInstance(fl);
            //fl = FileSystem.Instance.Locate("ig_mp_greenpoint.tex", GameFileLocs.GUI);
            //greenDot = UITextureManager.Instance.CreateInstance(fl);
            //fl = FileSystem.Instance.Locate("ig_mp_yellowpoint.tex", GameFileLocs.GUI);
            //yellowDot = UITextureManager.Instance.CreateInstance(fl);
            //fl = FileSystem.Instance.Locate("ig_mp_bluepoint.tex", GameFileLocs.GUI);
            //blueDot = UITextureManager.Instance.CreateInstance(fl);
            fl = FileSystem.Instance.Locate("nig_mp_dot.tex", GameFileLocs.GUI);
            mapdot = UITextureManager.Instance.CreateInstance(fl);

            fl = FileSystem.Instance.Locate("nig_mp_circle.tex", GameFileLocs.GUI);
            mapCircle = UITextureManager.Instance.CreateInstance(fl);


            //fl = FileSystem.Instance.Locate("ig_mp_red.tex", GameFileLocs.GUI);
            //redRing  = UITextureManager.Instance.CreateInstance(fl);
            //fl = FileSystem.Instance.Locate("ig_mp_green.tex", GameFileLocs.GUI);
            //greenRing = UITextureManager.Instance.CreateInstance(fl);
            //fl = FileSystem.Instance.Locate("ig_mp_yellow.tex", GameFileLocs.GUI);
            //yellowRing = UITextureManager.Instance.CreateInstance(fl);
            //fl = FileSystem.Instance.Locate("ig_mp_blue.tex", GameFileLocs.GUI);
            //blueRing = UITextureManager.Instance.CreateInstance(fl);

            #endregion

        }
Example #5
0
 public Picker(Code2015 game, Game parent, GameScene scene, GameState gamelogic)
 {
     this.parent = parent;
     this.game = game;
     this.renderSys = game.RenderSystem;
     this.scene = scene;
     this.logic = gamelogic;
     this.camera = scene.Camera;
 }