Giter VIP home page Giter VIP logo

Comments (2)

Gleefre avatar Gleefre commented on May 19, 2024

Hello,
I think I was able to find a way for doing it: (in sketch.lisp)

(defmethod kit.sdl2:window-event :before ((instance sketch) type ts data1 data2)
  (when (eq type :size-changed)
    (with-slots ((env %env) width height y-axis) instance
      (setf width data1
            height data2
            (env-view-matrix env)
            (if (eq y-axis :down)
                (kit.glm:ortho-matrix 0 width height 0 -1 1)
                (kit.glm:ortho-matrix 0 width 0 height -1 1)))
      (gl:viewport 0 0 width height)
      (kit.gl.shader:uniform-matrix
       (env-programs env) :view-m 4 (vector (env-view-matrix env))))))

And to make window resizable:

(make-instance 'app :resizable t)

Will be a pull request welcome?

I must note, however, that I'm not sure what exactly is happening in here, especially for ql:viewport part.

from sketch.

vydd avatar vydd commented on May 19, 2024

PRs are definitely welcome! If you see an easy way to refactor the code so that we are not copy pasting the y-axis, viewport, and uniform-matrix stuff - that would be great too. Otherwise this at least fixes a bug, so I'm happy to merge that and refactor later.

from sketch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.