コード例 #1
0
        /// <summary>
        /// Finish a drawing frame and render everything in queues.
        /// </summary>
        public static void EndDrawFrame()
        {
            // draw rendering queues
            RenderingQueues.DrawQueues();

            // notify nodes manager that a frame ended
            NodesManager.EndFrame();

            // clear the last material applied
            Materials.MaterialAPI._lastMaterialApplied = null;
        }
コード例 #2
0
        /// <summary>
        /// Init GraphicsManager.
        /// </summary>
        /// <param name="graphics">Graphic device manager.</param>
        public static void Initialize(GraphicsDeviceManager graphics)
        {
            // set global stuff
            GraphicsDeviceManager = graphics;
            GraphicsDevice        = graphics.GraphicsDevice;

            // init all rendering queues
            RenderingQueues.Initialize();

            // create sprite batch
            _spriteBatch = new SpriteBatch(graphics.GraphicsDevice);
        }
コード例 #3
0
        /// <summary>
        /// Render a renderable entity.
        /// Will either render immediately, or add to the corresponding rendering queue.
        /// </summary>
        /// <param name="entity">Entity to render.</param>
        /// <param name="world">World matrix for the entity.</param>
        public static void DrawEntity(BaseRenderableEntity entity, Matrix world)
        {
            // if no queue, draw immediately and return
            if (entity.RenderingQueue == RenderingQueue.NoQueue)
            {
                entity.DoEntityDraw(ref world);
                return;
            }

            // add to the rendering queue
            RenderingQueues.AddEntity(entity, world);
        }
コード例 #4
0
        /// <summary>
        /// Finish a drawing frame and render everything in queues.
        /// </summary>
        public static void EndDrawFrame()
        {
            // draw rendering queues
            RenderingQueues.DrawQueues();

            // notify nodes manager that a frame ended
            NodesManager.EndFrame();

            // start frame for deferred lighting manager
            if (IsDeferredLightingEnabled)
            {
                _DeferredLighting.FrameEnd();
            }

            // clear the last material applied
            Materials.MaterialAPI._lastMaterialApplied = null;
        }