 IN: ui.backend.windows
 
 SINGLETON: windows-ui-backend
+
+TUPLE: win-base hDC hRC ;
+TUPLE: win < win-base hWnd world title ;
+TUPLE: win-offscreen < win-base hBitmap bits ;
+C: <win> win
+C: <win-offscreen> win-offscreen
 
 <PRIVATE
 

    hDC>> SwapBuffers win32-error=0/f ;

: setup-offscreen-gl ( world -- hDC hRC hBitmap bits )
    [
        swap
        make-offscreen-dc-and-bitmap [
            [ set-pixel-format ]
            [ get-rc ] bi
        ] 2dip ;
    ] with-world-pixel-format

M: windows-ui-backend (open-offscreen-buffer) ( world -- )
    dup setup-offscreen-gl <win-offscreen>
    >>handle drop ;

M: windows-ui-backend (close-offscreen-buffer) ( handle -- )
    [ hDC>> DeleteDC drop ]

: init-clipboard ( -- )
    <pasteboard> clipboard set-global
    <clipboard> selection set-global ;

SYMBOLS: msg-obj class-name-ptr mouse-captured ;

