1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-09-15 13:36:16 +00:00

Breakout: use pledge and unveil

This commit is contained in:
Brendan Coles 2020-12-15 11:16:33 +00:00 committed by Andreas Kling
parent e3114667bc
commit d8c533f588

View file

@ -35,7 +35,28 @@
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
if (pledge("stdio rpath wpath cpath shared_buffer accept unix fattr", nullptr) < 0) {
perror("pledge");
return 1;
}
auto app = GUI::Application::construct(argc, argv); auto app = GUI::Application::construct(argc, argv);
if (pledge("stdio rpath shared_buffer", nullptr) < 0) {
perror("pledge");
return 1;
}
if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;
}
if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
return 1;
}
auto window = GUI::Window::construct(); auto window = GUI::Window::construct();
window->resize(Breakout::Game::game_width, Breakout::Game::game_height); window->resize(Breakout::Game::game_width, Breakout::Game::game_height);
auto app_icon = GUI::Icon::default_icon("app-breakout"); auto app_icon = GUI::Icon::default_icon("app-breakout");