mirror of
https://github.com/penpot/penpot.git
synced 2026-09-08 13:09:22 +00:00
Read default shader from file
This commit is contained in:
parent
23adf483ff
commit
eaa9aec8bb
@ -1,12 +1,14 @@
|
|||||||
(ns app.main.ui.workspace.viewport.gl
|
(ns app.main.ui.workspace.viewport.gl
|
||||||
(:require-macros [app.main.style :as stl])
|
(:require-macros [app.main.style :as stl])
|
||||||
(:require fragment-shader)
|
(:require-macros [app.util.gl.macros :refer [slurp]])
|
||||||
(:require
|
(:require
|
||||||
[app.common.math :as math]
|
[app.common.math :as math]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(def CANVAS_CONTEXT_ID "webgl2")
|
(def CANVAS_CONTEXT_ID "webgl2")
|
||||||
|
|
||||||
|
(def default-shader (slurp "src/app/util/gl/shaders/default.v.glsl"))
|
||||||
|
|
||||||
(defn resize-canvas-to
|
(defn resize-canvas-to
|
||||||
[canvas width height]
|
[canvas width height]
|
||||||
(let [resized (or (not= (.-width canvas) width)
|
(let [resized (or (not= (.-width canvas) width)
|
||||||
@ -38,6 +40,7 @@
|
|||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
[props]
|
[props]
|
||||||
(js/console.log props)
|
(js/console.log props)
|
||||||
|
(js/console.log "default-shader" default-shader)
|
||||||
(let [objects (unchecked-get props "objects")
|
(let [objects (unchecked-get props "objects")
|
||||||
canvas-ref (mf/use-ref nil)
|
canvas-ref (mf/use-ref nil)
|
||||||
gl-ref (mf/use-ref nil)]
|
gl-ref (mf/use-ref nil)]
|
||||||
|
|||||||
6
frontend/src/app/util/gl/macros.clj
Normal file
6
frontend/src/app/util/gl/macros.clj
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
(ns app.util.gl.macros
|
||||||
|
(:refer-clojure :exclude [slurp])
|
||||||
|
(:require [clojure.core :as core]))
|
||||||
|
|
||||||
|
(defmacro slurp [file]
|
||||||
|
(core/slurp file))
|
||||||
Loading…
x
Reference in New Issue
Block a user