Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML works on FreeBSD very good  (Read 9192 times)

0 Members and 2 Guests are viewing this topic.

ccbsd

  • Newbie
  • *
  • Posts: 14
    • View Profile
SFML works on FreeBSD very good
« on: September 14, 2011, 04:21:31 pm »
Edit: I am sorry for this edit. SFML works on FreeBSD very good after years.

When I compile SFML 2.0 in my FreeBSD 8.2 with cmake:
Code: [Select]
CMake Warning at cmake/Config.cmake:20 (message):
   Unsupported operating system
 Call Stack (most recent call first):
   CMakeLists.txt:14 (include)



 CMake Error at CMakeLists.txt:190 (install):
   install FILES given no DESTINATION!

Part of the cmake/Config.cmake file:
Code: [Select]
# detect the OS
 if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
     set(WINDOWS 1)
 elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     set(LINUX 1)
 elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     set(MACOSX 1)

Do you really don't want SFML to support FreeBSD?

Edit: I am sorry for this edit. SFML can be built on FreeBSD without suspense. It just run better. SFML works on FreeBSD very good after years.

cmake/Config.cmake
     19 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
     20     set(SFML_OS_UNIX 1)
     21     if(ANDROID)
     22         set(SFML_OS_ANDROID 1)
     23         # use the OpenGL ES implementation on Android
     24         set(OPENGL_ES 1)
     25     else()
     26         set(SFML_OS_LINUX 1)
     27         # don't use the OpenGL ES implementation on Linux
     28         set(OPENGL_ES 0)
     29     endif()
     30 elseif(CMAKE_SYSTEM_NAME MATCHES "^k?FreeBSD$")
     31     set(SFML_OS_FREEBSD 1)
     32     # don't use the OpenGL ES implementation on FreeBSD
     33     set(OPENGL_ES 0)
 

And I wish more other BSD supports. Bitrig, NetBSD, OpenBSD, ...
« Last Edit: September 07, 2016, 07:47:27 pm by ccbsd »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FreeBSD is an Unsupported operating system?
« Reply #1 on: September 14, 2011, 05:00:43 pm »
In fact SFML supports FreeBSD, it's just the CMake file which is incomplete.
Laurent Gomila - SFML developer

ccbsd

  • Newbie
  • *
  • Posts: 14
    • View Profile
FreeBSD is an Unsupported operating system?
« Reply #2 on: September 14, 2011, 05:07:02 pm »
Quote from: "Laurent"
In fact SFML supports FreeBSD, it's just the CMake file which is incomplete.


I see, thank you.

ccbsd

  • Newbie
  • *
  • Posts: 14
    • View Profile
FreeBSD is an Unsupported operating system?
« Reply #3 on: September 14, 2011, 05:52:57 pm »
but I don't know how to modify the cmake files.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FreeBSD is an Unsupported operating system?
« Reply #4 on: September 14, 2011, 05:59:34 pm »
You don't have to, it's already fixed.

It was not tested so... I hope it really works :)
Laurent Gomila - SFML developer

ccbsd

  • Newbie
  • *
  • Posts: 14
    • View Profile
FreeBSD is an Unsupported operating system?
« Reply #5 on: September 15, 2011, 02:44:19 pm »
I downloaded LaurentGomila-SFML-bindings_removed-98-g78a625d.tar.gz just now and build it. I still failed to build it.
Code: [Select]

 elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
     # FreeBSD compile path is the same as Linux
     set(LINUX 1)

FreeBSD is not Linux.




Code: [Select]

LaurentGomila-SFML-a647c68/src/SFML/Window/Linux/JoystickImpl.cpp:55: error: 'O_RDONLY' was not declared in this scope
LaurentGomila-SFML-a647c68/src/SFML/Window/Linux/JoystickImpl.cpp:55: error: 'open' was not declared in this scope

So I add #include <fcntl.h> into src/SFML/Window/Linux/JoystickImpl.cpp



Code: [Select]

LaurentGomila-SFML-a647c68/src/SFML/Window/Linux/JoystickImpl.cpp:63: error: 'ioctl' was not declared in this scope

