Browse files

initial commit

  • Loading branch information...
1 parent bab90b6 commit 9b5f237affd18ce697c23d298cc3cf58819dd458 @eagle2com committed Mar 25, 2010
Showing with 47 additions and 0 deletions.
  1. +41 −0 ftgl.ooc
  2. +6 −0 ftgl.use
View
41 ftgl.ooc
@@ -0,0 +1,41 @@
+use ftgl
+use glew
+import glew
+
+include FTGL/ftgl
+
+FTGLfont: extern cover
+FTGL_RENDER_ALL: extern Int
+ftglSetFontFaceSize: extern func(...)
+ft_encoding_unicode: extern Int
+
+
+Ftgl: class {
+ font: FTGLfont*
+
+ init: func(x,y: Int,filename: String) {
+ font = createTextureFont(filename)
+ setFontFaceSize(font,x,y)
+ setFontCharMap(font,ft_encoding_unicode)
+ printf("Loaded font: %s\n",filename)
+ }
+
+ render: func(x,y,s: Double,mirror: Bool, text: String) {
+ glPushMatrix()
+ glTranslated(x,y,0)
+ glScaled(s,s,s);
+ if(mirror) {
+ glRotated(180,1,1,1)
+ }
+ renderFont(font,text,FTGL_RENDER_ALL)
+ glPopMatrix()
+ }
+
+
+ renderFont: extern(ftglRenderFont) static func(FTGLfont*,String,Int)
+ setFontFaceSize: extern(ftglSetFontFaceSize) static func(FTGLfont*,Int,Int)
+ setFontCharMap: extern(ftglSetFontCharMap) static func(FTGLfont*,Int)
+ createTextureFont: extern(ftglCreateTextureFont) static func(String)
+}
+
+
View
6 ftgl.use
@@ -0,0 +1,6 @@
+Name: ftgl
+Description: ftgl
+SourcePath: .
+Libs: -lftgl
+Pkgs: ftgl
+

0 comments on commit 9b5f237

Please sign in to comment.