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

void Window::onResize(int w, int h) { void Window::onResize(int w, int h) {
w_ = w; w_ = w;
h_ = h; h_ = h;
glViewport(0, 0, w, h);

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



+ 5
- 1
src/main.cc View File



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


break; break;


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

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

Loading…
Cancel
Save