Skip to content
Snippets Groups Projects
Commit 68be07a2 authored by Philip Trettner's avatar Philip Trettner
Browse files

Improved GlfwApp interface

parent 411edfcd
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,16 @@ std::string GlfwApp::getClipboardString() const ...@@ -53,6 +53,16 @@ std::string GlfwApp::getClipboardString() const
return s ? s : ""; return s ? s : "";
} }
bool GlfwApp::isMouseButtonPressed(int button) const
{
return glfwGetMouseButton(mWindow, button) == GLFW_PRESS;
}
bool GlfwApp::isKeyPressed(int key) const
{
return glfwGetKey(mWindow, key) == GLFW_PRESS;
}
void GlfwApp::init() void GlfwApp::init()
{ {
if (mUseDefaultRendering) if (mUseDefaultRendering)
......
...@@ -175,6 +175,11 @@ public: ...@@ -175,6 +175,11 @@ public:
/// gets the current clipboard content /// gets the current clipboard content
std::string getClipboardString() const; std::string getClipboardString() const;
/// Returns true iff the specified mouse button (GLFW_...) is pressed
bool isMouseButtonPressed(int button) const;
/// Returns true iff the specified key (GLFW_...) is pressed
bool isKeyPressed(int key) const;
protected: protected:
/// Called once GLOW is initialized. Allocated your resources and init your logic here. /// Called once GLOW is initialized. Allocated your resources and init your logic here.
virtual void init(); virtual void init();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment