mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
feat(window): add video driver selection via config and --video-driver argument
This commit is contained in:
@@ -8,5 +8,6 @@ struct Argument {
|
||||
std::optional<std::string> player;
|
||||
std::optional<bool> no_debug;
|
||||
std::optional<std::string> language;
|
||||
std::optional<std::string> video_driver;
|
||||
};
|
||||
} // namespace Cubed
|
||||
14
include/Cubed/tools/env_tools.hpp
Normal file
14
include/Cubed/tools/env_tools.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
#include <cstdlib> // IWYU pragma: keep
|
||||
namespace Cubed {
|
||||
namespace Tools {
|
||||
|
||||
inline void set_env(const char* name, const char* value) {
|
||||
#ifdef _WIN32
|
||||
_putenv_s(name, value);
|
||||
#else
|
||||
setenv(name, value, 1);
|
||||
#endif
|
||||
}
|
||||
} // namespace Tools
|
||||
} // namespace Cubed
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Cubed/argument.hpp"
|
||||
#include "Cubed/config.hpp"
|
||||
#include "Cubed/input/event.hpp"
|
||||
|
||||
@@ -15,7 +16,7 @@ public:
|
||||
bool is_mouse_enable() const;
|
||||
const SDL_Window* get_window() const;
|
||||
SDL_Window* get_window();
|
||||
void init();
|
||||
void init(const Argument& argument);
|
||||
void imgui_init();
|
||||
|
||||
// end of frame to reload!
|
||||
|
||||
Reference in New Issue
Block a user