当前位置: 首页>>代码示例>>C#>>正文


C# GraphicsDeviceManager类代码示例

本文整理汇总了C#中GraphicsDeviceManager的典型用法代码示例。如果您正苦于以下问题:C# GraphicsDeviceManager类的具体用法?C# GraphicsDeviceManager怎么用?C# GraphicsDeviceManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GraphicsDeviceManager类属于命名空间,在下文中一共展示了GraphicsDeviceManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadContent

        public void LoadContent(ContentManager content, GraphicsDeviceManager graphicsDeviceManager)
        {
            texture = content.Load<Texture2D>("brick_texture_map");

            wall = new VertexPositionTexture[22];
            wall[0] = new VertexPositionTexture(new Vector3(200, 0, 200), new Vector2(0, 0));
            wall[1] = new VertexPositionTexture(new Vector3(200, 200, 200), new Vector2(2, 0));
            wall[2] = new VertexPositionTexture(new Vector3(0, 0, 200), new Vector2(0, 2));
            wall[3] = new VertexPositionTexture(new Vector3(0, 200, 200), new Vector2(2, 2));
            wall[4] = new VertexPositionTexture(new Vector3(0, 0, 220), new Vector2(0, 0));
            wall[5] = new VertexPositionTexture(new Vector3(0, 200, 220), new Vector2(2, 0));
            wall[6] = new VertexPositionTexture(new Vector3(200, 0, 220), new Vector2(0, 2));
            wall[7] = new VertexPositionTexture(new Vector3(200, 200, 220), new Vector2(2, 2));
            wall[8] = new VertexPositionTexture(new Vector3(200, 0, 200), new Vector2(0, 0));
            wall[9] = new VertexPositionTexture(new Vector3(200, 200, 220), new Vector2(2, 0));
            wall[10] = new VertexPositionTexture(new Vector3(200, 200, 200), new Vector2(2, 2));
            wall[11] = new VertexPositionTexture(new Vector3(0, 200, 220), new Vector2(0, 2));
            wall[12] = new VertexPositionTexture(new Vector3(0, 200, 200), new Vector2(0, 0));

            // Set vertex data in VertexBuffer
            vertexBuffer = new VertexBuffer(graphicsDeviceManager.GraphicsDevice, typeof(VertexPositionTexture), wall.Length, BufferUsage.None);
            vertexBuffer.SetData(wall);

            // Initialize the BasicEffect
            effect = new BasicEffect(graphicsDeviceManager.GraphicsDevice);
        }
开发者ID:Woodje,项目名称:3DGame,代码行数:26,代码来源:Wall.cs

示例2: TrueCraftGame

        public TrueCraftGame(MultiplayerClient client, IPEndPoint endPoint)
        {
            Window.Title = "TrueCraft";
            Content.RootDirectory = "Content";
            Graphics = new GraphicsDeviceManager(this);
            Graphics.SynchronizeWithVerticalRetrace = false;
            Graphics.IsFullScreen = UserSettings.Local.IsFullscreen;
            Graphics.PreferredBackBufferWidth = UserSettings.Local.WindowResolution.Width;
            Graphics.PreferredBackBufferHeight = UserSettings.Local.WindowResolution.Height;
            Client = client;
            EndPoint = endPoint;
            NextPhysicsUpdate = DateTime.MinValue;
            ChunkMeshes = new List<Mesh>();
            IncomingChunks = new ConcurrentBag<Mesh>();
            PendingMainThreadActions = new ConcurrentBag<Action>();
            MouseCaptured = true;

            var keyboardComponent = new KeyboardComponent(this);
            KeyboardComponent = keyboardComponent;
            Components.Add(keyboardComponent);

            var mouseComponent = new MouseComponent(this);
            MouseComponent = mouseComponent;
            Components.Add(mouseComponent);
        }
开发者ID:Luigifan,项目名称:TrueCraft,代码行数:25,代码来源:TrueCraftGame.cs

示例3: Game1

 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferWidth = 835;
     graphics.PreferredBackBufferHeight = 480;
     Content.RootDirectory = "Content";
 }
开发者ID:bruinbrown,项目名称:DevSCMonogame,代码行数:7,代码来源:Game1.cs

示例4: FieldPong

        public FieldPong()
        {
            graphics = new GraphicsDeviceManager(this);
            content = new ContentManager(Services);

            graphics.PreferredBackBufferWidth = 1024;
            graphics.PreferredBackBufferHeight = 768;
            graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0;
            graphics.SynchronizeWithVerticalRetrace = true;

            physicsSimulator = new PhysicsSimulator(new Vector2(0));
            physicsSimulator.AllowedPenetration = 0.3f;
            physicsSimulator.BiasFactor = 1.0f;
            Services.AddService(typeof(PhysicsSimulator), physicsSimulator);

            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            bloomProcessor = new BloomPostProcessor(this);
            Components.Add(bloomProcessor);

            // Uncomment this to monitor the FPS:

            //fpsCounter = new FrameRateCounter(this);
            //Components.Add(fpsCounter);

            audioEngine = new AudioEngine("Content\\Audio\\FieldPongAudio.xgs");
            waveBank = new WaveBank(audioEngine, "Content\\Audio\\Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, "Content\\Audio\\Sound Bank.xsb");

            backgroundMusic = soundBank.GetCue("GameSong0010 16 Bit");
            backgroundMusic.Play();
        }
开发者ID:zpconn,项目名称:FieldPong,代码行数:33,代码来源:FieldPong.cs

示例5: Game1

        public Game1(IntPtr drawSurface)
        {
            Logger.Instance.log("Game1 creation started.");

            Instance = this;

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = 800;
            graphics.PreferredBackBufferHeight = 600;

            Content.RootDirectory = "Content";

            Logger.Instance.log("Creating Winform.");
            this.drawSurface = drawSurface;
            graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
            winform = (Forms.Form)Forms.Form.FromHandle(Window.Handle);
            winform.VisibleChanged += new EventHandler(Game1_VisibleChanged);
            winform.Size = new System.Drawing.Size(10, 10);
            Mouse.WindowHandle = drawSurface;
            resizebackbuffer(MainForm.Instance.pictureBox1.Width, MainForm.Instance.pictureBox1.Height);
            winform.Hide();
            Logger.Instance.log("Winform created.");

            Logger.Instance.log("Game1 creation ended.");
        }
开发者ID:ChadyG,项目名称:MUGE-GLEED2D,代码行数:25,代码来源:Game1.cs

示例6: Game1

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            Components.Add(new GamerServicesComponent(this));
        }
