Skip to content

Commit

Permalink
Fix SDL2 windowing
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed Apr 10, 2019
1 parent 57b8330 commit 48b35ac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/polyplex/core/windows/sdlwindow.d
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@ public class SDLGameWindow : Window {
// Focus window
if (AutoFocus) this.Focus();
}
}
}
21 changes: 18 additions & 3 deletions source/polyplex/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void UnInitLibraries() {
InitLibraries loads the Derelict libraries for Vulkan, SDL and OpenGL
*/
public void InitLibraries() {
if (!core_init) {
/*if (!core_init) {
if (std.file.exists("libs/")) {
// Load bundled libraries.
Logger.Info("Binding to runtime libraries...");
Expand Down Expand Up @@ -120,7 +120,22 @@ public void InitLibraries() {
Logger.Debug("SDL (compiled against): {0}.{1}.{2}", to!string(compiled.major), to!string(compiled.minor), to!string(compiled.patch));
Logger.Debug("SDL (linked): {0}.{1}.{2}", to!string(linked.major), to!string(linked.minor), to!string(linked.patch));
core_init = true;
}
}*/
loadOpenGL();
gl_init = true;
//gl_init = true;
}

shared static this() {
bool success = loadOAL();
Logger.Info("Bound OpenAL {0}!", success ? "successfully" : "unsuccessfully");

import bindbc.sdl;
SDLSupport support = loadSDL();
if (support == SDLSupport.noLibrary) Logger.Fatal("SDL2 not found!");
SDL_version linked;
SDL_version compiled;
SDL_GetVersion(&linked);
SDL_VERSION(&compiled);
Logger.Info("SDL (compiled against): {0}.{1}.{2}", to!string(compiled.major), to!string(compiled.minor), to!string(compiled.patch));
Logger.Info("SDL (linked): {0}.{1}.{2}", to!string(linked.major), to!string(linked.minor), to!string(linked.patch));
}

0 comments on commit 48b35ac

Please sign in to comment.