So I ad #include <sys/ioctl.h> into src/SFML/Window/Linux/JoystickImpl.cpp



Code: [Select]

LaurentGomila-SFML-a647c68/src/SFML/Window/Linux/JoystickImpl.cpp:64: error: 'JSIOCGAXMAP' was not declared in this scope
LaurentGomila-SFML-a647c68/src/SFML/Window/Linux/JoystickImpl.cpp:92: error: 'JSIOCGBUTTONS' was not declared in this scope
LaurentGomila-SFML-a647c68/src/SFML/Window/Linux/JoystickImpl.cpp:99: error: 'JSIOCGAXES' was not declared in this scope


Code: [Select]

LaurentGomila-SFML-a647c68/src/SFML/Window/Linux/JoystickImpl.cpp:104: error: 'ABS_X' was not declared in this scope

...
Code: [Select]

LaurentGomila-SFML-a647c68/src/SFML/Window/Linux/JoystickImpl.cpp:126: error: 'js_event' was not declared in this scope

Which file defines JSIO*, ABS_*, js_event_* ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FreeBSD is an Unsupported operating system?
« Reply #6 on: September 15, 2011, 05:02:50 pm »
Quote
I downloaded LaurentGomila-SFML-bindings_removed-98-g78a625d.tar.gz

This looks like an old revision (bindings_removed is a tag that I set when I removed bindings from the main repository).

Quote
FreeBSD is not Linux.

Yeah, I know... but the build configuration is the same on both. That's why I've put a comment to explain this.

Quote
...many errors with joystick API...

Ok, here is the interesting stuff :)
The joystick API on FreeBSD is undocumented and I was waiting for someone to help me for implementation and tests. Would you like to help?
Laurent Gomila - SFML developer

ccbsd

  • Newbie
  • *
  • Posts: 14
    • View Profile
FreeBSD is an Unsupported operating system?
« Reply #7 on: September 15, 2011, 05:21:39 pm »
Quote from: "Laurent"

Quote
...many errors with joystick API...

Ok, here is the interesting stuff :)
The joystick API on FreeBSD is undocumented and I was waiting for someone to help me for implementation and tests. Would you like to help?


I 'd like. How to do? (I have some level c and c++ skills. But I have a frew system and project build skills).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FreeBSD is an Unsupported operating system?
« Reply #8 on: September 15, 2011, 06:02:30 pm »
First, we need to find documentation for the joystick API on FreeBSD. It should be close the Linux one, but without a doc we can't do anything.

Then with a doc I think I'll be able to fix the code blindly, and you would test it for me.

So... do you know where I could find the documentation of the FreeBSD joystick API?
Laurent Gomila - SFML developer

ccbsd

  • Newbie
  • *
  • Posts: 14
    • View Profile
FreeBSD is an Unsupported operating system?
« Reply #9 on: September 15, 2011, 06:22:44 pm »
Quote from: "Laurent"
First, we need to find documentation for the joystick API on FreeBSD. It should be close the Linux one, but without a doc we can't do anything.

Then with a doc I think I'll be able to fix the code blindly, and you would test it for me.

So... do you know where I could find the documentation of the FreeBSD joystick API?


sounds interesting. I will have a try.

ccbsd

  • Newbie
  • *
  • Posts: 14
    • View Profile
FreeBSD is an Unsupported operating system?
« Reply #10 on: September 16, 2011, 05:09:57 pm »
Quote from: "Laurent"
First, we need to find documentation for the joystick API on FreeBSD. It should be close the Linux one, but without a doc we can't do anything.

Then with a doc I think I'll be able to fix the code blindly, and you would test it for me.

So... do you know where I could find the documentation of the FreeBSD joystick API?


xf86-input-joystick  is in FreeBSD ports tree.
Code: [Select]

# cd /usr/ports/x11-drivers/xf86-input-joystick/
# make install clean
# pkg_info -Ix xf86-input-joystick
xf86-input-joystick-1.5.0_1 X.Org joystick input driver
# pkg_info -L xf86-input-joystick-1.5.0_1
Information for xf86-input-joystick-1.5.0_1:

