SDL constants in Linux

Linux specific forum
coco2
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

SDL constants in Linux

Post 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?
User avatar
mk-soft
Always Here
Always Here
Posts: 6245
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: SDL constants in Linux

Post 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
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
coco2
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Re: SDL constants in Linux

Post 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.
Post Reply