DX9 lockup/oddness - please test

Archives Forums/BlitzMax Bug Reports/DX9 lockup/oddness - please test

GfK(Posted 2009) [#1]
Please run the code below (win32 only).

1. Click on the 'maximise' icon and it will go fullscreen.

2. Press SPACE to return to windowed mode.

3. All OK so far. Now double-click the title bar to get it to go fullscreen.

4. Now press SPACE to return to windowed mode.

This is where its going wrong. At first, it seems to work fine but if you repeat the process (steps 3-4 above) a couple of times, I have one of two things happening.

a. Completely frozen screen.
b. Window restored but its moved half way off the top left of the screen.

Also check this with GLMax2DDriver() - everything works perfectly with that.

Spec: Athlon64 X2 5000+, 2GB RAM, 512MB 8500GT, Windows 7.

Strict
'SetGraphicsDriver GLMax2DDriver()
?Win32
Extern "win32"
	Function GetActiveWindow%()
	Function isZoomed%(hWnd%) = "IsZoomed@4"
End Extern
?

Global Windowed:Byte = True
RefreshGraphicsMode()

While Not KeyDown(key_escape)
	If iszoomed(getactivewindow())
		windowed = False
		refreshGraphicsMode()
	EndIf
	If KeyHit(key_space) And windowed = False
		windowed = True
		refreshgraphicsmode()
	EndIf
	Cls
	DrawText MilliSecs(),50,50
	Flip
Wend

Function ccEnableMinimize(hwnd:Long)
	' Adds the Minimize Button "_"
	?Win32
	Local tmp:Long = GetWindowLongA( hwnd, GWL_STYLE )
	tmp = tmp | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
	SetWindowLongA( hwnd, GWL_STYLE, tmp )
	DrawMenuBar( hwnd )
	?
End Function

Function refreshGraphicsMode()
	If windowed
		Graphics 800,600,0
		ccEnableMinimize(getActiveWindow())
	Else
		Graphics 800,600,32
	EndIf
End Function



therevills(Posted 2009) [#2]
Hey Gfk,

Just tried using BMax 1.36 and the default graphics driver (DX9), and it seems to work fine here.

Have you got Skid's Memory Leak fix in your version of BMax (I havent) or have you got any other little tweaks?


GfK(Posted 2009) [#3]
Have you got Skid's Memory Leak fix in your version of BMax (I havent) or have you got any other little tweaks?
Yeah that's a point - I have skid's mem leak fix, and brucey's jpeg loader fix. I don't think either would affect this but still...

I wonder if it might be related to this: http://www.blitzbasic.com/Community/posts.php?topic=87825


GfK(Posted 2010) [#4]
Have you got Skid's Memory Leak fix in your version of BMax (I havent) or have you got any other little tweaks?
Confirmed. Its the mem leak fix.

With a fresh install of Blitzmax 1.36, I can't reproduce this bug. With skid's memory leak fix implemented, it crashes. I'll cross ref the issue from that thread, I think...


GfK(Posted 2010) [#5]
Unable to reproduce this bug in 1.37 :)