Files:
/usr/local/man/man4/joystick.4x.gz
/usr/local/include/xorg/joystick-properties.h
/usr/local/lib/xorg/modules/input/joystick_drv.la
/usr/local/lib/xorg/modules/input/joystick_drv.so
/usr/local/libdata/pkgconfig/xorg-joystick.pc





This is the entire code of /usr/local/include/xorg/joystick-properties.h
Code: [Select]

/*
 * Copyright 2007-2008 by Sascha Hlusiak. <saschahlusiak@freedesktop.org>    
 *                                                                            
 * Permission to use, copy, modify, distribute, and sell this software and its
 * documentation for any purpose is  hereby granted without fee, provided that
 * the  above copyright   notice appear  in   all  copies and  that both  that
 * copyright  notice   and   this  permission   notice  appear  in  supporting
 * documentation, and that   the  name of  Sascha   Hlusiak  not  be  used  in
 * advertising or publicity pertaining to distribution of the software without
 * specific,  written      prior  permission.     Sascha   Hlusiak   makes  no
 * representations about the suitability of this software for any purpose.  It
 * is provided "as is" without express or implied warranty.                  
 *                                                                            
 * SASCHA  HLUSIAK  DISCLAIMS ALL   WARRANTIES WITH REGARD  TO  THIS SOFTWARE,
 * INCLUDING ALL IMPLIED   WARRANTIES OF MERCHANTABILITY  AND   FITNESS, IN NO
 * EVENT  SHALL SASCHA  HLUSIAK  BE   LIABLE   FOR ANY  SPECIAL, INDIRECT   OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA  OR PROFITS, WHETHER  IN  AN ACTION OF  CONTRACT,  NEGLIGENCE OR OTHER
 * TORTIOUS  ACTION, ARISING    OUT OF OR   IN  CONNECTION  WITH THE USE    OR
 * PERFORMANCE OF THIS SOFTWARE.
 *
 */

#ifndef _JOYSTICK_PROPERTIES_
#define _JOYSTICK_PROPERTIES_

/**
 * Properties exported by the joystick driver. These properties are
 * recognized by the driver and will change its behavior when modified.
 */



/** To be used with property JSTK_PROP_AXIS_TYPE **/
typedef enum _JSTK_TYPE {
    JSTK_TYPE_NONE=0,      /* Axis value is not relevant */
    JSTK_TYPE_BYVALUE,     /* Speed of cursor is relative to amplitude */
    JSTK_TYPE_ACCELERATED, /* Speed is accelerated */
    JSTK_TYPE_ABSOLUTE     /* The amplitude defines the cursor position */
} JSTK_TYPE;


/** To be used with properties JSTK_PROP_AXIS_MAPPING, JSTK_PROP_BUTTON_MAPPING */
typedef enum _JSTK_MAPPING {
    JSTK_MAPPING_NONE=0,         /* Nothing */
    JSTK_MAPPING_X,              /* X-Axis */
    JSTK_MAPPING_Y,              /* Y-Axis */
    JSTK_MAPPING_ZX,             /* Horizontal scrolling */
    JSTK_MAPPING_ZY,             /* Vertical scrolling */
    JSTK_MAPPING_BUTTON,         /* Mouse button */
    JSTK_MAPPING_KEY,            /* Keyboard event */
    JSTK_MAPPING_SPEED_MULTIPLY, /* Will amplify all axis movement */
    JSTK_MAPPING_DISABLE,        /* Disable mouse and key events */
    JSTK_MAPPING_DISABLE_MOUSE,  /* Disable only mouse events */
    JSTK_MAPPING_DISABLE_KEYS    /* Disable only key events */
} JSTK_MAPPING;



/** Controls the verbosity of the driver */
/* 8 bit (0..20) */
#define JSTK_PROP_DEBUGLEVEL "Debug Level"

/** Number of buttons found on device */
/* 8 bit (0..MAXBUTTONS), read-only */
#define JSTK_PROP_NUMBUTTONS "Buttons"

