rifter1818
Junior Contributor
I know this has got to be something stupid im doing that im doing, but i dont know what. Im trying to add in Effects (Pixel/Vertex Shaders) and allong the way ive decided to use createflags.PureDevice or createflags.HardwareVertexProcessing.. I know my device supports them as i have a sample program (Came with the book Kick Start -> Managed Directx 9 Graphics and Game Programming) that uses these flags. But as soon as i change my CFlags over to them, my cFont.DrawText Throws the following exception
"NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DirectX.Direct3D.Font.DrawText(Sprite sprite, String text, Rectangle rect, DrawTextFormat format, Int32 color)"
This isnt Much fun and it works just fine in SoftwareVertexProcessing....
oh heres my Font Class in case that helps any.. (omiting the unused parts...)
"NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DirectX.Direct3D.Font.DrawText(Sprite sprite, String text, Rectangle rect, DrawTextFormat format, Int32 color)"
This isnt Much fun and it works just fine in SoftwareVertexProcessing....
oh heres my Font Class in case that helps any.. (omiting the unused parts...)
Visual Basic:
imports d = system.drawing
Public Class cFont
Inherits Microsoft.DirectX.Direct3D.Font
Public Color As D.Color
Private pFontDesc As FontDescription
Public Sub New(ByRef Device As Device, ByVal Font As D.Font)
MyBase.New(Device, Font)
End Sub
Public Overloads Sub DrawText(ByVal Text As String, ByVal Rect As D.Rectangle, ByVal Format As DrawTextFormat, ByVal FColor As D.Color)
MyBase.DrawText(Nothing, Text, Rect, Format, FColor)
End Sub
End Class
Last edited: