Update window.cpp
Fixed a problem that'd cause setting vsync to behave strangely and overlays to crash.
This commit is contained in:
@@ -59,6 +59,7 @@ void RWindow::init(RenderingAPI api, const char* title, int width, int height, b
|
||||
GLint glAttributes[] = {GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None};
|
||||
visual = glXChooseVisual(display, defaultScreen, glAttributes);
|
||||
glContext = glXCreateContext(display, visual, nullptr, GL_TRUE);
|
||||
vsync = sync;
|
||||
xSetWindowAttributes.colormap = XCreateColormap(display, RootWindow(display, defaultScreen), visual->visual,
|
||||
AllocNone);
|
||||
|
||||
@@ -162,9 +163,8 @@ void RWindow::pollEvents() {
|
||||
}
|
||||
|
||||
if (xev.type == ButtonRelease) {
|
||||
//auto scancode = (X11Scancode) xev.xkey.keycode;
|
||||
/*for (unsigned int i = 0; i < eventLog.size(); i++) {
|
||||
if (auto *e = dynamic_cast<MouseButtonDownEvent *>(eventLog[i])) {
|
||||
for (unsigned int i = 0; i < events.size(); i++) {
|
||||
if (auto *e = dynamic_cast<MouseButtonDownEvent *>(events[i])) {
|
||||
if ((int) e->button == (int) xev.xbutton.button) {
|
||||
delete eventLog[i];
|
||||
eventLog.erase(eventLog.begin() + i);
|
||||
|
Reference in New Issue
Block a user