fix windows ui

db4
U-FROGGER\erg 2009-05-02 20:36:31 -05:00
parent 0668b1252e
commit aa142a1b52
4 changed files with 8 additions and 8 deletions

View File

@ -11,7 +11,7 @@ threads libc combinators fry combinators.short-circuit continuations
command-line shuffle opengl ui.render ascii math.bitwise locals command-line shuffle opengl ui.render ascii math.bitwise locals
accessors math.rectangles math.order ascii calendar accessors math.rectangles math.order ascii calendar
io.encodings.utf16n windows.errors literals ui.pixel-formats io.encodings.utf16n windows.errors literals ui.pixel-formats
ui.pixel-formats.private memoize ; ui.pixel-formats.private memoize classes ;
IN: ui.backend.windows IN: ui.backend.windows
SINGLETON: windows-ui-backend SINGLETON: windows-ui-backend
@ -83,7 +83,7 @@ CONSTANT: pfd-flag-map H{
pfd-flag-map at [ ] [ 0 ] if* ; pfd-flag-map at [ ] [ 0 ] if* ;
: >pfd-flags ( attributes -- flags ) : >pfd-flags ( attributes -- flags )
[ >pfd-flag ] map [ bitor ] binary-reduce [ >pfd-flag ] [ bitor ] map-reduce
PFD_SUPPORT_OPENGL bitor ; PFD_SUPPORT_OPENGL bitor ;
: attr-value ( attributes name -- value ) : attr-value ( attributes name -- value )
@ -632,11 +632,11 @@ M: windows-ui-backend do-events
: setup-gl ( world -- ) : setup-gl ( world -- )
[ get-dc ] keep [ get-dc ] keep
[ swap [ hDC>> set-pixel-format ] [ get-rc ] bi ] [ swap [ handle>> hDC>> set-pixel-format ] [ get-rc ] bi ]
with-world-pixel-format ; with-world-pixel-format ;
M: windows-ui-backend (open-window) ( world -- ) 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 ] [ dup handle>> hWnd>> register-window ]
[ handle>> hWnd>> show-window ] tri ; [ handle>> hWnd>> show-window ] tri ;
@ -647,10 +647,10 @@ M: win-base select-gl-context ( handle -- )
M: win-base flush-gl-context ( handle -- ) M: win-base flush-gl-context ( handle -- )
hDC>> SwapBuffers win32-error=0/f ; 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 dup [ handle>> ] [ dim>> ] bi make-offscreen-dc-and-bitmap
[ >>hDC ] [ >>hBitmap ] [ >>bits ] tri* drop [ [ >>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 ; ] with-world-pixel-format ;
M: windows-ui-backend (open-offscreen-buffer) ( world -- ) M: windows-ui-backend (open-offscreen-buffer) ( world -- )

2
basis/ui/gadgets/worlds/worlds-docs.factor Normal file → Executable file
View File

@ -1,6 +1,6 @@
USING: ui.gadgets ui.render ui.text ui.text.private USING: ui.gadgets ui.render ui.text ui.text.private
ui.gestures ui.backend help.markup help.syntax ui.gestures ui.backend help.markup help.syntax
models opengl sequences strings ui.pixel-formats ; models opengl sequences strings ;
IN: ui.gadgets.worlds IN: ui.gadgets.worlds
HELP: user-input HELP: user-input

0
basis/ui/gadgets/worlds/worlds.factor Normal file → Executable file
View File

View File

@ -1419,7 +1419,7 @@ DESTRUCTOR: DeleteDC
! FUNCTION: DeleteMetaFile ! FUNCTION: DeleteMetaFile
FUNCTION: BOOL DeleteObject ( HGDIOBJ hObject ) ; FUNCTION: BOOL DeleteObject ( HGDIOBJ hObject ) ;
DESTRUCTOR: DeleteObject DESTRUCTOR: DeleteObject
! FUNCTION: DescribePixelFormat FUNCTION: int DescribePixelFormat ( HDC hdc, int iPixelFormat, UINT nBytes, PIXELFORMATDESCRIPTOR* ppfd ) ;
! FUNCTION: DeviceCapabilitiesExA ! FUNCTION: DeviceCapabilitiesExA
! FUNCTION: DeviceCapabilitiesExW ! FUNCTION: DeviceCapabilitiesExW
! FUNCTION: DPtoLP ! FUNCTION: DPtoLP