Beispiel #1
0
        public RAtmosphere()
        {
            if (_instance == null)
            {

                _instance = this;

                return;
            }
            else
            {
                return;
            }
        }
Beispiel #2
0
        public void Dispose()
        {
            if (_instance != null)
            {

                if (_instance.skyEffect != null)
                {
                    _instance.skyEffect.Dispose();
                    _instance.skyEffect = null;
                }
                if (_instance.skyResource != null)
                {
                    _instance.skyResource.Unload();
                    _instance.skyResource = null;
                }
                if (_instance.skyTex != null)
                {
                    _instance.skyTex.Dispose();
                    _instance.skyTex = null;
                }
                _instance = null;
                return;
            }
            else
            {
                return;
            }
        }
Beispiel #3
0
        public override void Init()
        {
            #if !XBOX
            this.Reactor.Init3DGame(1280, 720, false);
            #else
            this.Reactor.Init3DGame(180, 720, true);
            this.Reactor.SetXBox360Resolution(CONST_REACTOR_XBOX_RESOLUTION.r720P);
            #endif
            this.Reactor.SetWatermarkPosition(CONST_REACTOR_WATERMARK_POSITION.BOTTOM_RIGHT);
            Reactor.ShowFPS(true);
            Reactor.AllowEscapeQuit(true);
            Reactor.ShowMouse(false);
            //Reactor.SetDebugFile("debug.txt");
            //Reactor.SetDebugMode(true);
            scene = new RScene();
            screen = new RScreen2D();
            textures = new RTextureFactory();
            //lighting = new RLightingFactory();
            //materials = new RMaterialFactory();

            Reactor.Resized += new ViewportResized(Reactor_Resized);
            camera = this.Reactor.GetCamera();
            camera.SetClipPlanes(1f, 180000);
            atmosphere = new RAtmosphere();
            atmosphere.Initialize();
            input = new RInput();
            camera.Position = R3DVECTOR.Zero;
            camera.LookAt(new R3DVECTOR(0.5f,0f,0.5f));
            font = screen.Create_TextureFont("Font1", "Font1");
            //emitter = (RParticleEmitter)scene.CreateNode<RParticleEmitter>("myemitter");
            //emitter2 = scene.CreateParticleEmitter(CONST_REACTOR_PARTICLETYPE.Billboard, "myemitter2");
            landscape = (RLandscape)scene.CreateNode<RLandscape>("myland");
            water = (RWater)scene.CreateNode<RWater>("mywater");
            //mesh = (RActor)scene.CreateNode<RActor>("mymesh");
        }