command-line shuffle opengl ui.render ascii math.bitwise locals
accessors math.rectangles math.order ascii calendar
io.encodings.utf16n windows.errors literals ui.pixel-formats
-ui.pixel-formats.private memoize ;
+ui.pixel-formats.private memoize classes ;
IN: ui.backend.windows
SINGLETON: windows-ui-backend
pfd-flag-map at [ ] [ 0 ] if* ;
: >pfd-flags ( attributes -- flags )
- [ >pfd-flag ] map [ bitor ] binary-reduce
+ [ >pfd-flag ] [ bitor ] map-reduce
PFD_SUPPORT_OPENGL bitor ;
: attr-value ( attributes name -- value )
: setup-gl ( world -- )
[ get-dc ] keep
- [ swap [ hDC>> set-pixel-format ] [ get-rc ] bi ]
+ [ swap [ handle>> hDC>> set-pixel-format ] [ get-rc ] bi ]
with-world-pixel-format ;
M: windows-ui-backend (open-window) ( world -- )
- [ dup create-window f f <win> >>handle setup-gl ]
+ [ dup create-window [ f f ] dip f f <win> >>handle setup-gl ]
[ dup handle>> hWnd>> register-window ]
[ handle>> hWnd>> show-window ] tri ;
M: win-base flush-gl-context ( handle -- )
hDC>> SwapBuffers win32-error=0/f ;
-: setup-offscreen-gl ( world -- hDC hRC hBitmap bits )
+: setup-offscreen-gl ( world -- )
dup [ handle>> ] [ dim>> ] bi make-offscreen-dc-and-bitmap
[ >>hDC ] [ >>hBitmap ] [ >>bits ] tri* drop [
- swap [ hDC>> set-pixel-format ] [ get-rc ] bi
+ swap [ handle>> hDC>> set-pixel-format ] [ get-rc ] bi
] with-world-pixel-format ;
M: windows-ui-backend (open-offscreen-buffer) ( world -- )
! FUNCTION: DeleteMetaFile
FUNCTION: BOOL DeleteObject ( HGDIOBJ hObject ) ;
DESTRUCTOR: DeleteObject
-! FUNCTION: DescribePixelFormat
+FUNCTION: int DescribePixelFormat ( HDC hdc, int iPixelFormat, UINT nBytes, PIXELFORMATDESCRIPTOR* ppfd ) ;
! FUNCTION: DeviceCapabilitiesExA
! FUNCTION: DeviceCapabilitiesExW
! FUNCTION: DPtoLP