public void OnRenderFrame(FrameEventArgs e) { c.UseWorldProjection(); GL.EnableClientState(ArrayCap.VertexArray); GL.EnableClientState(ArrayCap.TextureCoordArray); foreach (Entity ent in area.EntList) { GL.PushMatrix(); ent.Draw(); GL.PopMatrix(); } GL.PushMatrix(); player.Draw(); GL.PopMatrix(); c.UseUIProjection(); GL.PushMatrix(); InventoryBox.Draw(); GL.PopMatrix(); GL.PushMatrix(); player.DrawInventory(); GL.PopMatrix(); GL.DisableClientState(ArrayCap.VertexArray); GL.DisableClientState(ArrayCap.TextureCoordArray); GL.PushMatrix(); GL.Translate(new Vector3(5, 50, 0)); font.Print(message); GL.PopMatrix(); GL.BindTexture(TextureTarget.Texture2D, 0); if (fadeBox.Color.A > 0) { GL.EnableClientState(ArrayCap.VertexArray); GL.PushMatrix(); fadeBox.Draw(); GL.PopMatrix(); GL.DisableClientState(ArrayCap.VertexArray); } }
protected override void OnRenderFrame(FrameEventArgs e) { base.OnRenderFrame(e); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); curState.OnRenderFrame(e); //TODO render reading stuff here if (reading) { GL.PushMatrix(); GL.EnableClientState(ArrayCap.VertexArray); paper.Draw(); GL.DisableClientState(ArrayCap.VertexArray); GL.PopMatrix(); GL.PushMatrix(); RectangleF test = paper.GetBoundsWithBorder(16); ink.Print(readingText, paper.GetBoundsWithBorder(16), QFontAlignment.Left); GL.BindTexture(TextureTarget.Texture2D, 0); GL.Color4(1.0f, 1.0f, 1.0f, 1.0f); GL.PopMatrix(); } SwapBuffers(); }