void UpdateString() { if (!m_texture.Initialized) { return; } int width = m_texture.Width; int height = m_texture.Height; Rectangle rect = new Rectangle(0, 0, width, height); Bitmap bitmap = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap); graphics.TextRenderingHint = TextRenderingHint.AntiAlias; graphics.Clip = new Region(rect); graphics.DrawString(m_text, m_font, m_brush, 0.0f, 0.0f); graphics.Flush(); BitmapData data = bitmap.LockBits(rect, ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); GraphicsCommand.UpdateTextureRGBA(m_texture, data.Scan0); bitmap.UnlockBits(data); m_updateString = false; bitmap.Dispose(); graphics.Dispose(); }
public override void DrawShadow(Light a_light) { if (m_model != null) { lock (this) { GraphicsCommand.BindModel(m_model); GraphicsCommand.DrawElementsUInt(m_model.Indices); } } }
public override void Draw(Camera a_camera) { if (m_model != null) { lock (this) { GraphicsCommand.BindModel(m_model); GraphicsCommand.DrawElementsUInt(m_model.Indices); } } }
internal override Vector2 Draw(Vector2 a_resolution, Vector2 a_trueResolution) { CalculateTrueTransform(); int widthDiff = m_internalWidth - m_width; int heightDiff = m_internalHeight - m_height; TrueDrawingPosition = new Vector2(m_scrollPos.X * widthDiff, m_scrollPos.Y * heightDiff); TruePosition = new Vector2(TruePosition.X - m_scrollPos.X * widthDiff, TruePosition.Y + m_scrollPos.Y * heightDiff); GraphicsCommand.SetViewport(GetActiveRect(a_resolution)); return(TrueSize); }
public override void DrawShadow(Light a_light) { if (m_model != null) { lock (this) { if (m_matrices != null) { GraphicsCommand.BindMatrix4(Material.Program, 128, m_matrices); } GraphicsCommand.BindModel(m_model); GraphicsCommand.DrawElementsUInt(m_model.Indices); } } }
public override void Draw(Camera a_camera) { if (m_model != null) { lock (this) { // Dirty but works if (m_matrices != null) { GraphicsCommand.BindMatrix4(Material.Program, 128, m_matrices); } GraphicsCommand.BindModel(m_model); GraphicsCommand.DrawElementsUInt(m_model.Indices); } } }
internal override Vector2 Draw(Vector2 a_resolution, Vector2 a_trueResolution) { if (m_texture != null && m_texture.Initialized) { CalculateTrueTransform(); Matrix4 transform = ToMatrix(a_resolution, a_trueResolution); Program program = Shaders.TRANSFORM_IMAGE_SHADER_INVERTED; GraphicsCommand.BindProgram(program); GraphicsCommand.BindMatrix4(program, 0, transform); GraphicsCommand.BindTexture(program, 1, m_texture, 0); GraphicsCommand.Draw(); } return(a_resolution); }
public override void DrawShadow(Light a_light) { switch (m_drawingMode) { case e_MaterialDrawingMode.Triangles: { GraphicsCommand.DrawTriangles(m_indices); break; } default: { GraphicsCommand.Draw(m_indices); break; } } }
public override void Draw(Camera a_camera) { switch (m_drawingMode) { case e_MaterialDrawingMode.Triangles: { GraphicsCommand.DrawTriangles(m_indices); break; } default: { GraphicsCommand.Draw(m_indices); break; } } }
internal override void PostDraw(Vector2 a_resolution, Vector2 a_trueResolution) { GraphicsCommand.SetViewport(new Rectangle(0, 0, (int)a_resolution.X, (int)a_resolution.Y)); }