25 std::cerr <<
"Falha ao inicializar o GLFW!" << std::endl;
30 GLFWwindow* window = glfwCreateWindow(1280, 720,
"Runic VTT",
nullptr,
nullptr);
33 std::cerr <<
"Falha ao criar a janela GLFW!" << std::endl;
39 glfwMakeContextCurrent(window);
42 if (glewInit() != GLEW_OK)
44 std::cerr <<
"Falha ao inicializar o GLEW!" << std::endl;
48 glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
49 glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
50 glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
51 glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
52 glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE);
77void setWindowIcon(GLFWwindow* window, std::filesystem::path iconFolderPath)
80 auto icon16 = iconFolderPath /
"RunicVTTIcon_16.png";
81 auto icon32 = iconFolderPath /
"RunicVTTIcon_32.png";
82 auto icon64 = iconFolderPath /
"RunicVTTIcon_64.png";
83 auto icon256 = iconFolderPath /
"RunicVTTIcon.png";
86 icons[0] =
loadImage(icon16.string().c_str());
87 icons[1] =
loadImage(icon32.string().c_str());
88 icons[2] =
loadImage(icon64.string().c_str());
89 icons[3] =
loadImage(icon256.string().c_str());
91 glfwSetWindowIcon(window, 4, icons);
94 stbi_image_free(icons[0].pixels);
95 stbi_image_free(icons[1].pixels);
96 stbi_image_free(icons[2].pixels);
97 stbi_image_free(icons[3].pixels);
114 auto runic_firewall_rule_name =
"RunicVTT Inbound TCP (Any)";
115 auto node_firewall_rule_name =
"RunicVTT LocalTunnel(Any TCP)";
134 const std::string rule1 = runic_firewall_rule_name;
135 const std::string exe1 = runic_exe;
136 const std::string rule2 = node_firewall_rule_name;
137 const std::string exe2 = node_exe;
139 std::thread([rule1, exe1, rule2, exe2]() {
155 _putenv_s(
"NODE_PATH", nodeModules.c_str());
156 if (
const char* np = std::getenv(
"NODE_PATH"))
static std::string getSelfPath()
GLFWimage loadImage(const char *iconPath)
GLFWwindow * initializeGLFWContext()
void setWindowIcon(GLFWwindow *window, std::filesystem::path iconFolderPath)