mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2025-10-30 07:01:10 +00:00
write latest file to tmp
This commit is contained in:
parent
54ec01a3a5
commit
ecd8b4c217
1 changed files with 19 additions and 0 deletions
19
src/main.cpp
19
src/main.cpp
|
|
@ -4,7 +4,10 @@
|
||||||
#include "utils/gui.hpp"
|
#include "utils/gui.hpp"
|
||||||
#include "utils/utils.hpp"
|
#include "utils/utils.hpp"
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
#include <fstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
@ -57,6 +60,22 @@ namespace {
|
||||||
if (conf.e_fps_limit > 0)
|
if (conf.e_fps_limit > 0)
|
||||||
setenv("DXVK_FRAME_RATE", std::to_string(conf.e_fps_limit).c_str(), 1); // NOLINT
|
setenv("DXVK_FRAME_RATE", std::to_string(conf.e_fps_limit).c_str(), 1); // NOLINT
|
||||||
|
|
||||||
|
// write latest file
|
||||||
|
try {
|
||||||
|
std::ofstream latest("/tmp/lsfg-vk_last", std::ios::trunc);
|
||||||
|
if (!latest.is_open())
|
||||||
|
throw std::runtime_error("Failed to open /tmp/lsfg-vk_last for writing");
|
||||||
|
latest << "exe: " << name.first << '\n';
|
||||||
|
latest << "comm: " << name.second << '\n';
|
||||||
|
latest << "pid: " << getpid() << '\n';
|
||||||
|
if (!latest.good())
|
||||||
|
throw std::runtime_error("Failed to write to /tmp/lsfg-vk_last");
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
std::cerr << "lsfg-vk: An error occurred while trying to write the latest file, exiting:\n";
|
||||||
|
std::cerr << "- " << e.what() << '\n';
|
||||||
|
Utils::showErrorGui(e.what());
|
||||||
|
}
|
||||||
|
|
||||||
// load shaders
|
// load shaders
|
||||||
try {
|
try {
|
||||||
Extract::extractShaders();
|
Extract::extractShaders();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue