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 3316

Summary: SDL Render functions crash when using window menus
Product: SDL Reporter: Angus Holder <aholder97+bugzilla>
Component: renderAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.4   
Hardware: x86_64   
OS: Windows 7   
Attachments: Complete test case source file, including build instructions.

Description Angus Holder 2016-05-02 22:49:56 UTC
Created attachment 2437 [details]
Complete test case source file, including build instructions.

I have been using the Windows API to add a window menu to the top bar, but when I try using the SDL Render API instead of raw OpenGL, I get a null pointer dereference crash at the first render function that's reached (both SDL_RenderClear and SDL_SetRenderDrawColor will crash). The only Windows specific event I capture is WM_CREATE, where I append a menu to the Window. I'm compiling with the compiler of Visual Studio 2015. Attached is a minimal repro of my issue. The crash doesn't happen if I don't attach a menu to my window, or, strangely, if I don't create a texture.
Comment 1 Angus Holder 2016-05-03 15:20:03 UTC
I have found that the issue is specific to the Direct3D renderer, so am currently working around it with
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl");
I'm using an Intel HD4400 GPU, with driver version 10.18.10.3345, forgot to add that in the original post.