/** Number of axes found on device */
/* 8 bit (0..MAXAXES), read-only */
#define JSTK_PROP_NUMAXES "Axes"

/** Generate pointer movement or button events */
/* 8 bit (0 or 1) */
#define JSTK_PROP_MOUSE_ENABLED "Generate Mouse Events"

/** Generate key events */
/* 8 bit (0 or 1) */
#define JSTK_PROP_KEYS_ENABLED "Generate Key Events"

/** Set the dead zone of each axis */
/* 32 bit (0..30000), for each axis*/
#define JSTK_PROP_AXIS_DEADZONE   "Axis Deadzone"

/** Set axis type to none, byvalue, accelerated, absolute */
/* 8 bit, one of enum _JSTK_TYPE per axis*/
#define JSTK_PROP_AXIS_TYPE   "Axis Type"

/** Set mapping of axis to none, x, y, zx, zy, key */
/* 8 bit, one of enum _JSTK_MAPPING per axis */
#define JSTK_PROP_AXIS_MAPPING   "Axis Mapping"

/** Set movement factor of axis (default 1.0f) */
/* FLOAT[MAXAXES], movement amplify per axis */
#define JSTK_PROP_AXIS_AMPLIFY "Axis Amplify"

/** Scancodes for axis in low position */
/* 8 bit, 4 per axis */
#define JSTK_PROP_AXIS_KEYS_LOW "Axis Keys (low)"

/** Scancodes for axis in high position */
/* 8 bit, 4 per axis */
#define JSTK_PROP_AXIS_KEYS_HIGH "Axis keys (high)"

/** Set the mapping of each button to
    none, x, y, zx, zy, button, key, speed_multiply,
    disable, disable_mouse, disable_keys */
/* 8 bit, one of enum _JSTK_MAPPING per button */
#define JSTK_PROP_BUTTON_MAPPING   "Button Mapping"

/** Set the logical button to report for this physical button */
/* 8 bit (0..32), logical button number per button */
#define JSTK_PROP_BUTTON_BUTTONNUMBER "Button Number"

/** Set amplify factor of button (default 1.0f) */
/* FLOAT[MAXBUTTONS], amplify value per button */
#define JSTK_PROP_BUTTON_AMPLIFY "Button Amplify"

/** Scancodes for button */
/* 8 bit, 4 per button */
#define JSTK_PROP_BUTTON_KEYS "Button Keys"


#endif /* _JOYSTICK_PROPERTIES_ */

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FreeBSD is an Unsupported operating system?
« Reply #11 on: September 16, 2011, 05:55:48 pm »
Now we need some functions to make use of these constants :P

After searching a little bit I found that most of the libraries that implement joystick handling (like SDL) rely on uhid directly on FreeBSD. That's... raw.
Laurent Gomila - SFML developer

ccbsd

  • Newbie
  • *
  • Posts: 14
    • View Profile
FreeBSD is an Unsupported operating system?
« Reply #12 on: September 19, 2011, 05:12:24 pm »
Maybe ois is a solution, I am not sure. A friend told me.
Quote
Object Oriented Input System (OIS) is meant to be a cross platform, simple solution for using all kinds of Input Devices (Keyboards, Mice, Joysticks, etc) and feedback devices (e.g. force feedback). Written in C++ using Object Oriented Design pattern

http://sourceforge.net/projects/wgois/
ois is in FreeBSD ports tree:
/usr/ports/devel/ois/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FreeBSD is an Unsupported operating system?
« Reply #13 on: September 19, 2011, 07:13:32 pm »
I don't want to use a high-level library for this, but I can have a look at their source code.

They have files for Win32, Mac, Linux, iPhone but I can't find what they use for FreeBSD.
Laurent Gomila - SFML developer

ccbsd

  • Newbie
  • *
  • Posts: 14
    • View Profile
FreeBSD is an Unsupported operating system?
« Reply #14 on: October 25, 2011, 03:11:46 pm »
I am sorry that it's hard for me to do something for SFML. It's a pity that FreeBSD users can't use SFML 2.0 now.

 

anything