Implement static GetMouseCoordinates() ?
This commit is contained in:
@@ -158,6 +158,14 @@ namespace ReWindow
|
||||
RWindow(const std::string& title, int width, int height);
|
||||
RWindow(const std::string& title, int width, int height, RenderingAPI renderer);
|
||||
|
||||
static Vector2 GetMouseCoordinates()
|
||||
{
|
||||
if (singleton != nullptr)
|
||||
return singleton->getCursorPos();
|
||||
return Vector2::NaN;
|
||||
}
|
||||
|
||||
|
||||
void setRenderer(RenderingAPI api);
|
||||
void Open();
|
||||
void Close();
|
||||
@@ -222,7 +230,7 @@ namespace ReWindow
|
||||
RenderingAPI renderer;
|
||||
bool open = false;
|
||||
bool resizable;
|
||||
|
||||
static RWindow* singleton;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -29,15 +29,27 @@ GLXContext glContext;
|
||||
|
||||
namespace ReWindow {
|
||||
|
||||
RWindow::RWindow() {
|
||||
title = "ReWindow Application";
|
||||
width = 640;
|
||||
height = 480;
|
||||
RWindow::singleton = this;
|
||||
}
|
||||
|
||||
RWindow::RWindow(const std::string& title, int width, int height) : flags(false,false,false,false) {
|
||||
this->title = title;
|
||||
this->width = width;
|
||||
this->height = height;
|
||||
|
||||
RWindow::singleton = this;
|
||||
|
||||
}
|
||||
|
||||
RWindow::RWindow(const std::string& title, int width, int height, RenderingAPI renderer) :
|
||||
title(title), width(width), height(height), renderer(renderer)
|
||||
{ }
|
||||
{
|
||||
RWindow::singleton = this;
|
||||
}
|
||||
|
||||
void RWindow::raise() const { XRaiseWindow(display, window); }
|
||||
void RWindow::lower() const { XLowerWindow(display, window); }
|
||||
@@ -383,11 +395,7 @@ namespace ReWindow {
|
||||
return false;
|
||||
}
|
||||
|
||||
RWindow::RWindow() {
|
||||
title = "ReWindow Application";
|
||||
width = 640;
|
||||
height = 480;
|
||||
}
|
||||
|
||||
|
||||
void RWindow::setRenderer(RenderingAPI api) {
|
||||
renderer = api;
|
||||
|
Reference in New Issue
Block a user