Exemplo n.º 1
0
 public RScreen2D()
 {
     if (_instance == null)
     {
         _instance = this;
         _instance._spritebatch = new SpriteBatch(REngine.Instance._graphics.GraphicsDevice);
         _instance._basicEffect = new BasicEffect(REngine.Instance._graphics.GraphicsDevice);
         _instance._lineDeclaration = VertexPositionColor.VertexDeclaration;
         _instance._lineTexture = new Texture2D(REngine.Instance._graphics.GraphicsDevice, 1, 1);
         _instance._lineTexture.SetData(new Color[] { Color.White });
     }
     else
     {
     }
 }
Exemplo n.º 2
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");
        }