[fetter-devel] vzn vs. oo
Kenny Tilton
ktilton at nyc.rr.com
Tue Sep 27 17:02:11 UTC 2005
FTGL is a pretty simple OO library: font class, then subclasses for
pixmap, texture, extruded, inter alia. One virtual function is "render".
vzn ends up producing (loosely speaking):
pixmap-render
texture-render
extruded-render
....
Left as an exercise is restoring the OO. What I would be tempted to do is:
(defclass font ....)
(defclass texture-font (font) ...)
(defmethod render ((f texture-font) string)
(texture-render f string))
Does vzn see enough info to restore the polymorphism of the C++ "render"
virtual function? Even better would be:
(defmethod initialize-instance :after ((f texture-font) &key)
(setf (cpp-instance f) (texture-font-new (font-path f))))
As it is I think Vzn falls short of exposing the FTGL API, by leaving
restoration of the polymorphism to the user. Or am I missing something
or some difficulty?
--
Kenny
Why Lisp? http://wiki.alu.org/RtL_Highlight_Film
"I've wrestled with reality for 35 years, Doctor, and I'm happy to state I finally won out over it."
Elwood P. Dowd, "Harvey", 1950
More information about the fetter-devel
mailing list