win32: gl bitmaps

This commit is contained in:
Matthew Flatt 2010-10-13 21:22:20 -06:00
parent 77399ddaf7
commit b98ba3e60b
3 changed files with 13 additions and 2 deletions

View File

@ -21,7 +21,7 @@
(define win32-bitmap%
(class bitmap%
(init w h hwnd)
(init w h hwnd [gl-config #f])
(super-make-object (make-alternate-bitmap-kind w h))
(define s
@ -40,6 +40,14 @@
(cairo_paint cr)
(cairo_destroy cr))
s))
(define gl (and gl-config
(let ([hdc (cairo_win32_surface_get_dc s)])
(set-cpointer-tag! hdc 'HDC)
(create-gl-context hdc
gl-config
#t))))
(define/override (get-bitmap-gl-context) gl)
(define/override (ok?) #t)
(define/override (is-color?) #t)

View File

@ -106,6 +106,6 @@
(define/top (make-gl-bitmap [exact-positive-integer? w]
[exact-positive-integer? h]
[gl-config% c])
(make-object win32-bitmap% w h #f))
(make-object win32-bitmap% w h #f c))
(define (check-for-break) #f)

View File

@ -79,6 +79,9 @@
(_fun _pointer _int _int _int -> _cairo_surface_t)
#:make-fail make-not-available
#:wrap (allocator cairo_surface_destroy))
(define-cairo cairo_win32_surface_get_dc
(_fun _cairo_surface_t -> _pointer)
#:make-fail make-not-available)
(define-cairo cairo_create (_fun _cairo_surface_t -> _cairo_t)
#:wrap (allocator cairo_destroy))