I made a hello world application and it works fine until I make a surface or sprite, I use backgroundSurface = New Surface("Title.png") to make a surface but when I run the application I get a NullReference exception (Object reference not set to an instance of an object.) But I though I was making the object with the New keyword, please help and thanks in advance, ell. |
|||
|
|

Can you post some code?
Can you post some code? Without more information I have no idea what is wrong.
Do you see the color change if you call Display.Clear with different colors after calling BeginFrame?
Thanks, it did stop the error
Thanks, it did stop the error occuring, however even though I am calling the Draw method in between BeginFrame and EndFrame, I only see a black screen. I have a surface created from the file "Actor4.png" which is stored in bin>Debug but I cant get it to work! all help appreciated and thanks in advance again.
Oh, also, have you created a
Oh, also, have you created a DisplayWindow object before creating any Surface objects? That is important.
I had the same problem. Move
I had the same problem. Move the line where you create your surface *after* the call to DisplayWindow.CreateWindowed() and it should work. If I put it before, I had this stacktrace:
Hope it helps.
Can you post a stack trace?
Can you post a stack trace? Also, what OS are you using, and what AgateLib driver are you using? (AgateOTK, AgateDrawing, etc.)