diff options
author | David Thompson <dthompson@member.fsf.org> | 2013-08-18 09:05:28 -0400 |
---|---|---|
committer | David Thompson <dthompson@member.fsf.org> | 2013-08-18 09:05:28 -0400 |
commit | 6e8aced1af1fe2d4c0c9ea71314bcf6586316df9 (patch) | |
tree | 63b6c1588cb539a1de27fac41a249c5698245e77 /2d/wrappers | |
parent | cf82f90d852e7ba0478aaf7480ba5914edc02be5 (diff) |
Add a few more wrappers for FTGL layout functions.
Diffstat (limited to '2d/wrappers')
-rw-r--r-- | 2d/wrappers/ftgl.scm | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/2d/wrappers/ftgl.scm b/2d/wrappers/ftgl.scm index 3108e8e..f44443b 100644 --- a/2d/wrappers/ftgl.scm +++ b/2d/wrappers/ftgl.scm @@ -104,6 +104,9 @@ (define-foreign %ftgl-create-simple-layout '* "ftglCreateSimpleLayout" '()) +(define-foreign %ftgl-destroy-layout + void "ftglDestroyLayout" '(*)) + (define-foreign %ftgl-set-layout-font void "ftglSetLayoutFont" '(* *)) @@ -129,10 +132,16 @@ ;; (define-foreign %ftgl-get-layout-line-spacing ;; float "ftglGetLayoutLineSpacing" '(*)) -(define (ftgl-create-simple-layout) +(define-foreign %ftgl-render-layout + void "ftglRenderLayout" (list '* '* int)) + +(define (ftgl-create-layout) (wrap-ftgl-simple-layout (%ftgl-create-simple-layout))) +(define (ftgl-destroy-layout layout) + (%ftgl-destroy-layout (unwrap-ftgl-simple-layout layout))) + (define (ftgl-set-layout-font layout font) (%ftgl-set-layout-font (unwrap-ftgl-simple-layout layout) (unwrap-ftgl-font font))) @@ -159,11 +168,18 @@ (%ftgl-set-layout-line-spacing (unwrap-ftgl-simple-layout layout) spacing)) -(export ftgl-create-simple-layout +(define (ftgl-render-layout layout text mode) + (%ftgl-render-layout (unwrap-ftgl-simple-layout layout) + (string->pointer text) + mode)) + +(export ftgl-create-layout + ftgl-destroy-layout ftgl-set-layout-font ftgl-get-layout-font ftgl-set-layout-line-length ftgl-get-layout-line-length ftgl-set-layout-alignment ftgl-get-layout-alignment - ftgl-set-layout-line-spacing) + ftgl-set-layout-line-spacing + ftgl-render-layout) |