mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 13:56:48 +08:00
Make class prop customizable
This commit is contained in:
parent
5e384d968d
commit
6460a4fbd5
@ -24,6 +24,7 @@ struct option long_options [] = {
|
||||
{"screenshot", required_argument, nullptr, 'c'},
|
||||
{"list-properties", no_argument, nullptr, 'l'},
|
||||
{"set-property", required_argument, nullptr, 'o'},
|
||||
{"class", required_argument, nullptr, 'x'},
|
||||
{nullptr, 0, nullptr, 0}
|
||||
};
|
||||
|
||||
@ -48,7 +49,8 @@ CApplicationContext::CApplicationContext (int argc, char* argv[]) :
|
||||
maximumFPS (30),
|
||||
audioVolume (128),
|
||||
audioEnabled (true),
|
||||
onlyListProperties (false)
|
||||
onlyListProperties (false),
|
||||
window_class (""),
|
||||
{
|
||||
int c;
|
||||
|
||||
@ -110,6 +112,10 @@ CApplicationContext::CApplicationContext (int argc, char* argv[]) :
|
||||
this->takeScreenshot = true;
|
||||
this->screenshot = stringPathFixes (optarg);
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
this->window_class = optarg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,4 +202,5 @@ void CApplicationContext::printHelp (const char* route)
|
||||
sLog.out ("\t--screenshot\t\t\t\tTakes a screenshot of the background");
|
||||
sLog.out ("\t--list-properties\t\t\tList all the available properties and their possible values");
|
||||
sLog.out ("\t--set-property <name=value>\tOverrides the default value of the given property");
|
||||
sLog.out ("\t--class <class name>\t\t\tSets X11 window class");
|
||||
}
|
@ -24,6 +24,7 @@ namespace WallpaperEngine::Application
|
||||
bool audioEnabled;
|
||||
bool onlyListProperties;
|
||||
FREE_IMAGE_FORMAT screenshotFormat;
|
||||
std::string window_class;
|
||||
|
||||
private:
|
||||
void validatePath ();
|
||||
|
@ -222,7 +222,7 @@ void CWallpaperApplication::show ()
|
||||
// initialize audio context
|
||||
WallpaperEngine::Audio::CAudioContext audioContext (audioDriver);
|
||||
// initialize OpenGL driver
|
||||
WallpaperEngine::Render::Drivers::COpenGLDriver videoDriver (this->m_project->getTitle ().c_str ());
|
||||
WallpaperEngine::Render::Drivers::COpenGLDriver videoDriver (this->m_project->getTitle ().c_str (), this->m_context);
|
||||
// initialize the input subsystem
|
||||
WallpaperEngine::Input::CInputContext inputContext (videoDriver);
|
||||
// initialize render context
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
using namespace WallpaperEngine::Render::Drivers;
|
||||
|
||||
COpenGLDriver::COpenGLDriver (const char* windowTitle) :
|
||||
COpenGLDriver::COpenGLDriver (const char* windowTitle, CApplicationContext& m_context) :
|
||||
m_frameCounter (0)
|
||||
{
|
||||
// initialize glfw
|
||||
@ -22,6 +22,9 @@ COpenGLDriver::COpenGLDriver (const char* windowTitle) :
|
||||
glfwWindowHint (GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
|
||||
#endif /* DEBUG */
|
||||
|
||||
if (!m_context.window_class.empty())
|
||||
windowTitle = m_context.window_class.c_str();
|
||||
|
||||
// create window, size doesn't matter as long as we don't show it
|
||||
this->m_window = glfwCreateWindow (640, 480, windowTitle, nullptr, nullptr);
|
||||
|
||||
|
@ -3,13 +3,20 @@
|
||||
#include <GL/glew.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#include "WallpaperEngine/Render/Drivers/CVideoDriver.h"
|
||||
#include "WallpaperEngine/Application/CApplicationContext.h"
|
||||
|
||||
using namespace WallpaperEngine::Application;
|
||||
namespace WallpaperEngine::Application
|
||||
{
|
||||
class CWallpaperApplication;
|
||||
}
|
||||
|
||||
namespace WallpaperEngine::Render::Drivers
|
||||
{
|
||||
class COpenGLDriver : public CVideoDriver
|
||||
{
|
||||
public:
|
||||
explicit COpenGLDriver (const char* windowTitle);
|
||||
explicit COpenGLDriver (const char* windowTitle, CApplicationContext& m_context);
|
||||
~COpenGLDriver();
|
||||
|
||||
float getRenderTime () override;
|
||||
|
Loading…
Reference in New Issue
Block a user