/// <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; }
/// <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); }
/// <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); }
/// <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; }