public void Render() { if (OptionsForm.options.ShowGrid) { float a = OptionsForm.options.GridOpacity; float size = OptionsForm.options.GridSize; gridModel.Color = new Color(0.4f, 0.4f, 0.4f, a); GL.LineWidth(1f); gridModel.Reset(); gridModel.Scale(size); gridModel.Draw(); gridModel.Color = new Color(0.8f, 0.8f, 0.8f, a); GL.LineWidth(3f); gridModel.Scale(10f); gridModel.Draw(); GL.LineWidth(1f); } GL.Enable(EnableCap.StencilTest); GL.Clear(ClearBufferMask.StencilBufferBit); GL.Disable(EnableCap.StencilTest); EMesh.MeshProgram["view"].SetValue(editorCamera.View); EMesh.MeshProgram["projection"].SetValue(editorCamera.Projection); foreach (EMesh m in Meshes) { m.Draw(); } foreach (EMesh m in Meshes) { m.DrawUI(); } GL.Enable(EnableCap.StencilTest); GL.Clear(ClearBufferMask.StencilBufferBit); GL.Disable(EnableCap.StencilTest); Manipulator.Draw(); selectionBox.Draw(); meshCreator.Draw(); }
/// <summary> /// Time to paint my dear ! /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RenderControl_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { RenderControl.MakeCurrent(); // Stop the draw timer DrawTimer.Stop(); // Clear the background Display.ClearBuffers(); Batch.Begin(); // Background texture // Background texture Rectangle dst = new Rectangle(Point.Empty, RenderControl.Size); Batch.Draw(CheckerBoard, dst, dst, Color.White); // Draw the layout CurrentLayout.Draw(Batch); // Draw the selection box SelectionBox.Draw(Batch); // If no action and mouse over an element, draw its bounding box if (SelectionBox.MouseTool == MouseTools.NoTool) { Control elem = FindElementAt(RenderControl.PointToClient(System.Windows.Forms.Control.MousePosition)); if (elem != null) { //Display.DrawRectangle(elem.Rectangle, Color.White); } } Batch.End(); RenderControl.SwapBuffers(); // Start the draw timer DrawTimer.Start(); }
public void Draw(SpriteBatch spriteBatch) { spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, null); background.Draw(spriteBatch); dialogBox.Draw(spriteBatch, 0, 2.5f); playerTextureRectangle.Draw(spriteBatch); opponentTextureRectangle.Draw(spriteBatch); opponentBattleFrame.Draw(spriteBatch); playerBattleFrame.Draw(spriteBatch); playerName.Draw(spriteBatch, playerPokemon.PokemonStats.Name.ToUpper(), 2f); playerLevel.Draw(spriteBatch, playerPokemon.PokemonStats.Level.ToString(), 2f); opponentName.Draw(spriteBatch, opponentPokemon.PokemonStats.Name.ToUpper(), 2f); opponentLevel.Draw(spriteBatch, opponentPokemon.PokemonStats.Level.ToString(), 2f); playerPokemonHp.Draw(spriteBatch, playerPokemon.PokemonStats.CurrentHp.ToString(), 2f); playerPokemonMaxHp.Draw(spriteBatch, "/" + playerPokemon.PokemonStats.Hp.ToString(), 2f); opponentPokemonSprite.Draw(spriteBatch); playerPokemonSprite.Draw(spriteBatch); selectionBoxAction.Draw(spriteBatch); selectionBoxMove.Draw(spriteBatch); opponentHealthBar.Draw(spriteBatch); playerHealthBar.Draw(spriteBatch); spriteBatch.End(); }