Page 1 of 1

SDL constants in Linux

Posted: Fri Dec 15, 2023 8:17 am
by coco2
Why are constants like #SDL_JOYAXISMOTION available by default in Linux but not Windows? Searching for this did not find anything. Is this documented anywhere? How do I handle these constants in Windows and Linux, since Windows needs different values to the ones prepopulated in Linux?

Re: SDL constants in Linux

Posted: Fri Dec 15, 2023 12:24 pm
by mk-soft
The Window OS constants are defined for Windows. SDL is not standard for windows and Fred cannot consider all external labraries.
You have to look for the correct constant values for the corresponding OS from the c-header files. (Or with Google)

To define the constants with different OS there are the compiler directives.

Code: Select all

; Define Konstantants

CompilerSelect #PB_Compiler_OS
  CompilerCase #PB_OS_Windows
    #SDL_JOYAXISMOTION = ???
    
  CompilerCase #PB_OS_Linux
    ;
  CompilerCase #PB_OS_MacOS
    ;
CompilerEndSelect

Re: SDL constants in Linux

Posted: Tue Dec 19, 2023 1:16 am
by coco2
I think SDL is not consistent in PB, some constants are missing and other aren't. I coded it so that it would fill in all the missing values and it finally compiled, however I can't get it to run. SDL_INIT() is giving an invalid memory address.