Merge remote-tracking branch 'origin/main'

This commit is contained in:
2024-04-09 16:38:49 -04:00
2 changed files with 9 additions and 8 deletions

View File

@@ -49,11 +49,12 @@ int main() {
window->setRenderer(RenderingAPI::OPENGL);
window->Open();
// TODO: Cannot set flags until after window is open
// Make this work somehow
window->setFullscreen(false);
window->setVsyncEnabled(true);
window->setResizable(true);
window->setVsyncEnabled(false);
window->setResizable(false);
window->OnKeyDownEvent += [&] (ReWindow::KeyDownEvent e)
{

View File

@@ -128,7 +128,7 @@ namespace ReWindow {
auto scancode = (X11Scancode) xev.xkey.keycode;
auto key = GetKeyFromX11Scancode(scancode);
currentKeyboard.PressedKeys[key] = false;
KeyUpEvent eventData = KeyUpEvent(key);
auto eventData = KeyUpEvent(key);
OnKeyUp(eventData);
}
@@ -136,7 +136,7 @@ namespace ReWindow {
auto scancode = (X11Scancode) xev.xkey.keycode;
auto key = GetKeyFromX11Scancode(scancode);
currentKeyboard.PressedKeys[key] = true;
KeyDownEvent eventData = KeyDownEvent(key);
auto eventData = KeyDownEvent(key);
OnKeyDown(eventData);
eventLog.push_back(eventData);
}
@@ -185,10 +185,10 @@ namespace ReWindow {
// Might make the window go off the screen on some window managers.
void RWindow::setSize(int newWidth, int newHeight)
{
this->width = newWidth;
this->height = newHeight;
if (!getFlag(RWindowFlags::RESIZABLE))
return;
this->width = newWidth;
this->height = newHeight;
XResizeWindow(display, window, width, height);
}
@@ -319,9 +319,9 @@ namespace ReWindow {
}
void RWindow::setVsyncEnabled(bool b) {
PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT = nullptr;
PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT;
glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glXGetProcAddressARB((const GLubyte*)"glXSwapIntervalEXT");
glXSwapIntervalEXT(display, None, b);
glXSwapIntervalEXT(display, window, b);
}
bool RWindow::isFullscreen() const {