Graphics issues
BlitzMax Forums/BlitzMax Programming/Graphics issues
| ||
| Okay, so I got this awesome new computer for christmas and I booted it up and installed BlitzMax and tried to run a simple program and it gave me the error "Unhandled Exception: Attempt to access field or method of Null object" on a Cls call. What in the world caused this? |
| ||
| did you set the graphics mode? can you post the code? |
| ||
Graphics 800, 600
While Not KeyHit(KEY_ESCAPE)
Cls
DrawText "Hello World", 60, 60
Flip
Wend
End
|
| ||
| Try... SetGraphicsDriver GLMax2DDriver() for shits and giggles. |
| ||
| I think you need to rebuild modules but for that you need to install MinGW. |
| ||
| ya thats your best first step |
| ||
| Could also be that your computer doesn't support 800x600 full screen mode -- on some of the newer widescreen monitors the smallest that's supported is 1024x768. Run this, and see if it's even a valid option: Print "Available graphics modes:" For Mode:TGraphicsMode=EachIn GraphicsModes() Print Mode.width+","+Mode.height+","+Mode.depth+","+Mode.hertz Next |
| ||
| 800x600 will be valid no matter what because he's attempting to open within a window... not fullscreen. |
| ||
| Maybe this new computer has vista or win7 and does not come with DX9 (DX10 instead). try adding SetGraphicsDriver OpenGL this way:
'We see what's the default graphics driver in your computer, if any:
If GetGraphicsDriver() <> Null Then
Print "Previous graphics driver:" + GetGraphicsDriver().ToString()
else
Print "No graphic driver was available as 'default'."
endif
SetGraphicsDriver GLMax2DDriver()
Print "Current graphics driver: " + GetGraphicsDriver().ToString()
Graphics 800, 600
While Not KeyHit(KEY_ESCAPE)
Cls
DrawText "Hello World", 60, 60
Flip
Wend
EndAnd see if it does make any difference, and what output do you get. |
| ||
| Well I decided to rebuild the modules and that seemed to fix the problem. If it helps, I'm on an Acer Aspire One running Win7 Starter. I tried OpenGL and the Max2D driver and they didn't work either until I rebuilt the modules. I'm still confused on what was causing this problem. |
| ||
| it is possible that the modules are not ready built when BlitzMax is Installed. However, I am unable to confirm sense I have a habit of rebuilding modules right after installing BM. |