racket-sdl icon indicating copy to clipboard operation
racket-sdl copied to clipboard

FFI of SDL_CreateWindow missing _SDL_WindowFlags

Open juszczakn opened this issue 7 years ago • 1 comments

I'm new to racket and it's FFI, however it seems that this would be the correct FFI binding for SDL_CreateWindow:

(define-sdl SDL_CreateWindow (_fun _string _int _int _int _int _SDL_WindowFlags -> _SDL_Window))

and that this would be a more correct definition of _SDL_WindowFlags:

(define _SDL_WindowFlags
  (_bitmask
   `(SDL_WINDOW_FULLSCREEN = #x00000001;        /**< fullscreen window */
    SDL_WINDOW_OPENGL = #x00000002     ;        /**< window usable with OpenGL context */
    SDL_WINDOW_SHOWN = #x00000004      ;        /**< window is visible */
    SDL_WINDOW_HIDDEN = #x00000008     ;        /**< window is not visible */
    SDL_WINDOW_BORDERLESS = #x00000010 ;        /**< no window decoration */
    SDL_WINDOW_RESIZABLE = #x00000020  ;        /**< window can be resized */
    SDL_WINDOW_MINIMIZED = #x00000040  ;        /**< window is minimized */
    SDL_WINDOW_MAXIMIZED = #x00000080  ;        /**< window is maximized */
    SDL_WINDOW_INPUT_GRABBED = #x00000100;      /**< window has grabbed input focus */
    SDL_WINDOW_INPUT_FOCUS = #x00000200;        /**< window has input focus */
    SDL_WINDOW_MOUSE_FOCUS = #x00000400;        /**< window has mouse focus */
    SDL_WINDOW_FULLSCREEN_DESKTOP = ,(bitwise-ior #x00000001 #x00001000 )
    SDL_WINDOW_FOREIGN = #x00000800)
    _uint32))

According to http://docs.racket-lang.org/foreign/Enumerations_and_Masks.html bitmasks default to uint instead of uint32.

juszczakn avatar Jul 26 '17 00:07 juszczakn

I'm going to keep mucking about with sdl, following some tutorials. I'll see if anything else pops up and send a PR.

juszczakn avatar Jul 26 '17 01:07 juszczakn