Compare commits
2 Commits
Prerelease
...
Prerelease
Author | SHA1 | Date | |
---|---|---|---|
48091496d5 | |||
c202ca5c84 |
@@ -127,7 +127,6 @@ namespace ReWindow
|
||||
|
||||
|
||||
/// General To Do List
|
||||
/// TODO: Implement accurate timekeeping on refresh. Have mechanism to expose to user (hook into their game engine's timestepping)
|
||||
/// TODO: Clean up public API to express the cross-platform, multi-graphics-mode ethos of this project.
|
||||
///
|
||||
|
||||
@@ -182,8 +181,6 @@ namespace ReWindow
|
||||
/// Returns a Vector2 representing mouse coordinates relative to the top-left corner of the window.
|
||||
Vector2 GetMouseCoordinates() const;
|
||||
|
||||
|
||||
|
||||
/// Sets which rendering API is to be used with this window.
|
||||
void setRenderer(RenderingAPI api);
|
||||
|
||||
@@ -280,6 +277,26 @@ namespace ReWindow
|
||||
static void glSwapBuffers();
|
||||
Vector2 getLastKnownResize() const;
|
||||
void setLastKnownWindowSize(const Vector2& size);
|
||||
protected:
|
||||
float delta_time;
|
||||
float refresh_rate;
|
||||
int refresh_count;
|
||||
bool cursor_visible = true;
|
||||
Vector2 lastKnownWindowSize {0, 0};
|
||||
bool flags[5];
|
||||
std::vector<RWindowEvent> eventLog;
|
||||
KeyboardState currentKeyboard; // Current Frame's Keyboard State
|
||||
KeyboardState previousKeyboard; // Previous Frame's Keyboard State
|
||||
bool fullscreenmode = false;
|
||||
std::string title;
|
||||
int width;
|
||||
int height;
|
||||
RenderingAPI renderer;
|
||||
bool open = false;
|
||||
bool resizable;
|
||||
|
||||
Vector2 mouse_coords = {0, 0};
|
||||
Vector2 last_mouse_coords = {0, 0};
|
||||
private:
|
||||
|
||||
|
||||
@@ -310,25 +327,8 @@ namespace ReWindow
|
||||
void processMouseMove(Vector2 last_pos, Vector2 new_pos);
|
||||
|
||||
private:
|
||||
bool cursor_visible = true;
|
||||
Vector2 lastKnownWindowSize {0, 0};
|
||||
bool flags[5];
|
||||
std::vector<RWindowEvent> eventLog;
|
||||
KeyboardState currentKeyboard; // Current Frame's Keyboard State
|
||||
KeyboardState previousKeyboard; // Previous Frame's Keyboard State
|
||||
bool fullscreenmode = false;
|
||||
std::string title;
|
||||
int width;
|
||||
int height;
|
||||
RenderingAPI renderer;
|
||||
bool open = false;
|
||||
bool resizable;
|
||||
|
||||
Vector2 mouse_coords = {0, 0};
|
||||
Vector2 last_mouse_coords = {0, 0};
|
||||
|
||||
float delta_time;
|
||||
float refresh_rate;
|
||||
int refresh_count;
|
||||
|
||||
};
|
||||
}
|
2
main.cpp
2
main.cpp
@@ -10,8 +10,6 @@
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
||||
|
||||
Vector2 mouse_pos;
|
||||
|
||||
// TODO: Move to J3ML::LinearAlgebra::Vector2
|
||||
|
@@ -85,7 +85,7 @@ void RWindow::refresh() {
|
||||
float frame_time_s = frame_time_ms / 1000.f;
|
||||
delta_time = frame_time_ms;
|
||||
|
||||
refresh_rate = 1.f / refresh_rate;
|
||||
refresh_rate = 1.f / delta_time;
|
||||
|
||||
|
||||
refresh_count++;
|
||||
|
Reference in New Issue
Block a user