[cello-cvs] CVS cello/cl-ftgl
ktilton
ktilton at common-lisp.net
Mon Jul 3 00:35:12 UTC 2006
Update of /project/cello/cvsroot/cello/cl-ftgl
In directory clnet:/tmp/cvs-serv10432/cl-ftgl
Modified Files:
cl-ftgl.lisp cl-ftgl.lpr
Log Message:
--- /project/cello/cvsroot/cello/cl-ftgl/cl-ftgl.lisp 2006/06/26 17:05:21 1.4
+++ /project/cello/cvsroot/cello/cl-ftgl/cl-ftgl.lisp 2006/07/03 00:35:12 1.5
@@ -20,7 +20,7 @@
;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
;;; IN THE SOFTWARE.
-;;; $Header: /project/cello/cvsroot/cello/cl-ftgl/cl-ftgl.lisp,v 1.4 2006/06/26 17:05:21 ktilton Exp $
+;;; $Header: /project/cello/cvsroot/cello/cl-ftgl/cl-ftgl.lisp,v 1.5 2006/07/03 00:35:12 ktilton Exp $
(defpackage #:cl-ftgl
(:nicknames #:ftgl)
@@ -60,6 +60,7 @@
(defparameter *gui-style-button-face* 'sylfaen)
(defparameter *ftgl-loaded-p* nil)
(defparameter *ftgl-fonts-loaded* nil)
+(defparameter *ftgl-ogl* nil)
;; ----------------------------------------------------------------------------
;; FOREIGN FUNCTION INTERFACE
@@ -177,6 +178,7 @@
ifont)
(defun ftgl-char-width (f c)
+ (assert *ftgl-ogl*)
(or (aref (ftgl-widths f) (char-code c))
(setf (aref (ftgl-widths f) (char-code c))
(ftgl-string-length f (string c)))))
@@ -218,17 +220,20 @@
(xftgl)
(defun ftgl-get-ascender (font)
+ (assert *ftgl-ogl*)
(or (ftgl-ascender font)
(setf (ftgl-ascender font)
(fgc-ascender (ftgl-get-metrics-font font)))))
(defun ftgl-get-descender (font)
+ (assert *ftgl-ogl*)
(or (ftgl-descender font)
(setf (ftgl-descender font)
(fgc-descender (ftgl-get-metrics-font font)))))
(defun ftgl-height (f)
- (+ (ftgl-get-ascender f)
+ (assert *ftgl-ogl*)
+ (- (ftgl-get-ascender f)
(ftgl-get-descender f)))
(defun ftgl-get-display-font (font)
@@ -278,7 +283,7 @@
(error "cannot load ~a font ~a" (type-of font) fpath)))
(error "Font not found: ~a" path))))
-(defun ftgl-render (font s)
+(defmethod ftgl-render (font s)
(assert font)
(assert (stringp s))
(when font
@@ -287,6 +292,12 @@
(fgc-render df s)
(break "whoa, no display font for ~a" font)))))
+(defmethod ftgl-render :before ((font ftgl-texture) s)
+ (declare (ignorable s))
+ (gl-enable gl_texture_2d)
+ (gl-enable gl_blend)
+ (gl-disable gl_lighting))
+
(defmethod fgc-font-make :before (font fpath)
(declare (ignore font fpath))
(cl-ftgl-init))
@@ -312,6 +323,7 @@
(fgc-polygon-make fpath))
(defun ftgl-string-length (font cs)
+ ;;(trc "ftgl-string-length" (ftgl-get-metrics-font font) cs)
(fgc-string-advance (ftgl-get-metrics-font font) cs))
(defmethod font-bearing-x (font &optional text)
--- /project/cello/cvsroot/cello/cl-ftgl/cl-ftgl.lpr 2006/06/26 17:05:21 1.5
+++ /project/cello/cvsroot/cello/cl-ftgl/cl-ftgl.lpr 2006/07/03 00:35:12 1.6
@@ -1,4 +1,4 @@
-;; -*- lisp-version: "8.0 [Windows] (Jun 21, 2006 9:54)"; cg: "1.81"; -*-
+;; -*- lisp-version: "8.0 [Windows] (Jun 28, 2006 10:53)"; cg: "1.81"; -*-
(in-package :cg-user)
More information about the Cello-cvs
mailing list