GraphicsDepth always returns 0!

BlitzMax Forums/BlitzMax Programming/GraphicsDepth always returns 0!

Grey Alien(Posted 2006) [#1]
OK, before I add this to the bugs section I thought I'd open it for discussion.

On my PC, this code always prints 0 as the GraphicsDepth, even if I change the bit depth to 16 bit. Why?

Graphics 800,600,32
Cls
DrawText GraphicsDepth(),100,100
Flip
WaitKey



AntonyWells(Posted 2006) [#2]
It doesn't like you. I would have thought that was obvious. :)


Grey Alien(Posted 2006) [#3]
sniff :-(


Gabriel(Posted 2006) [#4]
It does the same here.


Grey Alien(Posted 2006) [#5]
well at least it's not just me!


Haramanai(Posted 2006) [#6]
Same here.


Grey Alien(Posted 2006) [#7]
looks like this better go in the bug forum then.

Can a moderator please move this thread or shall I post again manually?


Haramanai(Posted 2006) [#8]
Check this out.
SetGraphicsDriver D3D7Max2DDriver()
Graphics 640 , 480 , 32 , 60

Print "DX : " + GraphicsDepth()

EndGraphics()



SetGraphicsDriver GLMax2DDriver()
Graphics 640 , 480 , 32 , 60

Print "OpenGL : " + GraphicsDepth()

EndGraphics()
End



tonyg(Posted 2006) [#9]
Works for GL not for DX although primarydevice.depth returns the correct value.
DX Getsettings method...
	Method GetSettings( width Var,height Var,depth Var,hertz Var,flags Var )
		If hwnd
			Local dest[4]
			GetClientRect hwnd,dest
			width=dest[2]
			height=dest[3]
		Else
			width=PrimaryDevice.width
			height=PrimaryDevice.height
		EndIf
		depth=0
		hertz=0
		flags=0
	End Method

depth=0 should really be depth=primarydevice.depth.


Grey Alien(Posted 2006) [#10]
aha, so they could support it if need be, interesting. Thanks a lot.


xlsior(Posted 2006) [#11]
And the snippet above also explains why the refreshrate can't be read under DX either, it's explicitely set to 0 as well.

Any fix for that?


Dreamora(Posted 2006) [#12]
manual replacement for the moment and mention both fixes in the tweak board with "fix to bug on XXXX" or mail it to brl directly.


tonyg(Posted 2006) [#13]
drawtext primarydevice.freq for hertz.


Grey Alien(Posted 2006) [#14]
so manually fix the mod and recompile. Should I post this in the bug board then?


xlsior(Posted 2006) [#15]
Probably, or you'll keep making the same change & recompile after every 'official' update involving the mod that will undo your custom change. :-?

I reported the broken Herz under DirectX in the bug forum forever ago, a couple of days after DX support was first added. (It broke some of my timing code) Someone else also pointed out it was explicitely set to zero... No idea at the time what it should have been though, and never seen any response or action from BRL on that so far, though.