Skip to content

Commit 6f26742

Browse files
committed
GLCORE: break debug build to inform upcoming changes
1 parent 713d310 commit 6f26742

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

modules/ln_glcore/glcore.scm

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,31 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
200200
;; ----------------------------------
201201
;; textures
202202

203-
;; each entry is a vector of initflag,texure,w,h,u8data,pixeltype
204-
(define glCore:textures (##still-copy (make-table)))
205-
(define glCore:tidx 0)
206-
(define glCore:curtexture -1)
203+
(cond-expand ;; CONSTRUCTION-CASE
204+
((or debug) ;; tentative changes
205+
;;; intentions:
206+
;;; 1. hide globals glCore:textures and glCore:tidx (at least)
207+
;;; 2. (short term) replace vector with distinct type
208+
209+
(define %%glCore:textures-ref)
210+
211+
(let ((glCore:textures (make-table)))
212+
;; should we use `(##still-copy (make-table))` for glCore:textures?
213+
(define (glCore:textures-ref texture default)
214+
(table-ref glCore:textures texture default))
215+
(set! %%glCore:textures-ref glCore:textures-ref))
216+
217+
) ;; end of tentative changes
218+
(else ;; old version
219+
;; each entry is a vector of initflag,texure,w,h,u8data,pixeltype
220+
(define glCore:textures (##still-copy (make-table)))
221+
(define glCore:tidx 0)
222+
(define glCore:curtexture -1)
223+
;; forward compatible replacements
224+
(define (%%glCore:textures-ref texture default)
225+
(table-ref glCore:textures texture default))
226+
) ;; end of old version
227+
) ;; end of CONSTRUCTION-CASE
207228

208229
(define (glCoreTextureCreate w h data . aux)
209230
(glcore:log 5 "glCoreTextureCreate")

0 commit comments

Comments
 (0)