public static void Present() { lock (Renderlock) { FontEnginePresentTextures(); for (int i = 0; i < _listFonts.Count; ++i) { GUIFont font = _listFonts[i]; font.Present(); } if (_d3dxSpriteUsed) { if (_d3dxSprite == null) { _d3dxSprite = new Sprite(GUIGraphicsContext.DX9Device); } _d3dxSprite.Begin(SpriteFlags.AlphaBlend | SpriteFlags.SortTexture); Viewport orgView = GUIGraphicsContext.DX9Device.Viewport; Matrix orgProj = GUIGraphicsContext.DX9Device.Transform.View; Matrix projm = orgProj; Matrix finalm; foreach (FontManagerDrawText draw in _listDrawText) { finalm.M11 = draw.matrix[0, 0]; finalm.M21 = draw.matrix[0, 1]; finalm.M31 = draw.matrix[0, 2]; finalm.M41 = draw.matrix[0, 3]; finalm.M12 = draw.matrix[1, 0]; finalm.M22 = draw.matrix[1, 1]; finalm.M32 = draw.matrix[1, 2]; finalm.M42 = draw.matrix[1, 3]; finalm.M13 = draw.matrix[2, 0]; finalm.M23 = draw.matrix[2, 1]; finalm.M33 = draw.matrix[2, 2]; finalm.M43 = draw.matrix[2, 3]; finalm.M14 = 0; finalm.M24 = 0; finalm.M34 = 0; finalm.M44 = 1.0f; _d3dxSprite.Transform = finalm; GUIGraphicsContext.DX9Device.Viewport = draw.viewport; float wfactor = ((float)orgView.Width) / (float)draw.viewport.Width; float hfactor = ((float)orgView.Height) / (float)draw.viewport.Height; float xoffset = (float)(orgView.X - draw.viewport.X); float yoffset = (float)(orgView.Y - draw.viewport.Y); projm.M11 = (orgProj.M11 + orgProj.M14 * xoffset) * wfactor; projm.M21 = (orgProj.M21 + orgProj.M24 * xoffset) * wfactor; projm.M31 = (orgProj.M31 + orgProj.M34 * xoffset) * wfactor; projm.M41 = (orgProj.M41 + orgProj.M44 * xoffset) * wfactor; projm.M12 = (orgProj.M12 + orgProj.M14 * yoffset) * hfactor; projm.M22 = (orgProj.M22 + orgProj.M24 * yoffset) * hfactor; projm.M32 = (orgProj.M32 + orgProj.M34 * yoffset) * hfactor; projm.M42 = (orgProj.M42 + orgProj.M44 * yoffset) * hfactor; GUIGraphicsContext.DX9Device.Transform.View = projm; if (GUIGraphicsContext.IsDirectX9ExUsed()) { DrawTextUsingTexture(draw, draw.fontHeight); } else { draw.fnt.DrawText(_d3dxSprite, draw.text, new Rectangle((int)draw.xpos, (int)draw.ypos, 0, 0), DrawTextFormat.NoClip, draw.color); } _d3dxSprite.Flush(); } GUIGraphicsContext.DX9Device.Viewport = orgView; GUIGraphicsContext.DX9Device.Transform.View = orgProj; _d3dxSprite.End(); _listDrawText = new List <FontManagerDrawText>(); _d3dxSpriteUsed = false; } } }