chore: initialise variables

This commit is contained in:
Almamu 2025-04-02 00:01:04 +02:00
parent 89e4431345
commit aa9649f601
16 changed files with 29 additions and 22 deletions

View File

@ -8,6 +8,8 @@ using namespace WallpaperEngine::Input::Drivers;
CGLFWMouseInput::CGLFWMouseInput (Render::Drivers::CGLFWOpenGLDriver* driver) :
m_reportedPosition (),
m_mousePosition (),
m_leftClick (MouseClickStatus::Released),
m_rightClick (MouseClickStatus::Released),
m_driver (driver) {}
void CGLFWMouseInput::update () {

View File

@ -4,8 +4,6 @@ using namespace WallpaperEngine::Render::Drivers;
CVideoDriver::CVideoDriver (CWallpaperApplication& app) : m_app (app) {}
CVideoDriver::~CVideoDriver () {}
CWallpaperApplication& CVideoDriver::getApp () const {
return this->m_app;
}

View File

@ -17,7 +17,7 @@ class CFullScreenDetector;
class CVideoDriver {
public:
explicit CVideoDriver (CWallpaperApplication& app);
virtual ~CVideoDriver ();
virtual ~CVideoDriver () = default;
/**
* @return The current output in use

View File

@ -31,6 +31,8 @@ int CustomXIOErrorHandler (Display* dsp) {
CX11FullScreenDetector::CX11FullScreenDetector (Application::CApplicationContext& appContext,
CGLFWOpenGLDriver& driver) :
CFullScreenDetector (appContext),
m_display (nullptr),
m_root (0),
m_driver (driver) {
// do not use previous handler, it might stop the app under weird circumstances
// these handlers might be replaced by other X11-specific functionality, they
@ -67,7 +69,7 @@ bool CX11FullScreenDetector::anythingFullscreen () const {
Window root, *schildren = nullptr;
unsigned int num_children;
if (!XQueryTree (m_display, ourWindow, &root, &parentWindow, &schildren, &num_children))
if (!XQueryTree (this->m_display, ourWindow, &root, &parentWindow, &schildren, &num_children))
return false;
if (schildren)

View File

@ -8,5 +8,3 @@ COutputViewport::COutputViewport (glm::ivec4 viewport, std::string name, bool si
viewport (viewport),
name (std::move (name)),
single (single) {}
COutputViewport::~COutputViewport () {}

View File

@ -7,7 +7,7 @@ namespace WallpaperEngine::Render::Drivers::Output {
class COutputViewport {
public:
COutputViewport (glm::ivec4 viewport, std::string name, bool single = false);
virtual ~COutputViewport ();
virtual ~COutputViewport () = default;
glm::ivec4 viewport;
std::string name;

View File

@ -10,8 +10,6 @@ CWaylandOutput::CWaylandOutput (CApplicationContext& context, CWaylandOpenGLDriv
updateViewports ();
}
CWaylandOutput::~CWaylandOutput () {}
void CWaylandOutput::updateViewports () {
m_viewports.clear ();
const auto PDRIVER = dynamic_cast<CWaylandOpenGLDriver*> (&m_driver);

View File

@ -16,7 +16,7 @@ namespace Output {
class CWaylandOutput final : public COutput {
public:
CWaylandOutput (CApplicationContext& context, CWaylandOpenGLDriver& driver);
~CWaylandOutput () override;
~CWaylandOutput () override = default;
void reset () override;

View File

@ -106,12 +106,11 @@ constexpr struct zwlr_layer_surface_v1_listener layerSurfaceListener = {
CWaylandOutputViewport::CWaylandOutputViewport (CWaylandOpenGLDriver* driver, uint32_t waylandName,
struct wl_registry* registry) :
m_driver (driver),
size ({0, 0}),
waylandName (waylandName),
COutputViewport ({0, 0, 0, 0}, "", true) {
// setup output listener
this->output = static_cast<wl_output*> (wl_registry_bind (registry, waylandName, &wl_output_interface, 4));
this->name = "";
this->size = {0, 0};
wl_output_add_listener (output, &outputListener, this);
}

View File

@ -30,7 +30,14 @@ int CustomXIOErrorHandler (Display* dsp) {
return 0;
}
CX11Output::CX11Output (CApplicationContext& context, CVideoDriver& driver) : COutput (context, driver) {
CX11Output::CX11Output (CApplicationContext& context, CVideoDriver& driver) : COutput (context, driver),
m_display (nullptr),
m_pixmap (None),
m_root (None),
m_gc (None),
m_imageData (nullptr),
m_imageSize (0),
m_image (nullptr) {
// do not use previous handler, it might stop the app under weird circumstances
XSetErrorHandler (CustomXErrorHandler);
XSetIOErrorHandler (CustomXIOErrorHandler);
@ -88,9 +95,6 @@ uint32_t CX11Output::getImageBufferSize () const {
}
void CX11Output::loadScreenInfo () {
// reset the viewports
this->m_viewports.clear ();
this->m_display = XOpenDisplay (nullptr);
// set the error handling to try and recover from X disconnections
#ifdef HAVE_XSETIOERROREXITHANDLER

View File

@ -23,6 +23,8 @@ CImage::CImage (CScene* scene, Core::Objects::CImage* image) :
m_modelViewProjectionCopyInverse (),
m_modelViewProjectionPass (glm::mat4 (1.0)),
m_modelViewProjectionPassInverse (glm::inverse (m_modelViewProjectionPass)),
m_modelMatrix(),
m_viewProjectionMatrix(),
m_pos () {
auto projection = this->getScene ()->getScene ()->getOrthogonalProjection ();

View File

@ -9,11 +9,11 @@ CShaderVariableInteger::CShaderVariableInteger (int32_t defaultValue) :
m_value (0),
CShaderVariable (&this->m_defaultValue, nullptr, Type) {}
CShaderVariableInteger::CShaderVariableInteger (int32_t defaultValue, std::string name) :
CShaderVariableInteger::CShaderVariableInteger (int32_t defaultValue, const std::string& name) :
m_defaultValue (defaultValue),
m_value (0),
CShaderVariable (&this->m_defaultValue, nullptr, Type) {
this->setName (std::move (name));
this->setName (name);
}
void CShaderVariableInteger::setValue (int32_t value) {

View File

@ -6,7 +6,7 @@ namespace WallpaperEngine::Render::Shaders::Variables {
class CShaderVariableInteger final : public CShaderVariable {
public:
explicit CShaderVariableInteger (int32_t defaultValue);
CShaderVariableInteger (int32_t defaultValue, std::string name);
CShaderVariableInteger (int32_t defaultValue, const std::string& name);
const int getSize () const override;

View File

@ -9,11 +9,11 @@ CShaderVariableVector2::CShaderVariableVector2 (const glm::vec2& defaultValue) :
m_value (glm::vec2 ()),
CShaderVariable (&this->m_defaultValue, nullptr, Type) {}
CShaderVariableVector2::CShaderVariableVector2 (const glm::vec2& defaultValue, std::string name) :
CShaderVariableVector2::CShaderVariableVector2 (const glm::vec2& defaultValue, const std::string& name) :
m_defaultValue (defaultValue),
m_value (glm::vec2 ()),
CShaderVariable (&this->m_defaultValue, nullptr, Type) {
this->setName (std::move (name));
this->setName (name);
}
void CShaderVariableVector2::setValue (const glm::vec2& value) {

View File

@ -7,7 +7,7 @@ namespace WallpaperEngine::Render::Shaders::Variables {
class CShaderVariableVector2 final : public CShaderVariable {
public:
explicit CShaderVariableVector2 (const glm::vec2& defaultValue);
CShaderVariableVector2 (const glm::vec2& defaultValue, std::string name);
CShaderVariableVector2 (const glm::vec2& defaultValue, const std::string& name);
const int getSize () const override;

View File

@ -13,6 +13,10 @@ CWeb::CWeb (Core::CWeb* web, CRenderContext& context, CAudioContext& audioContex
m_height (16),
m_browserContext (browserContext),
m_browser (),
m_leftClick (WallpaperEngine::Input::MouseClickStatus::Released),
m_rightClick (WallpaperEngine::Input::MouseClickStatus::Released),
m_mousePosition(),
m_mousePositionLast(),
m_client () {
this->m_browserContext.markAsUsed ();
// setup framebuffers