Skip to main content
gamedev.net
🔒 Locked 🤖 Godot

change screen problem

Started by Pedro Alves 3 replies 1.5k views
Original Post
Pedro Alves
Pedro Alves

i try a gamesystem when i try change the gamestament the graphics of 3d model is very poor

and i don´t know how fix the problem


        public World(Game game, Manager ola, string text)
            : base(game)
        {

            NeoManager = ola;

            texto = text;
            System.Console.Write(texto);
            //   graphicsDeviceManager.PreferredGraphicsProfile = new FeatureLevel[] { FeatureLevel.Level_9_1, };
            pointer = new PointerManager(game);


            // this game system has something to draw - enable drawing by default
            // this can be disabled to make objects drawn by this system disappear
            Visible = true;

            // this game system has logic that needs to be updated - enable update by default
            // this can be disabled to simulate a "pause" in logic update
            Enabled = true;

            // add the system itself to the systems list, so that it will get initialized and processed properly
            // this can be done after game initialization - the Game class supports adding and removing of game systems dynamically
            Game.GameSystems.Add(this);
        }

 public override void Draw(GameTime gameTime)
        {


            NeoManager.BeginDraw(gameTime);the problem is where
            GraphicsDevice.Clear(SharpDX.Color.CornflowerBlue);
            model.Draw(GraphicsDevice, world, view, projection);

            /////GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            ////  device.Clear();
            //// // Render the text
            spriteBatch.Begin();

            spriteBatch.DrawString(arial16BMFont, "Press the pointer to switch models...\r\nCurrent Model: " + model.Name, new Vector2(16, 16), Color.White);
            ////GraphicsDevice.Clear(Color.AntiqueWhite);

            //// GraphicsDevice.SamplerStates.Default;
            spriteBatch.End();


            //    GraphicsDevice.ClearState();

            NeoManager.EndDraw();// problem is cause by this 

            base.Draw(gameTime);

        
        }

   public Gamer()
        {
            // Creates a graphics manager. This is mandatory.
           
            graphicsDeviceManager = new GraphicsDeviceManager(this);
            graphicsDeviceManager.PreferredBackBufferWidth = 1280;
            graphicsDeviceManager.PreferredBackBufferHeight = 800;
            NeoManager = new Manager(this);           
            IsMouseVisible = true;
         
          //  _Login.Visible = true;

           // graphicsDeviceManager.IsFullScreen = true;
           // graphicsDeviceManager.re
          
            Content.RootDirectory = "Content";
     
  world = new World (this,NeoManager,"sa");
            
          
         

        }
Hello
Dave Hunt
Dave Hunt

I would recommend that you spend some time reading this article, then come back and edit your post.

"graphics is poor and have some lag" with a ton of code is not likely to get many helpful responses.

Pedro Alves
Pedro Alves

some of my problens with change the screen as been fix

sometimes the models flashes this is my soluction for the problem


 protected override void Draw(GameTime gameTime)
        {
         //
         
            base.Draw(gameTime);

            NeoManager.BeginDraw(gameTime);
            GraphicsDevice.Clear(SharpDX.Color.CornflowerBlue);
            SharpDX.Toolkit.Graphics.BlendState graphics = GraphicsDevice.BlendStates.Opaque;
            SharpDX.Toolkit.Graphics.BlendState op = GraphicsDevice.BlendStates.Default;
            //  graphics.MultiSampleMask(GraphicsDevice.BlendStates.Default);
           
            SharpDX.Toolkit.Graphics.DepthStencilState graphics1 = GraphicsDevice.DepthStencilStates.Default;

            NeoManager.EndDraw();
         
        }
Hello
Dave Hunt
Dave Hunt

Those lines that create a BlendState and DepthStencilState serve no purpose since you never actually apply them to the graphics device.

You still haven't done much to describe exactly what you are trying to achieve and exactly what isn't working. Please read the article I linked in my previous post and put it into practice. You will be much more successful at getting help if you do.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.