New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pushing upstream openbsd support from package. #1330
Conversation
Is it intentional to use the Android joystick implementation? If so, it might be a good idea to rename or move it. |
Yes intentional :-) but it concerns only few files among Android implementations in another hand ... what do you think ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. I guess we should add a builder for openbsd then.. :-)
src/SFML/Window/CMakeLists.txt
Outdated
elseif(SFML_OS_OPENBSD) | ||
set(PLATFORM_SRC | ||
${PLATFORM_SRC} | ||
${SRCROOT}/Android/JoystickImpl.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the android implementation is a dummy one, I'd rather see those files being copied to a new directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok will do later in the day fair enough :-)
@devnexen We've gotten quite some changes with our CMake setup. Could you resolve the merge conflicts? |
1040ac5
to
69a6c70
Compare
The rebase doesn't look clean. Stuff like |
I just realized that the only thing preventing us from generalizing FreeBSD support to just "BSD support" is that the Joystick implementations are different (OpenBSD doesn't have one in this PR). Is there a technical reason why OpenBSD can't share the same Joystick implementation with FreeBSD? |
69a6c70
to
351d4e9
Compare
OpenBSD does not have joystick support |
Browsing through the SDL source code, I noticed that SDL shares the same joystick code among all BSDs. SFML's current FreeBSD Joystick implementation makes use of usbhid instead of the joy driver. usbhid should be available on OpenBSD as well no? |
This code is not compiled for OpenBSD (e.g. SDL_JOYSTICK_USBHID is set to zero in our case) |
I'm not an expert in OpenBSD by any means, but does this come down to whether usbhid is installed by the user? Or is it not available at all as a package on OpenBSD? There seem to be OpenBSD man pages for usbhid with the remark that usbhid has been available since OpenBSD 3.0. |
usbhid is available but no joystick support. The SDL code you mentioned earlier needs joystick.h header which we do not have. |
To come back to SFML until now we used empty android implementation as you can see here https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/multimedia/sfml/patches/patch-src_SFML_Window_JoystickImpl_hpp?rev=1.2&content-type=text/x-cvsweb-markup |
OK I guess. 👍 |
cmake/Config.cmake
Outdated
@@ -117,3 +121,12 @@ else() | |||
message(FATAL_ERROR "Unsupported compiler") | |||
return() | |||
endif() | |||
|
|||
# define the install directory for miscellaneous files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block is no longer used in the current master revision.
include/SFML/Config.hpp
Outdated
@@ -85,6 +85,10 @@ | |||
|
|||
// FreeBSD | |||
#define SFML_SYSTEM_FREEBSD | |||
#elif defined(__OpenBSD__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line missing before this one.
src/SFML/Window/CMakeLists.txt
Outdated
@@ -259,7 +265,7 @@ if(SFML_OS_LINUX) | |||
target_link_libraries(sfml-window PRIVATE UDev) | |||
elseif(SFML_OS_WINDOWS) | |||
target_link_libraries(sfml-window PRIVATE winmm gdi32) | |||
elseif(SFML_OS_FREEBSD) | |||
elseif(SFML_OS_FREEBSD OR SFML_OS_OPENBSD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can't interface with joysticks via usbhid do we still need to link to it on OpenBSD?
src/SFML/Window/JoystickImpl.hpp
Outdated
@@ -98,7 +98,7 @@ struct JoystickState | |||
|
|||
#include <SFML/Window/iOS/JoystickImpl.hpp> | |||
|
|||
#elif defined(SFML_SYSTEM_ANDROID) | |||
#elif defined(SFML_SYSTEM_ANDROID) || defined(SFML_SYSTEM_OPENBSD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be split out and include the OpenBSD implementation instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True that s forgotten change in fact.
namespace priv | ||
{ | ||
//////////////////////////////////////////////////////////// | ||
/// \brief Android implementation of joysticks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy pasta :)
c8d0b0b
to
8d62b11
Compare
Merged in 9da895d |
No description provided.