Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to remove cursor from sdl window #75

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 5 additions & 0 deletions src/RenderLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ void RenderLoop::PollEvents()
break;
}
}

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

}

void RenderLoop::CheckViewportSize()
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
Loading