Browse Source

hidpi and wayland fixes

feature/replace-renderer
Martin Dørum 3 years ago
parent
commit
8b97bfd2c9
2 changed files with 9 additions and 2 deletions
  1. 4
    1
      libcygnet/src/Window.cc
  2. 5
    1
      src/main.cc

+ 4
- 1
libcygnet/src/Window.cc View File

@@ -63,7 +63,10 @@ void Window::flip() {
void Window::onResize(int w, int h) {
w_ = w;
h_ = h;
glViewport(0, 0, w, h);

int dw, dh;
SDL_GL_GetDrawableSize(state_->window, &dw, &dh);
glViewport(0, 0, dw, dh);
glCheck();
}


+ 5
- 1
src/main.cc View File

@@ -127,9 +127,9 @@ int main(int argc, char **argv) {

case SDL_WINDOWEVENT:
if (evt.window.event == SDL_WINDOWEVENT_RESIZED) {
window.onResize(evt.window.data1, evt.window.data2);
//imguiIO.DisplaySize.x = (float)evt.window.data1;
//imguiIO.DisplaySize.y = (float)evt.window.data2;
window.onResize(evt.window.data1, evt.window.data2);
}
break;

@@ -164,6 +164,10 @@ int main(int argc, char **argv) {
break;

case SDL_MOUSEWHEEL:
if (evt.wheel.y == 0) {
break;
}

/*
imguiIO.MouseWheel += (float)evt.wheel.y;
if (!imguiIO.WantCaptureMouse) */

Loading…
Cancel
Save