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 4219

Summary: [PATCH] Fix for SDL_CreateWindowFrom that doesn't initialize OpenGL properly on Windows
Product: SDL Reporter: Michael Larouche <mlarouche>
Component: videoAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.8   
Hardware: All   
OS: Windows (All)   
Attachments: Patch for SDL 2.0.8 that fix OpenGL with SDL_CreateWindowFrom

Description Michael Larouche 2018-07-18 20:11:01 UTC
Created attachment 3272 [details]
Patch for SDL 2.0.8 that fix OpenGL with SDL_CreateWindowFrom

We use SDL_CreateWindowFrom in our in-house game editor to embed our C++ game engine using a child HWD created by our C# WPF editor. We use OpenGL for rendering and when I developed the embedding, I noticed that OpenGL wasn't initialized properly when using SDL_CreateWindowFrom, the OpenGL extensions weren't there and the effective OpenGL version was 1.1, not 4.x that my video card can support.

This patch included in this bug report fix the issue. Since there's no way to specify the SDL_Window flags when using SDL_CreateWindowFrom, I had to hardcode SDL_WINDOW_OPENGL.

Let me know if you want the patch to be based on the upstream Mercurial repository.