Comments (2)
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.
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)
- MAKE-LINE behaving oddly with small values of stroke weight HOT 2
- Improve speed of canvas painting HOT 3
- Add control flow functions from p5js HOT 2
- Make errors more recoverable HOT 6
- Correlated randomness HOT 3
- Support for saving animations HOT 2
- Add missing event-handling functions HOT 3
- Enable drawing in event-handling functions
- Broken link: sjl's coding-math project is not on BitBucket anymore HOT 2
- Attempting to render images results in a garbled mess. HOT 5
- Working on macOS 13.1 using Clozure CL HOT 1
- Using images. HOT 2
- copy-pixels overrides background colour depending on window size HOT 10
- Escape can close multiple windows.
- Question: Getting dimensions and pixels of loaded image HOT 3
- :copy-pixels t flickers between 2 canvases with incorrect backgrounds HOT 5
- quicklisp CFFI-GROVEL:GROVEL-ERROR Couldn't execute "cc" HOT 2
- incf in a let form HOT 2
- Further improvements / maintenance HOT 7
- defsketch bugs/surprises HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sketch.