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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - EatMyShorts

Pages: [1]
1
Window / Incorrect handling of multiple controllers events
« on: August 10, 2022, 04:06:45 pm »
I am using SFML 2.5.1.

I have two Xbox One Controllers connected to my PC. Obviously they will have two ids, 0 and 1.

When I disconnect the one with id 0 (the first one) bad magic happens.

First of all, I can see a weird sequence of JoystickDisconnected/JoystickConnected events.
The 0 controller gets disconnected, and a new 0 controller gets connected.

Secondly, once the 0 controller is disconnected, events for connected controller are reported with id 0 and 1.

I wrote a simple code for tracing Joystick events.
Quote
      sf::Event event;
      while (m_window.pollEvent(event))
      {
         switch (event.type)
         {
         case sf::Event::JoystickMoved:
            {
               Diagnostics::Trace::Write("Controller move: Id:[{0}]\n", event.joystickMove.joystickId);
            }
            break;
         case sf::Event::JoystickDisconnected:
            {
               Diagnostics::Trace::Write("Controller disconnected: Id:[{0}]\n", event.joystickConnect.joystickId);
            }
            break;
         case sf::Event::JoystickConnected:
            {
               Diagnostics::Trace::Write("Controller connected: Id:[{0}]\n", event.joystickConnect.joystickId);
            }
            break;
         }
      }

This is the output after disconnecting 0 controller and moving a thumbstick on other, still connected controller.
Quote
Controller disconnected: Id:[0]
Controller connected: Id:[0]
Controller move: Id:[0]
Controller move: Id:[0]
Controller move: Id:[0]
Controller move: Id:[0]
Controller move: Id:[1]
Controller move: Id:[1]
Controller move: Id:[1]
Controller move: Id:[1]
Controller move: Id:[0]
Controller move: Id:[0]
Controller move: Id:[1]
Controller move: Id:[1]

As you can see:
1. Controller 0 gets somehow connected
2. Events are reported for both controllers 0 and 1 even there is only one controller connected.

This seems to be a bug in SFML library.
I have found two topics about similar problems, but there is no explanation what is going on.

https://en.sfml-dev.org/forums/index.php?topic=27376.0
https://en.sfml-dev.org/forums/index.php?topic=24764.0

2
Graphics / SFML 2.0 - Freetype library linking in graphics module
« on: September 27, 2010, 08:33:36 pm »
Hello,

I have started using SFML 2.0 in my application. Recently I have added 2 new libraries to it zlib and zziplib to be able to read zip archives. Once I linked them as static libraries I received couple of linker errors

1>LIBCMT.lib(dosmap.obj) : error LNK2005: __errno already defined in MSVCRTD.lib(MSVCR90D.dll)

All my projects are supposed to link Multithreaded Runtime libs from DLL (/MD option in VS2008), but from what I saw in dumpbin.exe reports sfml2-graphics-s-d.lib uses freetype.lib which is compiled with /MT Runtime Library option and this is not good.

Is it going to be changed in near future ?

//EDIT:

I have more problems with my application now. I cannot compile it even if i have recompiled FreeType library.

Can you tell me what version of freetype lib are you using. Maybe I have compiled wrong wersion.

//EDIT 2

I have managed to compile it correctly. I have downloaded lates version of Freetype lib. Compile it it /MD[d] option and recompile SFML 2.0

I think this issue should be fixed in SFML 2.0.[/b]

Pages: [1]