It compiles
This commit is contained in:
parent
11f51a2dac
commit
17e10b4c4f
19 changed files with 273 additions and 231 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,5 +4,7 @@
|
|||
*.o
|
||||
*.so
|
||||
*.c
|
||||
*.link
|
||||
*.c.tmp.*
|
||||
|
||||
.direnv/
|
|
@ -3,8 +3,10 @@
|
|||
(chicken bitwise)
|
||||
(chicken syntax)
|
||||
(srfi 152))
|
||||
(import-for-syntax (format)
|
||||
(srfi 152))
|
||||
|
||||
(define (snake-upcase in)
|
||||
(define-for-syntax (snake-upcase in)
|
||||
(string-map (lambda (c)
|
||||
(if (char=? #\- c)
|
||||
#\_
|
||||
|
@ -56,4 +58,4 @@
|
|||
"~A(~{~^, ~};" ()))
|
||||
((_ return-type proc (args ...))
|
||||
(call-c* return-type proc (args ...)
|
||||
"C_return(~A(~{~^, ~}));"))))
|
||||
"C_return(~A(~{~^, ~}));" ()))))
|
||||
|
|
11
lib/sdl3-blendmode-impl.scm
Normal file
11
lib/sdl3-blendmode-impl.scm
Normal file
|
@ -0,0 +1,11 @@
|
|||
(import (scheme)
|
||||
(chicken base)
|
||||
(chicken foreign))
|
||||
(import-syntax (sdl3 internal utilities))
|
||||
|
||||
(foreign-declare "#include <SDL3/SDL_blendmode.h>")
|
||||
|
||||
(define-sdl-const-values
|
||||
blendmode unsigned-int32
|
||||
none blend blend-premultiplied add add add-premultiplied
|
||||
mod mul invalid)
|
7
lib/sdl3-events-impl.scm
Normal file
7
lib/sdl3-events-impl.scm
Normal file
|
@ -0,0 +1,7 @@
|
|||
(import (scheme)
|
||||
(chicken base)
|
||||
(chicken foreign))
|
||||
|
||||
(foreign-declare "#include <SDL3/SDL_events.h>")
|
||||
|
||||
(define-foreign-type SDL_Event (union "SDL_Event"))
|
|
@ -1,7 +1,7 @@
|
|||
(import (scheme)
|
||||
(chicken base)
|
||||
(chicken foreign)
|
||||
(sdl internal utilities))
|
||||
(sdl3 internal utilities))
|
||||
(import-for-syntax (sdl3 internal utilities))
|
||||
|
||||
(foreign-declare "#include <SDL3/SDL_init.h>")
|
||||
|
@ -15,11 +15,11 @@
|
|||
|
||||
(define-sdl-const-values
|
||||
init SDL_InitFlags
|
||||
(audio video joystick haptic gamepad events sensor camera))
|
||||
audio video joystick haptic gamepad events sensor camera)
|
||||
|
||||
(define-sdl-const-values
|
||||
app SDL_AppResult
|
||||
(continue success failure))
|
||||
continue success failure)
|
||||
|
||||
;;; Procedures
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
|||
(foldl-uint-flags flags)))
|
||||
|
||||
(define quit
|
||||
(foreign-lambda void "SDL_Quit" void))
|
||||
(foreign-lambda void "SDL_Quit"))
|
||||
|
||||
(define (quit-sub-system #!rest flags)
|
||||
((foreign-lambda void "SDL_QuitSubSystem" SDL_InitFlags)
|
||||
|
|
19
lib/sdl3-pixels-impl.scm
Normal file
19
lib/sdl3-pixels-impl.scm
Normal file
|
@ -0,0 +1,19 @@
|
|||
(import (scheme)
|
||||
(chicken base)
|
||||
(chicken foreign))
|
||||
(import-syntax (sdl3 internal utilities))
|
||||
|
||||
(foreign-declare "#include <SDL3/SDL_pixels.h>")
|
||||
|
||||
(define-sdl-const-values
|
||||
pixelformat unsigned-int32
|
||||
unknown index1lsb index1msb index2lsb index2msb index4lsb index4msb index8 rgb332
|
||||
xrgb4444 xbgr4444 xrgb1555 xbgr1555 argb4444 rgba4444 abgr4444 bgra4444 argb1555
|
||||
rgba5551 abgr1555 bgra5551 rgb565 bgr565 rgb24 bgr24 xrgb8888 rgbx8888
|
||||
xbgr8888 bgrx8888 argb8888 rgba8888 abgr8888 bgra8888
|
||||
xrgb2101010 xbgr2101010 argb2101010 abgr2101010 rgb48 bgr48 rgba64
|
||||
argb64 bgra64 abgr64 rgb48-float bgr48-float rgba64-float argb64-float
|
||||
bgra64-float abgr64-float rgb96-float bgr96-float rgba128-float
|
||||
argb128-float bgra128-float abgr128-float yv12 iyuv yuy2 uyvy yvyu nv12
|
||||
nv21 p010 external-oes rgba32 argb32 bgra32 abgr32 rgbx32 xrgb32 bgrx32
|
||||
xbgr32)
|
|
@ -1,7 +1,7 @@
|
|||
(import (scheme)
|
||||
(chicken base)
|
||||
(chicken foreign))
|
||||
(import-for-syntax (sdl3 internal utilities))
|
||||
(import-syntax (sdl3 internal utilities))
|
||||
|
||||
(foreign-declare "#include <SDL3/SDL_render.h>")
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
|||
(define convert-event-to-render-coordinates
|
||||
(foreign-lambda bool "SDL_ConvertEventToRenderCoordinates"
|
||||
(c-pointer (struct "SDL_Renderer"))
|
||||
(c-pointer (struct "SDL_Event"))))
|
||||
(c-pointer (union "SDL_Event"))))
|
||||
|
||||
(define create-renderer
|
||||
(foreign-lambda (c-pointer (struct "SDL_Renderer"))
|
||||
|
@ -31,9 +31,9 @@
|
|||
"SDL_CreateSoftwareRenderer"
|
||||
(c-pointer (struct "SDL_Surface"))))
|
||||
|
||||
(define-sdl-enum-values
|
||||
(define-sdl-const-values
|
||||
textureaccess int
|
||||
(static streaming target))
|
||||
static streaming target)
|
||||
|
||||
(define create-texture
|
||||
(foreign-lambda (c-pointer (struct "SDL_Texture"))
|
||||
|
@ -219,9 +219,9 @@
|
|||
float float float float float
|
||||
(c-pointer (struct "SDL_FRect"))))
|
||||
|
||||
(define-sdl-enum-values
|
||||
(define-sdl-const-values
|
||||
flip int
|
||||
(none horizontal vertical))
|
||||
none horizontal vertical)
|
||||
|
||||
(define render-texture-rotated
|
||||
(foreign-lambda bool "SDL_RenderTextureRotated"
|
||||
|
@ -255,11 +255,6 @@
|
|||
(c-pointer (struct "SDL_Renderer"))
|
||||
float))
|
||||
|
||||
(define-sdl-enum-values
|
||||
blendmode unsigned-int32
|
||||
(none blend blend-premultiplied add add premultiplied
|
||||
mod nul invalid))
|
||||
|
||||
(define set-render-draw-blend-mode
|
||||
(foreign-lambda bool "SDL_SetRenderDrawBlendMode"
|
||||
(c-pointer (struct "SDL_Renderer"))
|
||||
|
@ -275,13 +270,13 @@
|
|||
(c-pointer (struct "SDL_Renderer"))
|
||||
float float float float))
|
||||
|
||||
(define-sdl-enum-values
|
||||
(define-sdl-const-values
|
||||
logical-presentation int
|
||||
(disabled stretch letterbox overscan integer-scale))
|
||||
disabled stretch letterbox overscan integer-scale)
|
||||
|
||||
(define-sdl-enum-values
|
||||
(define-sdl-const-values
|
||||
scalemode int
|
||||
(nearest linear))
|
||||
nearest linear)
|
||||
|
||||
(define set-render-logical-presentation
|
||||
(foreign-lambda bool "SDL_SetRenderLogicalPresentation"
|
||||
|
@ -305,9 +300,9 @@
|
|||
(c-pointer (struct "SDL_Renderer"))
|
||||
(c-pointer (struct "SDL_Rect"))))
|
||||
|
||||
(define-sdl-enum-values
|
||||
(define-sdl-const-values
|
||||
renderer-vsync int
|
||||
(disabled adaptive))
|
||||
disabled adaptive)
|
||||
|
||||
(define set-render-vsync
|
||||
(foreign-lambda bool "SDL_SetRenderVSync"
|
||||
|
@ -345,7 +340,7 @@
|
|||
(enum "SDL_ScaleMode")))
|
||||
|
||||
(define unlock-texture
|
||||
(foreign-lambda bool "SDL_UnlockTexture" (c-pointer (struct "SDL_Texture"))))
|
||||
(foreign-lambda void "SDL_UnlockTexture" (c-pointer (struct "SDL_Texture"))))
|
||||
|
||||
;; TODO: SDL_UpdateNVTexture
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
(import (scheme)
|
||||
(chicken base)
|
||||
(chicken foreign))
|
||||
(import-for-syntax (sdl3 internal utilities))
|
||||
(import-syntax (sdl3 internal utilities))
|
||||
|
||||
(foreign-declare "#include <SDL3/SDL_video.h>")
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
|||
(define-foreign-type SDL_EGLAttribArrayCallback
|
||||
(function SDL_EGLAttrib () "SDLCALL"))
|
||||
(define-foreign-type SDL_EGLDisplay c-pointer)
|
||||
(define-foreign-type SDL_GLContext (struct "SDL_GLContext"))
|
||||
(define-foreign-type SDL_GLContext (c-pointer (struct "SDL_GLContextState")))
|
||||
(define-foreign-type SDL_HitTest
|
||||
(function SDL_HitTestResult ((c-pointer SDL_Window) (c-pointer SDL_Point) c-pointer)))
|
||||
(define-foreign-type SDL_Window (struct "SDL_Window"))
|
||||
|
@ -24,96 +24,83 @@
|
|||
(define-foreign-type SDL_DisplayOrientation (enum "SDL_DisplayOrientation"))
|
||||
(define-sdl-const-values
|
||||
orientation SDL_DisplayOrientation
|
||||
(unknown landscape landscape-flipped portrait portrait-flipped))
|
||||
unknown landscape landscape-flipped portrait portrait-flipped)
|
||||
|
||||
(define-foreign-type SDL_FlashOperation (enum "SDL_FlashOperation"))
|
||||
(define-sdl-const-values
|
||||
flash SDL_FlashOperation
|
||||
(cancel briefly until-focused))
|
||||
cancel briefly until-focused)
|
||||
|
||||
(define-foreign-type SDL_GLattr (enum "SDL_GLattr"))
|
||||
(define-sdl-const-values
|
||||
(gl SDL_GLattr
|
||||
red-size green-size blue-size alpha-size buffer-size doublebuffer depth-size
|
||||
stencil-size accum-red-size accum-green-size accum-blue-size accum-alpha-size
|
||||
stereo multisamplebuffers multisamplesamples accelerated-visual retained-backing
|
||||
context-major-version context-minor-version context-flags context-profile-mask
|
||||
share-with-current-context framebuffer-srgb-capable context-release-behavior
|
||||
context-reset-notification context-no-error floatbuffers egl-platform))
|
||||
gl SDL_GLattr
|
||||
red-size green-size blue-size alpha-size buffer-size doublebuffer depth-size
|
||||
stencil-size accum-red-size accum-green-size accum-blue-size accum-alpha-size
|
||||
stereo multisamplebuffers multisamplesamples accelerated-visual retained-backing
|
||||
context-major-version context-minor-version context-flags context-profile-mask
|
||||
share-with-current-context framebuffer-srgb-capable context-release-behavior
|
||||
context-reset-notification context-no-error floatbuffers egl-platform)
|
||||
|
||||
(define-foreign-type SDL_GLcontextFlag (enum "SDL_GLcontextFlag"))
|
||||
(define-sdl-const-values
|
||||
gl-context SDL_GLcontextFlag
|
||||
(debug-flag forward-compatible-flag robust-access-flag reset-isolation-flag))
|
||||
debug-flag forward-compatible-flag robust-access-flag reset-isolation-flag)
|
||||
|
||||
(define-foreign-type SDL_GLcontextReleaseFlag (enum "SDL_GLcontextReleaseFlag"))
|
||||
(define-sdl-const-values
|
||||
gl-context-release-behavior SDL_GLcontestReleaseFlag
|
||||
(none flush))
|
||||
gl-context-release-behavior SDL_GLcontextReleaseFlag
|
||||
none flush)
|
||||
|
||||
(define-foreign-type SDL_GLContextResetNotification (enum "SDL_GLContextResetNotification"))
|
||||
(define-sdl-const-values
|
||||
gl-context-reset SDL_GLContextResetNotification
|
||||
(no-notification lose-context))
|
||||
no-notification lose-context)
|
||||
|
||||
(define-foreign-type SDL_GLprofile (enum "SDL_GLprofile"))
|
||||
(define-sdl-const-values
|
||||
gl-context-profile SDL_GLprofile
|
||||
(core compatibility es))
|
||||
core compatibility es)
|
||||
|
||||
(define-foreign-type SDL_HitTestResult (enum "SDL_HitTestResult"))
|
||||
(define-sdl-const-values
|
||||
hittest SDL_HitTestResult
|
||||
(normal draggable resize-topleft resize-top resize-topright resize-right
|
||||
resize-bottomright resize-bottom resize-bottomleft resize-left))
|
||||
normal draggable resize-topleft resize-top resize-topright resize-right
|
||||
resize-bottomright resize-bottom resize-bottomleft resize-left)
|
||||
|
||||
(define-foreign-type SDL_SystemTheme (enum "SDL_SystemTheme"))
|
||||
(define-sdl-const-values
|
||||
system-theme SDL_SystemTheme
|
||||
(unknown light dark))
|
||||
unknown light dark)
|
||||
|
||||
(define-foreign-type SDL_WindowFlags unsigned-int64)
|
||||
(define-foreign-type SDL_WindowFlags unsigned-integer64)
|
||||
(define-sdl-const-values
|
||||
window SDL_WindowFlags
|
||||
(fullscreen opengl occluded hidden borderless resizable minimized maximized
|
||||
mouse-grabbed input-focus mouse-focus external modal high-pixel-density
|
||||
mouse-capture mouse-relative-mode always-on-top utility tooltip popup-menu
|
||||
keyboard-grabbed vulkan metal transparent not-focusable))
|
||||
fullscreen opengl occluded hidden borderless resizable minimized maximized
|
||||
mouse-grabbed input-focus mouse-focus external modal high-pixel-density
|
||||
mouse-capture mouse-relative-mode always-on-top utility tooltip popup-menu
|
||||
keyboard-grabbed vulkan metal transparent not-focusable)
|
||||
|
||||
;; These are weird string properties for CreateWindowWithProperties
|
||||
(define-sdl-const-values
|
||||
prop-window-create c-string
|
||||
(always-on-top-boolean borderless-boolean external-graphics-context-boolean
|
||||
focusable-boolean fullscreen-boolean height-number hidden-boolean
|
||||
high-pixel-density-boolean maximized-boolean menu-boolean
|
||||
metal-boolean minimized-boolean modal-boolean
|
||||
mouse-grabbed-boolean opengl-boolean parent-pointer
|
||||
resizable-boolean title-string transparent-boolean tooltip-boolean
|
||||
utility-boolean vulkan-boolean width-number x-number y-number
|
||||
cocoa-window-pointer cocoa-view-pointer
|
||||
wayland-surface-role-custom-boolean
|
||||
wayland-create-egl-window-boolean wayland-wl-surface-pointer
|
||||
win32-hwnd-pointer win32-pixel-format-hwnd-pointer
|
||||
x11-window-number))
|
||||
|
||||
(define-sdl-const-values
|
||||
pixelformat unsigned-int32
|
||||
(unknown index1lsb index1msb index2lsb index2msb index4lsb index4msb index8 rgb332
|
||||
xrgb4444 xbgr4444 xrgb1555 xbgr1555 argb4444 rgba4444 abgr4444 bgra4444 argb1555
|
||||
rgba5551 abgr1555 bgra5551 rgb565 bgr565 rgb24 bgr24 xrgb8888 rgbx8888
|
||||
pixelformat-xbgr8888 pbgrx8888 pargb8888 prgba8888 pabgr8888 pbgra8888
|
||||
pxrgb2101010 pxbgr2101010 pargb2101010 pabgr2101010 prgb48 pbgr48 prgba64
|
||||
pargb64 pbgra64 pabgr64 prgb48-float pbgr48-float prgba64-float pargb64-float
|
||||
pbgra64-float pabgr64-float prgb96-float pbgr96-float prgba128-float
|
||||
pargb128-float pbgra128-float pabgr128-float pyv12 piyuv pyuy2 puyvy pyvyu pnv12
|
||||
pnv21 pp010 external-oes rgba32 argb32 bgra32 abgr32 rgbx32 xrgb32 bgrx32
|
||||
xbgr32))
|
||||
always-on-top-boolean borderless-boolean external-graphics-context-boolean
|
||||
focusable-boolean fullscreen-boolean height-number hidden-boolean
|
||||
high-pixel-density-boolean maximized-boolean menu-boolean
|
||||
metal-boolean minimized-boolean modal-boolean
|
||||
mouse-grabbed-boolean opengl-boolean parent-pointer
|
||||
resizable-boolean title-string transparent-boolean tooltip-boolean
|
||||
utility-boolean vulkan-boolean width-number x-number y-number
|
||||
cocoa-window-pointer cocoa-view-pointer
|
||||
wayland-surface-role-custom-boolean
|
||||
wayland-create-egl-window-boolean wayland-wl-surface-pointer
|
||||
win32-hwnd-pointer win32-pixel-format-hwnd-pointer
|
||||
x11-window-number)
|
||||
|
||||
;;; Procedures
|
||||
|
||||
(define (create-popup-window parent offset-x offset-y w h #!rest flags)
|
||||
((foreign-lambda (c-pointer SDL_Window) "SDL_CreatePopupWindow"
|
||||
(struct SDL_Window) int int int int unsigned-int64)
|
||||
(c-pointer SDL_Window) integer integer integer integer unsigned-integer64)
|
||||
parent offset-x offset-y w h (foldl-uint-flags flags)))
|
||||
|
||||
(define (create-window title w h #!rest flags)
|
||||
|
@ -124,7 +111,7 @@
|
|||
;; TODO: SDL_CreateWindowWithProperties
|
||||
|
||||
(define destroy-window
|
||||
(call-c void SDL_DestroyWindow ((c-pointer SDL_Window))))
|
||||
(foreign-lambda void "SDL_DestroyWindow" (c-pointer SDL_Window)))
|
||||
|
||||
(define destroy-window-surface
|
||||
(foreign-lambda bool "SDL_DestroyWindowSurface" (c-pointer SDL_Window)))
|
||||
|
@ -157,7 +144,7 @@
|
|||
SDL_DisplayID int int float bool (c-pointer SDL_DisplayMode)))
|
||||
|
||||
(define get-current-display-mode
|
||||
(foreign-lambda (c-pointer SDL_DisplayMode) "SDL_DisplayMode" SDL_DisplayID))
|
||||
(foreign-lambda (c-pointer SDL_DisplayMode) "SDL_GetCurrentDisplayMode" SDL_DisplayID))
|
||||
|
||||
(define get-current-display-orientation
|
||||
(foreign-lambda SDL_DisplayOrientation "SDL_GetCurrentDisplayOrientation"
|
||||
|
@ -207,17 +194,14 @@
|
|||
(foreign-lambda (c-pointer (struct "SDL_Window")) "SDL_GetGrabbedWindow"))
|
||||
|
||||
(define get-natural-display-orientation
|
||||
(foreign-lambda (enum "SDL_DisplayOrientation" unsigned-int32)))
|
||||
(foreign-lambda (enum "SDL_DisplayOrientation")
|
||||
"SDL_GetNaturalDisplayOrientation" unsigned-int32))
|
||||
|
||||
(define get-num-video-drivers
|
||||
(foreign-lambda int "SDL_GetNumVideoDrivers"))
|
||||
|
||||
(define get-primary-display
|
||||
(foreign-lambda unsigned-int22 "SDL_GetPrimaryDisplay"))
|
||||
|
||||
(define-sdl-const-values
|
||||
system-theme int
|
||||
(unknown light dark))
|
||||
(foreign-lambda unsigned-int32 "SDL_GetPrimaryDisplay"))
|
||||
|
||||
(define get-system-theme
|
||||
(foreign-lambda (enum "SDL_SystemTheme") "SDL_GetSystemTheme"))
|
||||
|
@ -233,7 +217,7 @@
|
|||
(foreign-lambda float "SDL_GetWindowDisplayScale" (c-pointer (struct "SDL_Window"))))
|
||||
|
||||
(define get-window-flags
|
||||
(foreign-lambda unsigned-int32 "SDL_GetWindowFlags" (c-pointer (c-struct "SDL_Window"))))
|
||||
(foreign-lambda unsigned-int32 "SDL_GetWindowFlags" (c-pointer (struct "SDL_Window"))))
|
||||
|
||||
(define get-window-from-id
|
||||
(foreign-lambda (c-pointer (struct "SDL_Window")) "SDL_GetWindowFromID" unsigned-int32))
|
||||
|
@ -248,7 +232,7 @@
|
|||
(foreign-lambda unsigned-int32 "SDL_GetWindowID" (c-pointer (struct "SDL_Window"))))
|
||||
|
||||
(define get-window-keyboard-grab
|
||||
(foreign-lambda bool "SDL_GetWindowKeywordGrab" (c-pointer (struct "SDL_Window"))))
|
||||
(foreign-lambda bool "SDL_GetWindowKeyboardGrab" (c-pointer (struct "SDL_Window"))))
|
||||
|
||||
;; TODO: SDL_GetWindowMaximumSize
|
||||
|
||||
|
@ -299,11 +283,11 @@
|
|||
(foreign-lambda c-string "SDL_GetWindowTitle" (c-pointer (struct "SDL_Window"))))
|
||||
|
||||
(define gl-create-context
|
||||
(foreign-lambda (struct "SDL_GLContext") "SDL_GL_CreateContext"
|
||||
(foreign-lambda (c-pointer (struct "SDL_GLContextState")) "SDL_GL_CreateContext"
|
||||
(c-pointer (struct "SDL_Window"))))
|
||||
|
||||
(define gl-destroy-context
|
||||
(foreign-lambda bool "SDL_GL_DestroyContext" (struct "SDL_GLContext")))
|
||||
(foreign-lambda bool "SDL_GL_DestroyContext" (c-pointer (struct "SDL_GLContextState"))))
|
||||
|
||||
(define gl-extension-supported
|
||||
(foreign-lambda bool "SDL_GL_ExtensionSupported" c-string))
|
||||
|
@ -311,7 +295,7 @@
|
|||
;; TODO: SDL_GL_GetAttribute
|
||||
|
||||
(define gl-get-current-context
|
||||
(foreign-lambda (struct "SDL_GLContext") "SDL_GL_GetCurrentContext"))
|
||||
(foreign-lambda (c-pointer (struct "SDL_GLContextState")) "SDL_GL_GetCurrentContext"))
|
||||
|
||||
(define gl-get-current-window
|
||||
(foreign-lambda (c-pointer (struct "SDL_Window")) "SDL_GL_GetCurrentWindow"))
|
||||
|
@ -326,7 +310,7 @@
|
|||
|
||||
(define gl-make-current
|
||||
(foreign-lambda bool "SDL_GL_MakeCurrent"
|
||||
(c-pointer (struct "SDL_Window")) (struct "SDL_GLContext")))
|
||||
(c-pointer (struct "SDL_Window")) (c-pointer (struct "SDL_GLContextState"))))
|
||||
|
||||
(define gl-reset-attributes
|
||||
(foreign-lambda void "SDL_GL_ResetAttributes"))
|
||||
|
@ -404,10 +388,10 @@
|
|||
(define set-window-modal
|
||||
(foreign-lambda bool "SDL_SetWindowModal" (c-pointer (struct "SDL_Window")) bool))
|
||||
|
||||
(define set-window-modal-for
|
||||
(foreign-lambda bool "SDL_SetWindowModalFor"
|
||||
(c-pointer (struct "SDL_Window"))
|
||||
(c-pointer (struct "SDL_Window"))))
|
||||
;; (define set-window-modal-for
|
||||
;; (foreign-lambda bool "SDL_SetWindowModalFor"
|
||||
;; (c-pointer (struct "SDL_Window"))
|
||||
;; (c-pointer (struct "SDL_Window"))))
|
||||
|
||||
(define set-window-mouse-grab
|
||||
(foreign-lambda bool "SDL_SetWindowMouseGrab"
|
||||
|
|
6
sdl3.blendmode.scm
Normal file
6
sdl3.blendmode.scm
Normal file
|
@ -0,0 +1,6 @@
|
|||
(define-library (sdl3 blendmode)
|
||||
(export)
|
||||
(import (scheme)
|
||||
(chicken base))
|
||||
(begin
|
||||
(include-relative "lib/sdl3-blendmode-impl.scm")))
|
13
sdl3.egg
13
sdl3.egg
|
@ -4,17 +4,24 @@
|
|||
(category ui)
|
||||
(license "MIT")
|
||||
(version "0.1")
|
||||
(dependencies)
|
||||
(dependencies format srfi-152)
|
||||
(test-dependencies)
|
||||
|
||||
(components
|
||||
(extension sdl3.internal.utilities)
|
||||
(extension sdl3.features)
|
||||
(extension sdl3.features (custom-build "build-sdl3"))
|
||||
(extension sdl3.pixels (custom-build "build-sdl3")
|
||||
(component-dependencies sdl3.internal.utilities))
|
||||
(extension sdl3.blendmode (custom-build "build-sdl3")
|
||||
(component-dependencies sdl3.internal.utilities))
|
||||
(extension sdl3.init (custom-build "build-sdl3")
|
||||
(component-dependencies sdl3.internal.utilities))
|
||||
(extension sdl3.main (custom-build "build-sdl3")
|
||||
(component-dependencies sdl3.internal.utilities))
|
||||
(extension sdl3.events (custom-build "build-sdl3")
|
||||
(component-dependencies sdl3.internal.utilities))
|
||||
(extension sdl3.video (custom-build "build-sdl3")
|
||||
(component-dependencies sdl3.internal.utilities))
|
||||
(extension sdl3.render (custom-build "build-sdl3")
|
||||
(component-dependencies sdl3.internal.utilities))))
|
||||
(component-dependencies sdl3.internal.utilities
|
||||
sdl3.events))))
|
||||
|
|
6
sdl3.events.scm
Normal file
6
sdl3.events.scm
Normal file
|
@ -0,0 +1,6 @@
|
|||
(define-library (sdl3 events)
|
||||
(export)
|
||||
(import (scheme)
|
||||
(chicken base))
|
||||
(begin
|
||||
(include-relative "lib/sdl3-events-impl.scm")))
|
|
@ -1,5 +1,5 @@
|
|||
(module (sdl3 features)
|
||||
()
|
||||
(define-library (sdl3 features)
|
||||
(export)
|
||||
(import (scheme)
|
||||
(chicken base)
|
||||
(chicken foreign)
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
(module (sdl3 init)
|
||||
(SDL_InitFlags
|
||||
SDL_AppResult
|
||||
|
||||
init
|
||||
init-sub-system
|
||||
quit
|
||||
quit-sub-system
|
||||
set-app-metadata
|
||||
set-app-metadata-property
|
||||
get-app-metadata-property
|
||||
was-init)
|
||||
(define-library (sdl3 init)
|
||||
(export init
|
||||
init-sub-system
|
||||
quit
|
||||
quit-sub-system
|
||||
set-app-metadata
|
||||
set-app-metadata-property
|
||||
get-app-metadata-property
|
||||
was-init)
|
||||
(import (scheme)
|
||||
(chicken base))
|
||||
(begin
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
(module (sdl3 internal utilities)
|
||||
(define-sdl-flag
|
||||
define-sdl-enum-values
|
||||
call-c)
|
||||
(define-library (sdl3 internal utilities)
|
||||
(export foldl-uint-flags
|
||||
define-sdl-const-values
|
||||
call-c)
|
||||
(import (scheme)
|
||||
(chicken base))
|
||||
(begin
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
(module (sdl3 main)
|
||||
()
|
||||
(define-library (sdl3 main)
|
||||
(export)
|
||||
(import (scheme)
|
||||
(chicken base))
|
||||
(begin
|
||||
|
|
6
sdl3.pixels.scm
Normal file
6
sdl3.pixels.scm
Normal file
|
@ -0,0 +1,6 @@
|
|||
(define-library (sdl3 pixels)
|
||||
(export)
|
||||
(import (scheme)
|
||||
(chicken base))
|
||||
(begin
|
||||
(include-relative "lib/sdl3-pixels-impl.scm")))
|
|
@ -1,5 +1,5 @@
|
|||
(module (sdl3 render)
|
||||
()
|
||||
(define-library (sdl3 render)
|
||||
(export)
|
||||
(import (scheme)
|
||||
(chicken base))
|
||||
(begin
|
||||
|
|
222
sdl3.video.scm
222
sdl3.video.scm
|
@ -1,114 +1,114 @@
|
|||
(module (sdl3 video)
|
||||
(create-popup-window
|
||||
create-window
|
||||
create-window-with-properties
|
||||
destroy-window
|
||||
destroy-window-surface
|
||||
disable-screen-saver
|
||||
egl-get-current-config
|
||||
egl-get-current-display
|
||||
egl-get-proc-address
|
||||
egl-get-window-surface
|
||||
enable-screen-saver
|
||||
flash-window
|
||||
get-closest-fullscreen-display-mode
|
||||
get-current-display-mode
|
||||
get-current-display-orientation
|
||||
get-current-video-driver
|
||||
get-desktop-display-mode
|
||||
get-display-bounds
|
||||
get-display-content-scale
|
||||
get-display-for-point
|
||||
get-display-for-rect
|
||||
get-display-for-window
|
||||
get-display-name
|
||||
get-display-properties
|
||||
;; get-displays
|
||||
get-display-usable-bounds
|
||||
;; get-fullscreen-display-modes
|
||||
get-grabbed-window
|
||||
get-natural-display-orientation
|
||||
get-num-video-drivers
|
||||
get-primary-display
|
||||
get-system-theme
|
||||
get-video-driver
|
||||
;; get-window-aspect-ratio
|
||||
;; get-window-borders-size
|
||||
get-window-display-scale
|
||||
get-window-flags
|
||||
get-window-from-id
|
||||
get-window-fullscreen-mode
|
||||
;; get-window-icc-profile
|
||||
get-window-id
|
||||
get-window-keyboard-grab
|
||||
;; get-window-maximum-size
|
||||
;; get-window-minumum-size
|
||||
get-window-mouse-grab
|
||||
get-window-mouse-rect
|
||||
get-window-opacity
|
||||
get-window-parent
|
||||
get-window-pixel-density
|
||||
get-window-pixel-format
|
||||
;; get-window-position
|
||||
get-window-properties
|
||||
;; get-windows
|
||||
;; get-window-safe-area
|
||||
;; get-window-size
|
||||
;; get-window-size-in-pixels
|
||||
get-window-surface
|
||||
;; get-window-surface-vsync
|
||||
get-window-title
|
||||
gl-create-context
|
||||
gl-destroy-context
|
||||
gl-extension-supported
|
||||
;; gl-get-attribute
|
||||
gl-get-current-context
|
||||
gl-get-current-window
|
||||
gl-get-proc-address
|
||||
;; gl-get-swap-interval
|
||||
gl-load-library
|
||||
gl-make-current
|
||||
gl-reset-attributes
|
||||
gl-set-attribute
|
||||
gl-set-swap-interval
|
||||
gl-swap-window
|
||||
gl-unload-library
|
||||
hide-window
|
||||
maximize-window
|
||||
minimize-window
|
||||
raise-window
|
||||
restore-window
|
||||
screen-saver-enabled
|
||||
set-window-always-on-top
|
||||
set-window-aspect-ratio
|
||||
set-window-bordered
|
||||
set-window-focusable
|
||||
set-window-fullscreen
|
||||
set-window-fullscreen-mode
|
||||
;; set-window-hit-test
|
||||
set-window-icon
|
||||
set-window-keyboard-grab
|
||||
set-window-maximum-size
|
||||
set-window-minimum-size
|
||||
set-window-modal
|
||||
set-window-modal-for
|
||||
set-window-mouse-grab
|
||||
set-window-mouse-rect
|
||||
set-window-opacity
|
||||
set-window-parent
|
||||
set-window-position
|
||||
set-window-resizable
|
||||
set-window-shape
|
||||
set-window-size
|
||||
set-window-surface-vsync
|
||||
set-window-title
|
||||
show-window
|
||||
show-window-system-menu
|
||||
sync-window
|
||||
update-window-surface
|
||||
;; update-window-surface-rects
|
||||
window-has-surface
|
||||
)
|
||||
(define-library (sdl3 video)
|
||||
(export create-popup-window
|
||||
create-window
|
||||
;; create-window-with-properties
|
||||
destroy-window
|
||||
destroy-window-surface
|
||||
disable-screen-saver
|
||||
egl-get-current-config
|
||||
egl-get-current-display
|
||||
egl-get-proc-address
|
||||
egl-get-window-surface
|
||||
enable-screen-saver
|
||||
flash-window
|
||||
get-closest-fullscreen-display-mode
|
||||
get-current-display-mode
|
||||
get-current-display-orientation
|
||||
get-current-video-driver
|
||||
get-desktop-display-mode
|
||||
get-display-bounds
|
||||
get-display-content-scale
|
||||
get-display-for-point
|
||||
get-display-for-rect
|
||||
get-display-for-window
|
||||
get-display-name
|
||||
get-display-properties
|
||||
;; get-displays
|
||||
get-display-usable-bounds
|
||||
;; get-fullscreen-display-modes
|
||||
get-grabbed-window
|
||||
get-natural-display-orientation
|
||||
get-num-video-drivers
|
||||
get-primary-display
|
||||
get-system-theme
|
||||
get-video-driver
|
||||
;; get-window-aspect-ratio
|
||||
;; get-window-borders-size
|
||||
get-window-display-scale
|
||||
get-window-flags
|
||||
get-window-from-id
|
||||
get-window-fullscreen-mode
|
||||
;; get-window-icc-profile
|
||||
get-window-id
|
||||
get-window-keyboard-grab
|
||||
;; get-window-maximum-size
|
||||
;; get-window-minumum-size
|
||||
get-window-mouse-grab
|
||||
get-window-mouse-rect
|
||||
get-window-opacity
|
||||
get-window-parent
|
||||
get-window-pixel-density
|
||||
get-window-pixel-format
|
||||
;; get-window-position
|
||||
get-window-properties
|
||||
;; get-windows
|
||||
;; get-window-safe-area
|
||||
;; get-window-size
|
||||
;; get-window-size-in-pixels
|
||||
get-window-surface
|
||||
;; get-window-surface-vsync
|
||||
get-window-title
|
||||
gl-create-context
|
||||
gl-destroy-context
|
||||
gl-extension-supported
|
||||
;; gl-get-attribute
|
||||
gl-get-current-context
|
||||
gl-get-current-window
|
||||
gl-get-proc-address
|
||||
;; gl-get-swap-interval
|
||||
gl-load-library
|
||||
gl-make-current
|
||||
gl-reset-attributes
|
||||
gl-set-attribute
|
||||
gl-set-swap-interval
|
||||
gl-swap-window
|
||||
gl-unload-library
|
||||
hide-window
|
||||
maximize-window
|
||||
minimize-window
|
||||
raise-window
|
||||
restore-window
|
||||
screen-saver-enabled
|
||||
set-window-always-on-top
|
||||
set-window-aspect-ratio
|
||||
set-window-bordered
|
||||
set-window-focusable
|
||||
set-window-fullscreen
|
||||
set-window-fullscreen-mode
|
||||
;; set-window-hit-test
|
||||
set-window-icon
|
||||
set-window-keyboard-grab
|
||||
set-window-maximum-size
|
||||
set-window-minimum-size
|
||||
set-window-modal
|
||||
;; set-window-modal-for
|
||||
set-window-mouse-grab
|
||||
set-window-mouse-rect
|
||||
set-window-opacity
|
||||
set-window-parent
|
||||
set-window-position
|
||||
set-window-resizable
|
||||
set-window-shape
|
||||
set-window-size
|
||||
set-window-surface-vsync
|
||||
set-window-title
|
||||
show-window
|
||||
show-window-system-menu
|
||||
sync-window
|
||||
update-window-surface
|
||||
;; update-window-surface-rects
|
||||
window-has-surface
|
||||
)
|
||||
(import (scheme)
|
||||
(chicken base))
|
||||
(begin
|
||||
|
|
|
@ -32,9 +32,9 @@ mkShell {
|
|||
;
|
||||
shellHook = ''
|
||||
export CC="${pkgs.tcc-mob}/bin/tcc"
|
||||
export CHICKEN_PREFIX="$(pwd)/.chicken"
|
||||
export CHICKEN_INSTALL_REPOSITORY="$(pwd)/.chicken/eggs"
|
||||
export CHICKEN_REPOSITORY_PATH="${pkgs.chicken}/lib/chicken/12:$(pwd)/.chicken/eggs"
|
||||
export CHICKEN_PREFIX="$HOME/.chicken"
|
||||
export CHICKEN_INSTALL_REPOSITORY="$HOME/.chicken/eggs"
|
||||
export CHICKEN_REPOSITORY_PATH="${pkgs.chicken}/lib/chicken/12:$HOME/.chicken/eggs"
|
||||
export PATH="$PATH:$CHICKEN_PREFIX"
|
||||
# chicken-install lsp-server salmonella
|
||||
export CHICKEN_PREFIX="${pkgs.chicken}"
|
||||
|
|
Loading…
Reference in a new issue