Black Screen of Death & OpenGL Question

BlitzMax Forums/BlitzMax Beginners Area/Black Screen of Death & OpenGL Question

GrayKnight2k(Posted 2007) [#1]
So I'm wanting to get more into BlitzMax...

(1)
The problem I'm having is when I compile some of the code samples the screen goes black and bits and pieces of it slowly refresh (black chunks remain and I have to open folders, click on the start menu, etc. to regain my view). The program doesn't display properly, either. Any ideas why? I have the latest drivers.

(2)
How difficult is it to break into the cool alpha-blending / particle effects with the OpenGL?


Thank you.


H&K(Posted 2007) [#2]
1) Some of the old code samples (from the achives and NeHe), were from older Bmax version, though SKid did a purge and tried to fix them all. He may have missed some.
So best bet is to post the smallest that does it.

2) Do the OpenGl NeHe tutorial


GrayKnight2k(Posted 2007) [#3]
' cls.bmx

' a spinning text message
' remove the call to cls to illustrate the
' need for clearing the screen every frame

Graphics 640,480
SetOrigin 320,240
While Not KeyHit(KEY_ESCAPE)
	Cls 
	SetRotation frame
	DrawText "Press Escape To Exit",0,0
	Flip
	frame:+1
Wend


Unfortunately I have this screen problem with the majority of programs I have tested. Maybe it's something wrong with my video drivers or refresh rate.

Thanks.

Edit: Or could it be the demo version?

Edit2: I'm even getting it with this kickass tutorial. :(


H&K(Posted 2007) [#4]
Hummm, No thats not a version problem.
(They might run differently, due to the inclustion of the Fullscreen flag in the current Bmax)

All I can suddjest is looking at the "SetGraphicsDriver" command and try the different drivers. However if you are getting this error with the CLS example, then I would say you probably dont have 3d accelerated graphics, and although you will be able to get the examples to run with one of the drivers, any graphics operations would be very very slow.
Please post Graphics chip/CArd specs


GrayKnight2k(Posted 2007) [#5]
I am running on a laptop with a GeForce Go 7400. It definitely has 3d acceleration. New development, though: it works in full screen just fine. My problem occurs when the app executes in windowed mode...Any thoughts?


H&K(Posted 2007) [#6]
Is it Vista?

Anyway try SetGraphicsDriver for the available drivers, and see if its just the default one thats the problem


GrayKnight2k(Posted 2007) [#7]
I'm running XP...Ok, really weird...It worked when I set this:

SetGraphicsDriver GLMax2DDriver()

Any idea why the default didn't work? What is the default?

Thanks for your help!


dmaz(Posted 2007) [#8]
well, that points to your DirectX install being borked. do you have any problems with non-blitz games?


MGE(Posted 2007) [#9]
SetGraphicsDriver D3D7Max2DDriver()
If Graphics(width,height,depth) = Null Then
 SetGraphicsDriver GLMax2DDriver()
  If Graphics(width,height,depth) = Null Then
   '
   ' It just isn't going to run, sorry.
   '
  EndIf
EndIf

For what it's worth, I'm a Bmax noob and I'm finding out Bmax isn't compatible all the time with every cpu/gpu combination. You have to preapare for the worse with proper trapping and hope for the best.

Also, use () at the end of every function, it will cause conflicts down the road if you don't....... trust me. ;)

Fwiw, I'm also finding out Flip 1 helps compatibility issues. On one of my test computers I was getting all kinds of weird redraw until I used Flip 1. (Flips at the next vsync.)


Grey Alien(Posted 2007) [#10]
Yeah I do the same in my framework. You just gotta iterate through several possibilities and abort with a nice error when they all fail. Sometimes though BMax thinks something works when it hasn't so it's not that simple. For example I've seen open GL work but everything is white rectangles.


Dreamora(Posted 2007) [#11]
On the question why it might not work:
Are you using modded drivers instead of ones from nvidia itself or from your system manufacturer?
The modding teams normally remove DX7 support in favor of making the DX9 part even faster.


MGE(Posted 2007) [#12]
"For example I've seen open GL work but everything is white rectangles."

I am reading that alot! Seems to be happening more and more lately. :(


Dreamora(Posted 2007) [#13]
is that rendering reappearing?

It was a common problem a year ago with users having no 3D cards (known as Intel Onboard :) ), which had some major errors in the driver and therefor resulted in this behavior. This was no BM specific. As TGB owner and user, I've had to fight the issue there as well ... the March 06 driver from intel solved the issue finally

That combined with people believing that 2D through 3D has no restrictions in texture amounts, which resultet in prototype games which needed 200MB+ VRAM and were targeted at casuals with intel onboards (64MB VRAM at that point, now they at least have 96MB on the 950 series. The X3100 isn't really spread yet)


GrayKnight2k(Posted 2007) [#14]
Dreamora-
I am not sure about my drivers...it's factory installed and there do not appear to be any driver updates for the Go 7400. :-/

I installed the latest version of Direct X..It's puzzling.