davidedc / livecodelab

a web based livecoding environment
http://livecodelab.net/
MIT License
327 stars 63 forks source link

Graphics system overhaul #289

Closed rumblesan closed 7 years ago

rumblesan commented 7 years ago

There are three major things that this pull request does.

Moves all canvas resizing and scaling logic into a Canvas class. This is created outside of LiveCodeLab core and injected in the same way that previously just the canvas DOM element was. The logic is that the core shouldn't actually be handling the resizing of the canvas, but it should react to it and be passed the sizing information when this happens. The helper functions in the threejs system have been either moved into the Canvas class, or into the threejs class. Specifically the effects pipeline creation, which makes them a bit cleaner. The renderer class logic has also been moved into the threejs-system class. There wasn't really any need to have a separate Renderer class when the important parts of it are already in ThreeJsSystem.

Also moves the exclusion principle code into the graphics lib, as I felt it fitted better there.