mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 05:46:48 +08:00
~ Fix background setup not working properly after the implementation of mouse support
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
parent
b55f2e8bf4
commit
18ab051d47
10
main.cpp
10
main.cpp
@ -179,6 +179,8 @@ int main (int argc, char* argv[])
|
||||
// parse the project.json file
|
||||
auto project = WallpaperEngine::Core::CProject::fromFile ("project.json", containers);
|
||||
WallpaperEngine::Render::CWallpaper* wallpaper;
|
||||
// initialize custom context class
|
||||
WallpaperEngine::Render::CContext* context = new WallpaperEngine::Render::CContext (screens);
|
||||
|
||||
// auto projection = project->getWallpaper ()->as <WallpaperEngine::Core::CScene> ()->getOrthogonalProjection ();
|
||||
// create the window!
|
||||
@ -193,12 +195,12 @@ int main (int argc, char* argv[])
|
||||
return 2;
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent (window);
|
||||
|
||||
// initialize inputs
|
||||
CMouseInput* mouseInput = new CMouseInput (window);
|
||||
// initialize custom context class
|
||||
WallpaperEngine::Render::CContext* context = new WallpaperEngine::Render::CContext (screens, mouseInput);
|
||||
|
||||
context->setMouse (mouseInput);
|
||||
|
||||
glfwMakeContextCurrent (window);
|
||||
|
||||
// TODO: FIGURE THESE OUT BASED ON THE SCREEN
|
||||
int windowWidth = 1920;
|
||||
|
@ -10,12 +10,11 @@
|
||||
|
||||
using namespace WallpaperEngine::Render;
|
||||
|
||||
CContext::CContext (std::vector <std::string> screens, CMouseInput* mouse) :
|
||||
CContext::CContext (std::vector <std::string> screens) :
|
||||
m_wallpaper (nullptr),
|
||||
m_screens (std::move (screens)),
|
||||
m_isRootWindow (m_screens.empty () == false),
|
||||
m_defaultViewport ({0, 0, 1920, 1080}),
|
||||
m_mouse (mouse)
|
||||
m_defaultViewport ({0, 0, 1920, 1080})
|
||||
{
|
||||
this->initializeViewports ();
|
||||
}
|
||||
@ -117,4 +116,9 @@ void CContext::setDefaultViewport (glm::vec4 defaultViewport)
|
||||
CMouseInput* CContext::getMouse () const
|
||||
{
|
||||
return this->m_mouse;
|
||||
}
|
||||
|
||||
void CContext::setMouse (CMouseInput* mouse)
|
||||
{
|
||||
this->m_mouse = mouse;
|
||||
}
|
@ -15,13 +15,14 @@ namespace WallpaperEngine::Render
|
||||
class CContext
|
||||
{
|
||||
public:
|
||||
CContext (std::vector <std::string> screens, CMouseInput* mouse);
|
||||
CContext (std::vector <std::string> screens);
|
||||
|
||||
void initializeViewports ();
|
||||
void render ();
|
||||
void setWallpaper (CWallpaper* wallpaper);
|
||||
void setDefaultViewport (glm::vec4 defaultViewport);
|
||||
CMouseInput* getMouse () const;
|
||||
void setMouse (CMouseInput* mouse);
|
||||
private:
|
||||
std::vector <std::string> m_screens;
|
||||
std::vector <glm::vec4> m_viewports;
|
||||
|
Loading…
Reference in New Issue
Block a user