We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 635

Summary: D3D-Error DRIVERINTERNALERROR when minimizing SDL_Window
Product: SDL Reporter: Alexander Hirsch <1zeeky>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2 CC: 1zeeky
Version: HG 2.0   
Hardware: x86   
OS: Windows (XP)   

Description Alexander Hirsch 2008-10-08 09:10:34 UTC
I created a window like this:
SDL_CreateWindow("Title", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, SDL_WINDOW_SHOWN)
and a renderer like this:
SDL_CreateRenderer(mainWnd, -1, SDL_RENDERER_PRESENTFLIP2|SDL_RENDERER_PRESENTVSYNC|SDL_RENDERER_ACCELERATED)
and I can draw on it:
SDL_SelectRenderer(mainWnd)
SDL_RenderFill(0x22, 0x22, 0xFF, SDL_ALPHA_OPAQUE, NULL)
none of these functions return -1.

When I minimize the window I get the SDL-Error "Reset(): DRIVERINTERNALERROR" and when I open it again, I get the SDL-Error "Clear(): INVALIDCALL" when executing SDL_RenderFill (and it returns -1). The window also seems quite small now... (resizing before rendering does now help though)

I have a GeForce 9600 GT and as far as I know it works fine. I have updated drivers (v178.13) and DirectX (9.0c August 2008) and use an up-to-date version of the SDL-trunk (subversion 4104).
A friend of mine gets the same error (he has a 6800 GTS).
Comment 1 Alexander Hirsch 2009-05-18 12:28:14 UTC
I lost my interest after a while, but I've come back to see if this bug was resolved. And as it isn't I thought I might as well tackle it again and was able to pinpoint the root of this bug:

When you minimize a window the event SDL_WINDOWEVENT_RESIZED gets pushed and handled to call SDL_OnWindowResized, which of course calls D3D_DisplayModeChanged if the renderer is DirectX and there D3D_Reset gets called, which sets the error. My guess is, that you can't reset the D3DDevice if width and/or height are 0.
The probably invalid D3DDevice then causes more errors to come up.
Comment 2 Sam Lantinga 2009-10-10 12:38:19 UTC
Thanks for the info, I'll take a look!
Comment 3 Nathaniel J Fries 2011-01-09 07:06:47 UTC
Does this bug still exist? I am not getting it on Windows 7.
Comment 4 Sam Lantinga 2011-03-11 18:28:42 UTC
I believe this is fixed in the latest snapshot:
http://www.libsdl.org/tmp/SDL-1.3.zip

Can you reopen this bug if you're still seeing it?

Thanks!