Skip to content

Commit

Permalink
Added cursor flag
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisKirschner committed Apr 4, 2024
1 parent e424a2b commit 03e8ad4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/ProjectMSDLApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ void ProjectMSDLApplication::defineOptions(Poco::Util::OptionSet& options)
options.addOption(Option("beatSensitivity", "", "Beat sensitivity. Between 0.0 and 5.0. Default 1.0.",
false, "<number>", true)
.binding("projectM.beatSensitivity", _commandLineOverrides));
options.addOption(Option("showCursor", "", "Shows cursor",
false, "true/false", true)
.binding("window.showCursor", _commandLineOverrides));


}

Expand Down
4 changes: 3 additions & 1 deletion src/RenderLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ void RenderLoop::PollEvents()
}
}

SDL_ShowCursor(SDL_DISABLE);
if (!_sdlRenderingWindow.getConfig()->getBool("showCursor", true)) {
SDL_ShowCursor(SDL_DISABLE);
}

}

Expand Down
5 changes: 5 additions & 0 deletions src/SDLRenderingWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ void SDLRenderingWindow::initialize(Poco::Util::Application& app)
}
}

Poco::AutoPtr<Poco::Util::AbstractConfiguration> SDLRenderingWindow::getConfig() const
{
return _config;
}

void SDLRenderingWindow::uninitialize()
{
if (_renderingWindow)
Expand Down
6 changes: 6 additions & 0 deletions src/SDLRenderingWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ class SDLRenderingWindow : public Poco::Util::Subsystem
*/
void NextDisplay();

/**
* @brief Retrieves the configuration view for the window.
* @return The configuration view for the window.
*/
Poco::AutoPtr<Poco::Util::AbstractConfiguration> getConfig() const;

protected:

/**
Expand Down

0 comments on commit 03e8ad4

Please sign in to comment.