-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set backend at runtime, hide windows on init, missing include (#50)
* set backend at init time * glfw hide windows on init(), no focus on show() * bugfix: missing include * include Windows in CI
- Loading branch information
Showing
17 changed files
with
232 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
#include <random> | ||
#include <sstream> | ||
#include <string> | ||
#include <tuple> | ||
|
||
|
||
#include <glm/glm.hpp> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include "polyscope/render/engine.h" | ||
|
||
namespace polyscope { | ||
namespace render { | ||
|
||
// Storage for the global engine pointer | ||
Engine* engine = nullptr; | ||
|
||
// Forward-declaration of initialize routines | ||
// we don't want to just include the appropriate headers, because they may define conflicting symbols | ||
namespace backend_openGL3_glfw { | ||
void initializeRenderEngine(); | ||
} | ||
namespace backend_openGL_mock { | ||
void initializeRenderEngine(); | ||
} | ||
// void initializeRenderEngine_openGL_mock(); | ||
|
||
void initializeRenderEngine(std::string backend) { | ||
|
||
// Handle default backends | ||
// (the string is getting overwritten, so lower on the list means higher priority) | ||
if (backend == "") { | ||
|
||
#ifdef POLYSCOPE_BACKEND_OPENGL_MOCK_ENABLED | ||
// Don't set it one by default, since it's probably a mistake; better to throw the exception below. | ||
// backend = "mock_openGL"; | ||
#endif | ||
|
||
#ifdef POLYSCOPE_BACKEND_OPENGL3_GLFW_ENABLED | ||
backend = "openGL3_glfw"; | ||
#endif | ||
|
||
if (backend == "") { | ||
throw std::runtime_error("no Polyscope backends available"); | ||
} | ||
} | ||
|
||
// Initialize the appropriate backend | ||
if (backend == "openGL3_glfw") { | ||
backend_openGL3_glfw::initializeRenderEngine(); | ||
} else if (backend == "openGL_mock") { | ||
backend_openGL_mock::initializeRenderEngine(); | ||
} else { | ||
throw std::runtime_error("unrecognized Polyscope backend " + backend); | ||
} | ||
} | ||
|
||
} // namespace render | ||
} // namespace polyscope | ||
|
Oops, something went wrong.