Rename Application::get() singleton to the()
This commit is contained in:
@@ -36,7 +36,7 @@ namespace Inferno {
|
||||
|
||||
inline Window& getWindow() const { return *m_window; }
|
||||
|
||||
static inline Application& get() { return *s_instance; }
|
||||
static inline Application& the() { return *s_instance; }
|
||||
|
||||
private:
|
||||
std::unique_ptr<Window> m_window;
|
||||
|
||||
@@ -17,8 +17,8 @@ namespace Inferno {
|
||||
void Input::initialize()
|
||||
{
|
||||
// Set cursor in the middle of the screen
|
||||
m_xPosLast = Application::get().getWindow().getWidth() / 2.0f;
|
||||
m_yPosLast = Application::get().getWindow().getHeight() / 2.0f;
|
||||
m_xPosLast = Application::the().getWindow().getWidth() / 2.0f;
|
||||
m_yPosLast = Application::the().getWindow().getHeight() / 2.0f;
|
||||
|
||||
dbg(Log::Info) << "Input initialized";
|
||||
}
|
||||
@@ -50,19 +50,19 @@ namespace Inferno {
|
||||
|
||||
bool Input::isKeyPressed(int key)
|
||||
{
|
||||
GLFWwindow* w = Application::get().getWindow().getWindow();
|
||||
GLFWwindow* w = Application::the().getWindow().getWindow();
|
||||
return glfwGetKey(w, key) == GLFW_PRESS;
|
||||
}
|
||||
|
||||
bool Input::isMouseButtonPressed(int button)
|
||||
{
|
||||
GLFWwindow* w = Application::get().getWindow().getWindow();
|
||||
GLFWwindow* w = Application::the().getWindow().getWindow();
|
||||
return glfwGetMouseButton(w, button) == GLFW_PRESS;
|
||||
}
|
||||
|
||||
std::pair<float, float> Input::getMousePosition()
|
||||
{
|
||||
GLFWwindow* w = Application::get().getWindow().getWindow();
|
||||
GLFWwindow* w = Application::the().getWindow().getWindow();
|
||||
double xPos;
|
||||
double yPos;
|
||||
glfwGetCursorPos(w, &xPos, &yPos);
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace Inferno {
|
||||
transform()->setTransform(glm::inverse(transform()->transform()));
|
||||
|
||||
// View space -> Clip space: projection matrix
|
||||
float aspectRatio = Application::get().getWindow().getAspect();
|
||||
float aspectRatio = Application::the().getWindow().getAspect();
|
||||
setProjection(glm::ortho(-aspectRatio * m_zoomLevel, aspectRatio * m_zoomLevel, -m_zoomLevel, m_zoomLevel, -1.0f, 1.0f));
|
||||
|
||||
// Clip space -> Screen space: viewport transform
|
||||
@@ -214,7 +214,7 @@ namespace Inferno {
|
||||
transform()->setTransform(glm::lookAt(transform()->translate(), transform()->translate() + transform()->rotate(), m_up));
|
||||
|
||||
// View space -> Clip space: projection matrix
|
||||
float aspect = Application::get().getWindow().getAspect();
|
||||
float aspect = Application::the().getWindow().getAspect();
|
||||
setProjection(glm::perspective(glm::radians(m_fov), aspect, NEAR_PLANE, FAR_PLANE));
|
||||
|
||||
// Clip space -> Screen space: viewport transform
|
||||
|
||||
Reference in New Issue
Block a user