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 - SDL Render functions crash when using window menus
Summary: SDL Render functions crash when using window menus
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: 2.0.4
Hardware: x86_64 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-02 22:49 UTC by Angus Holder
Modified: 2016-05-03 15:20 UTC (History)
0 users

See Also:


Attachments
Complete test case source file, including build instructions. (2.28 KB, text/x-csrc)
2016-05-02 22:49 UTC, Angus Holder
Details

Note You need to log in before you can comment on or make changes to this bug.
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.