Original Post
Im using DX9 and VB.NET
I do the following but it does not seem to pass the surface and rect into the other sub, the string works fine.
If I change the ddsSurface & myRect withing the BMPLoad sub to ddsLogo & rLogo then it works fine.
Anybody have any idea why this wouldnt work?, I used to do this the same way in Visual Basic 6 and it worked fine:
public sub Main()
BmpLoad(ddsLogo, rLogo, "C:\My Projects\Magic Dust - DX9\bin\Data\Logo.bmp")
end sub
Public Sub BmpLoad(ByVal ddsSurface As Surface, ByVal myRect As System.Drawing.Rectangle, ByVal nameFile As String, Optional ByVal TransCol As Integer = 0)
Dim SDes As New SurfaceDescription() '' Describes a surface.
Dim ck As New ColorKey()
ddsSurface = Nothing
Try
''Load sprite
ddsSurface = New Surface(nameFile, SDes, DD)
ddsLogo.SetColorKey(ColorKeyFlags.SourceDraw, ck)
rLogo = New System.Drawing.Rectangle(0, 0, 800, 600) ''SDes.Width, SDes.Height)
Catch
Debug.WriteLine("Error loading:" + nameFile)
End Try
End Sub