This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum eClass | |
| { | |
| MODEL, | |
| RENDERABLE, | |
| ATTACHMENT, | |
| LOCATION | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Ensure unix binaries on path | |
| (setenv "PATH" (concat "C:\\wsr\\apps\\Git\\bin" path-separator "C:\\wsr\\apps\\emacs-24.3\\bin" path-separator (getenv "PATH"))) | |
| ;;; basic load-path setup | |
| ;;; ------------------------------------------------------------------ | |
| (defun add-subdirs-to-load-path (dir) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * hello-scheme for illustration how to embed | |
| * the tiny scheme interpreter in a C program | |
| * | |
| * 2012, OL | |
| */ | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include "scheme.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Copyright 2010 Nurullah Akkaya */ | |
| /* lisp.c is free software: you can redistribute it and/or modify it */ | |
| /* under the terms of the GNU General Public License as published by the */ | |
| /* Free Software Foundation, either version 3 of the License, or (at your */ | |
| /* option) any later version. */ | |
| /* lisp.c is distributed in the hope that it will be useful, but WITHOUT */ | |
| /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; The following lines added by ql:add-to-init-file: | |
| #-quicklisp | |
| (let ((quicklisp-init #P"/wsr/lisp/quicklisp/setup.lisp")) | |
| (when (probe-file quicklisp-init) | |
| (load quicklisp-init))) | |
| (defun start-swank-server (&key (port 4006)) | |
| "Starts a swank-server on the localhost interface." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (let ((state (aa:make-state))) ; create the state | |
| ;; the 1st triangle | |
| (aa:line-f state 200 50 250 150) ; describe the 3 sides | |
| (aa:line-f state 250 150 50 100) ; of the first triangle | |
| (aa:line-f state 50 100 200 50) | |
| ;; the 2nd triangle | |
| (aa:line-f state 75 25 10 75) ; describe the 3 sides | |
| (aa:line-f state 10 75 175 100) ; of the second triangle | |
| (aa:line-f state 175 100 75 25) | |
| (let* ((image (opticl:make-8-bit-rgba-image 200 300 :initial-element 255))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| nvgImageSize(vg, fb->image, &fboWidth, &fboHeight); | |
| winWidth = (int)(fboWidth / pxRatio); | |
| winHeight = (int)(fboHeight / pxRatio); | |
| // Draw some stuff to an FBO as a test | |
| nvgluBindFramebuffer(fb); | |
| glViewport(0, 0, fboWidth, fboHeight); | |
| glClearColor(0, 0, 0, 0); | |
| glClear(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); | |
| nvgBeginFrame(vg, winWidth, winHeight, pxRatio); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import euclid | |
| from euclid import Vector3 | |
| # naive first attempt at a mesh representation | |
| # a straight list of vertices | |
| class Mesh: | |
| def __init__(self, vertices=[]): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # if you can't rely on euclid, what can you rely on? | |
| import euclid | |
| from euclid import Vector3 | |
| class Mesh: | |
| def __init__(self, vertices=[], faces=[]): | |
| """Initialises a vertex with a list of faces. Vertex array is a list of Vector3. Face array is a list of 3 tuple indexes into vertex array.""" | |
| self.vertex_list = vertices | |
| self.face_list = faces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # if you can't rely on euclid, what can you rely on? | |
| import euclid | |
| from euclid import Vector3 | |
| class Mesh: | |
| def __init__(self, vertices=[], faces=[]): | |
| """Initialises a vertex with a list of faces. Vertex array is a list of Vector3. Face array is a list of 3 tuple indexes into vertex array.""" | |
| self.vertex_list = vertices | |
| self.face_list = faces |