开发者ID:pboud071,项目名称:Labyrinthe,代码行数:7,代码来源:Game1.cs

示例7: Limak

 public Limak()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     graphics.PreferredBackBufferWidth = 820;
     graphics.PreferredBackBufferHeight = 460;
 }
开发者ID:askjervold,项目名称:limak,代码行数:7,代码来源:Limak.cs

示例8: TTRGame

        public TTRGame()
        {
            Content.RootDirectory = "Content";

            // create the TTengine for this game
            TTengineMaster.Create(this);

            // basic XNA graphics init here (before Initialize() and LoadContent() )
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = preferredWindowWidth;
            graphics.PreferredBackBufferHeight = preferredWindowHeight;
#if RELEASE
            graphics.IsFullScreen = true;
#else
            graphics.IsFullScreen = false;
#endif
            //this.TargetElapsedTime = TimeSpan.FromMilliseconds(10);
#if PROFILE
            this.IsFixedTimeStep = false;
            graphics.SynchronizeWithVerticalRetrace = false;
#else
            this.IsFixedTimeStep = false;
            graphics.SynchronizeWithVerticalRetrace = true;
#endif
        }
开发者ID:IndiegameGarden,项目名称:TTR,代码行数:25,代码来源:TTRGame.cs

示例9: Game1

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);

            graphics.PreferredBackBufferWidth = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;

            ScreenRectangle = new Rectangle(
                0,
                0,
                screenWidth,
                screenHeight);

            Content.RootDirectory = "Content";

            Components.Add(new InputHandler(this));

            stateManager = new GameStateManager(this);
            Components.Add(stateManager);

            TitleScreen = new TitleScreen(this, stateManager);
            StartMenuScreen = new StartMenuScreen(this, stateManager);
            GamePlayScreen = new GamePlayScreen(this, stateManager);
            CharacterGeneratorScreen = new CharacterGeneratorScreen(this, stateManager);
            LoadGameScreen = new LoadGameScreen(this, stateManager);
            SkillScreen = new GameScreens.SkillScreen(this, stateManager);

            stateManager.ChangeState(TitleScreen);

            this.IsFixedTimeStep = false;
            graphics.SynchronizeWithVerticalRetrace = false;
        }
开发者ID:vkuts,项目名称:Gamesor,代码行数:32,代码来源:Game1.cs

示例10: Game1

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            map.Open(@"C:\Users\Stephen\Dropbox\Map Editor\New Maps\Fried.adm");
        }
开发者ID:Gupocca,项目名称:AdrenMapperGUI,代码行数:7,代码来源:Game1.cs

示例11: Game1

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);

            Content.RootDirectory = "Content";
            IsMouseVisible = true;
        }
开发者ID:LuddeW,项目名称:StarWarzDefence,代码行数:7,代码来源:Game1.cs

示例12: BalloonFW

 public BalloonFW()
 {
     Content.RootDirectory = "Content";
     graphics = new GraphicsDeviceManager(this);
     inputHelper = new InputHelper();
     this.IsMouseVisible = true;
 }
开发者ID:pienpien34,项目名称:BalloonFW,代码行数:7,代码来源:Painter.cs

示例13: Game1

 public Game1()
     : base()
 {
     graphics = new GraphicsDeviceManager(this);
     scene = new GameScene(this);
     Content.RootDirectory = "Content";
 }
开发者ID:vegah,项目名称:Library3d,代码行数:7,代码来源:Game1.cs

示例14: MainGame

        public MainGame()
        {
            this.IsMouseVisible = true;

            graphics = new GraphicsDeviceManager(this);
            this.graphics.PreparingDeviceSettings += this.GraphicsDevicePreparingDeviceSettings;

            Content.RootDirectory = "Content";

            this.chooser = new Kinect(this, ColorImageFormat.RgbResolution640x480Fps30, DepthImageFormat.Resolution640x480Fps30);
            this.Services.AddService(typeof(Kinect), this.chooser);

            this.Components.Add(this.chooser);

            this.statusCheck = new KinectStatusCheck(this);
            this.Components.Add(this.statusCheck);

            this.depthComponent = new DepthStreamRenderer(this);

            this.plane = new Plane(this);
            this.Components.Add(this.plane);

            UpdateStreamSizeAndLocation();

            // Obliczenia
            a = 7;
            b = 3;

            sum1 = Add(true);
            b1 = BasicTest();

            sum2 = Add(false);
            b2 = BasicTest();
        }
开发者ID:kira333,项目名称:MyProjects,代码行数:34,代码来源:MainGame.cs

示例15: Camera

 public Camera(GraphicsDeviceManager grph)
 {
     zoom = 1.0f;
     rotation = 0.0f;
     pos = Vector2.Zero;
     graphics = grph;
 }
开发者ID:DuncanKeller,项目名称:The-Unbinding,代码行数:7,代码来源:Camera.cs


注:本文中的GraphicsDeviceManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。