Jump to content
Xtreme .Net Talk

Artanis

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by Artanis

  1. Done and Done. I'll look for ways to optimize GDI+, then. Thanks for your help.
  2. Alright. I thought I was doing something wrong and getting v1 of DirectX SDK or something. :eek: I'm gonna go reinstall the october update now. And DirectX isn't what I'd expect someone to notice being updated.' Anyway. Still pretty sure I'm doing something wrong trying to draw lines.
  3. vs2003, windows2000 Are you sure it's supposed to start with a 9? I had the october update (1.02.3900.0), uninstalled it and installed the Summer update to check, 1.02.2902. The folders they were in started with 9s (v9.02.3900.0 and v9.02.2904, repsectively.) I'll just use GDI+ to draw a circle on a transparent bitmap at runtime, since the size can be set by the user, and use it as a texture. Scaling something like that would look horrible.
  4. Are those two urls supposed to be identical?DirectXTest.zip
  5. I don't think my DirectX is older. I just installed it Friday, said Oct 04 update. It needed a reference to Direct3DX, which is close enough to D3DX for me. I have a feeling a bunch of things were renamed. Just tested clsText, now looking into lines and circles.
  6. The reference files say there's a line funtion, but for some reason the place it's supposed to be, D3DX, is not there. I think I found your clsText. Public Class clsText Dim TheFont As Microsoft.DirectX.Direct3D.Font = Nothing Dim rect As New Rectangle(0, 0, 0, 0) Dim x As Microsoft.DirectX.Direct3D.font Dim y As Microsoft.DirectX.Vector3 Dim s As Microsoft.DirectX.Direct3D.Sprite Public Sub New(ByVal d3ddev As Microsoft.DirectX.Direct3D.Device, Optional ByVal fontname As String = "Courier", _ Optional ByVal Size As Integer = 10) TheFont = New Microsoft.DirectX.Direct3D.Font(d3ddev, New System.Drawing.Font(fontname, Size)) s = New Microsoft.DirectX.Direct3D.Sprite(d3ddev) End Sub Public Sub Drawtext(ByVal text As String, ByVal cColor As System.Drawing.Color) s.Begin(Microsoft.DirectX.Direct3D.SpriteFlags.AlphaBlend) TheFont.DrawText(s, text, 0, 0, cColor) s.End() End Sub End Class The Direct3D.Sprite, .Font, and .SpriteFlags are errored as not being members of Direct3D/not defined in .Net, yet msdn shows them in Direct3D here. I'm so confused. These things are supposed to be there, but they aren't. :confused:
  7. I'm writing a game file editor that draws a graphical representation of the file to a screen, so the user can see what he's doing, instead of guessing. I have to redraw this everytime something is changed. This will entail ~75,000 draw commands when everything is being drawn. It runs fine on my P4, but tends to lock slower computers for an unreasonable amount of time. Is it possible to have DirectX draw things without using sprites? Can I tell it to draw circles, lines and text? Here's what I have now. I haven't modified it for stuff I learned about when I found this place yesterday, like paint events. Public Sub DrawGalaxy() Dim i, j As Integer Dim pF As PointF Dim rF As RectangleF Dim Draw As System.Drawing.Graphics Dim SystemFill As New System.Drawing.SolidBrush(System.Drawing.Color.Black) Dim SystemOutline As New System.Drawing.Pen(System.Drawing.Color.White, 1) pnlMap.Refresh() Draw = pnlMap.CreateGraphics() If Prefs.HighQuality = True Then Draw.SmoothingMode = Drawing2D.SmoothingMode.HighQuality Else Draw.SmoothingMode = Drawing2D.SmoothingMode.HighSpeed End If 'draw nebulae above or below grid? 'draw grid here 'draw hyperlinks If Prefs.Hyperlinks.Draw = True Then Dim Hyper As New System.Drawing.Pen(Prefs.Hyperlinks.drawColor, 1) Dim SelColor As System.Drawing.Color = Color.FromArgb(128, Prefs.SelectedLinks.drawColor) Dim Sel As New System.Drawing.Pen(SelColor, 5) For i = 0 To Systems.Length - 1 If Systems(i).bDraw = True Then For j = 0 To 15 If Systems(i).Hyperlink(j) <> -1 Then If Systems(Systems(i).Hyperlink(j) - 128).bDraw = True Then Dim Start, Dest As PointF Start = Transform_Point(Systems(i).Position, pnlMap) Dest = Transform_Point(Systems(Systems(i).Hyperlink(j) - 128).Position, pnlMap) Draw.DrawLine(Hyper, Start, Dest) If lstSystems.SelectedIndex <> -1 Then If Get_Index(lstSystems.SelectedItem) = i Then Draw.DrawLine(Sel, Start, Dest) End If End If End If End If Next End If Next End If 'Draw Wormholes 'Draw Hypergates 'Draw Systems For i = 0 To Systems.Length - 1 If Systems(i).bDraw = True Then 'convert absolute position to account for zoom and 'translation and container coordinates (0,0 doesn't want to be the top, left) pF = Transform_Point(Systems(i).Position, pnlMap) pF.X -= Prefs.GetSystSize / 2 pF.Y -= Prefs.GetSystSize / 2 'create rectangle bounds for ellipse rF = New RectangleF(pF, Prefs.SystSize) 'draw Draw.FillEllipse(SystemFill, rF) Draw.DrawEllipse(SystemOutline, rF) End If Next i 'Draw labels If Prefs.SystemLabel.Draw = True Then Dim Text As New System.Drawing.SolidBrush(Prefs.SystemLabel.drawColor) For i = 0 To Systems.Length - 1 If Systems(i).bDraw = True Then pF = Transform_Point(Systems(i).Position, pnlMap) pF.X += Prefs.GetSystSize pF.Y += Prefs.GetSystSize Draw.DrawString("(" & Systems(i).ID & ") " & Systems(i).Name, _ Prefs.MapFont, _ Text, _ pF) End If Next End If End Sub Any help is greatly appreciated.
×
×
  • Create New...