/// <summary> /// Called per frame update, sets up drawing and then draws all objects in the frame list /// </summary> public void draw() { /** First prepare stuff */ //preDraw(); /** Draw font shit first */ QFont.Begin(); GL.Disable(EnableCap.DepthTest); GL.PushMatrix(); mFont.DrawVBOs(); GL.PopMatrix(); QFont.End(); GL.Enable(EnableCap.DepthTest); GL.Disable(EnableCap.Texture2D); foreach (IDrawable drawObj in mObjectList) { drawObj.draw(); } }
public void draw() { float offset = 0; float scale = (mMaxHeight * 2f) / mDimensions.Y; QFont.Begin(); GL.Disable(EnableCap.DepthTest); GL.PushMatrix(); mLargeFont.DrawVBOs(); mSmallFont.DrawVBOs(); GL.PopMatrix(); QFont.End(); GL.Enable(EnableCap.DepthTest); GL.Disable(EnableCap.Texture2D); foreach (var kvp in mPoints) { offset += mDimensions.Y; GL.Begin(BeginMode.LineStrip); GL.Color3(Color.Red); for (int i = 0; i < kvp.Value.Count; i++) { GL.Vertex2(( float )( float )i * (WindowDimensions.X / ( float )MAX_POINTS), (kvp.Value[i].X / scale) + offset); } GL.End(); GL.Begin(BeginMode.LineStrip); GL.Color3(Color.Green); for (int i = 0; i < kvp.Value.Count; i++) { GL.Vertex2(( float )i * (WindowDimensions.X / ( float )MAX_POINTS), (kvp.Value[i].Y / scale) + offset); } GL.End(); GL.Begin(BeginMode.LineStrip); GL.Color3(Color.Blue); for (int i = 0; i < kvp.Value.Count; i++) { GL.Vertex2(( float )i * (WindowDimensions.X / ( float )MAX_POINTS), (kvp.Value[i].Z / scale) + offset); } GL.End(); GL.Enable(EnableCap.LineStipple); GL.LineStipple(6, Convert.ToInt16("0011011100110011", 2)); GL.Begin(BeginMode.Lines); GL.Color3(Color.White); GL.Vertex2(WindowDimensions.X - (WindowDimensions.X / 8), offset - (440f / scale)); GL.Vertex2(WindowDimensions.X, offset - (440f / scale)); GL.Vertex2(WindowDimensions.X - (WindowDimensions.X / 8), offset - (220f / scale)); GL.Vertex2(WindowDimensions.X, offset - (220f / scale)); GL.Vertex2(WindowDimensions.X - (WindowDimensions.X / 8), offset + (440f / scale)); GL.Vertex2(WindowDimensions.X, offset + (440f / scale)); GL.Vertex2(WindowDimensions.X - (WindowDimensions.X / 8), offset + (220f / scale)); GL.Vertex2(WindowDimensions.X, offset + (220f / scale)); GL.End(); GL.Disable(EnableCap.LineStipple); /** Draw the dotted 1g/2g lines */ } }