# Question regarding porting games to FreeBSD



## bushido95 (Mar 6, 2017)

Hi friends, I'll just preface by saying that I am fairly new to FreeBSD. Thus far i have really been enjoying it. I'm an indie games developer and I'm wanting to port my projects over to FreeBSD. Are there any well known 2D Game Libraries on FreeBSD? I know SDL2 works on Windows and Linux but how would i use something like SDL2 to port my games over to FreeBSD?  Would this work natively? Or would I have to enable the linux compatibility?  Thanks in advance


----------



## drhowarddrfine (Mar 6, 2017)

http://www.freshports.org/search.ph...leted&start=1&casesensitivity=caseinsensitive


----------



## SirDice (Mar 6, 2017)

devel/sdl12 and devel/sdl20.



bushido95 said:


> I know SDL2 works on Windows and Linux but how would I use something like SDL2 to port my games over to FreeBSD?


The same way as on Windows or Linux. Why would it be different?


> Would this work natively?


Yes.


> Or would I have to enable the linux compatibility?


No.


----------



## bushido95 (Mar 6, 2017)

SirDice said:


> devel/sdl12 and devel/sdl20.
> 
> 
> The same way as on Windows or Linux. Why would it be different?
> ...



I'm new to FreeBSD.... So I didn't know if things were any different. You were a green user too at some point


----------



## monwarez (Mar 19, 2017)

I would add, as long as you don't use 

```
if(SDL_Init(SDL_INIT_EVERYTHING) != 0)
{
    // run the game
}
else
    return ; // quit the game
```
But instead use 

```
SDL_Init(),SDL_InitSubSystem()
```
Since haptic support(force feedback) is not yet ported (on devel/sdl20 , for the other I didn't test)


----------



## bushido95 (Mar 22, 2017)

monwarez said:


> I would add, as long as you don't use
> 
> ```
> if(SDL_Init(SDL_INIT_EVERYTHING) != 0)
> ...



Okay Thanks for the suggestion. I'll keep that in mind


----------

