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 - AshleyF

Pages: [1]
1
Dear All,

I have found what I think may well be a bug in SFML 2.4.2 on macOS 10.13.3.

I want to be able to switch between different fullscreen resolution rates by pressing a button during the application's execution.

The following source code was taken and adapted from a forum post by Raptor88.

int main()
{
    std::vector<sf::VideoMode> modes = sf::VideoMode::getFullscreenModes();
   
    size_t mode = 0;
    sf::RenderWindow Window(modes[mode], "SFML Sample Application");
   
    while (Window.isOpen())
    {
        sf::Event Event;
        while(Window.pollEvent(Event))
        {
            switch (Event.type)
            {
                case sf::Event::Closed:
                    Window.close();
                    break;
                case sf::Event::KeyPressed:
                    if (Event.key.code == sf::Keyboard::Escape)
                    {
                        Window.close();
                    } else if (Event.key.code == sf::Keyboard::F2 && mode < modes.size() - 1)
                    {
                        Window.create(sf::VideoMode(modes[++mode]), "Mode", sf::Style::Fullscreen);
                    } else if (Event.key.code == sf::Keyboard::F1 && mode > 0)
                    {
                        Window.create(sf::VideoMode(modes[--mode]), "Mode", sf::Style::Fullscreen);
                    }
                    break;
                default:
                    break;
            }
        }
       
        Window.clear(sf::Color(0, 255, 255) );
        Window.display();
    }
   
    return 0;
}

This code appears to work fine on the PC, but not on the Mac.

The Mac shows the correct dimensions of the created window, but as a borderless window centred around the middle of the screen with a black border around it. The window doesn't stretch to cover the entire screen.

If anyone can please offer some advice concerning this, I'd be most grateful.

Kind regards,

AshleyF


2
Feature requests / MoltenVK
« on: February 28, 2018, 03:09:48 pm »
Dear All,

As MoltenVK has become available on github, I was wondering what prospect Vulkan now has of becoming part of SFML?

Kind regards,

AshleyF

3
General / Possible Mac 2.4.2 Bug - 'Month 13 is out of bounds'
« on: December 07, 2017, 07:14:11 pm »
Dear All,

Starting this December 2017, an error message appears in Xcode even with just the source code listed below:

#include <SFML/Graphics.hpp>

int main(int, char const**)
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
    return EXIT_SUCCESS;
}

The error message in the Xcode project I called 'Timer Error' is as follows:

2017-12-07 17:56:57.696036+0000 Timer Error[13769:8570286] Month 13 is out of bounds

Any suggestions for fixing this error message will be most gratefully received!

Kind regards,

AshleyF

4
General discussions / VS 2017 Static & Dynamic problems with 2.4.2
« on: July 26, 2017, 07:39:01 pm »
Dear All,

I am having major problems with VS Community 2017 and 2.4.2 32-bit.

I follow the installation instructions to the letter, but it just will not work.

I've used CMake on the 32-bit source code, but that also doesn't work.

Does anyone happen to have any idea when a VSC 2017 specific stable release will be available please?

Kind regards,

AshleyF

5
Dear Webmaster,

Is it possible to get the website to send an automated email to every registered SFML user when a new stable release is available for download?

This would help keep everybody up-to-date with SFML and I'm sure everybody would be delighted to receive this notification! ;)

Kind regards,

AshleyF

6
Feature requests / Joystick problems on the Mac
« on: June 13, 2017, 09:49:19 am »
Dear Laurent and Associates,

In JoystickImpl.cpp on the Mac, I have discovered an error.

The function:

bool JoystickImpl::open(unsigned int index)

contains the following code, starting at line 243, that isn't quite complete:

    // Go through all connected elements.
    for (int i = 0; i < elementsCount; ++i)
    {
        IOHIDElementRef element = (IOHIDElementRef) CFArrayGetValueAtIndex(elements, i);
        switch (IOHIDElementGetType(element))
        {
            case kIOHIDElementTypeInput_Misc:
                switch (IOHIDElementGetUsage(element))
                {
                    case kHIDUsage_GD_X:  m_axis[Joystick::X] = element; break;
                    case kHIDUsage_GD_Y:  m_axis[Joystick::Y] = element; break;
                    case kHIDUsage_GD_Z:  m_axis[Joystick::Z] = element; break;
                    case kHIDUsage_GD_Rx: m_axis[Joystick::U] = element; break;
                    case kHIDUsage_GD_Ry: m_axis[Joystick::V] = element; break;
                    case kHIDUsage_GD_Rz: m_axis[Joystick::R] = element; break;
                    default: break;
                    // kHIDUsage_GD_Vx, kHIDUsage_GD_Vy, kHIDUsage_GD_Vz are ignored.
                }
                break;

and there's a comment in the source code that is as follows from line 274:

    // Ensure that the buttons will be indexed in the same order as their
    // HID Usage (assigned by manufacturer and/or a driver).
    std::sort(m_buttons.begin(), m_buttons.end(), JoystickButtonSortPredicate);

    // Note: Joy::AxisPovX/Y are not supported (yet).
    // Maybe kIOHIDElementTypeInput_Axis is the corresponding type but I can't test.

Well, as I do have the necessary joysticks to test this, please let me know how to rewrite the source code in accordance with SFML standards and I'll see if I can do it for you.

Kind regards,

AshleyF

7
Dear Laurent and Associates,

Having watched Sonar Systems' installation strategy on YouTube for both Mac and PC, I was wondering if what was demonstrated, was advised? (Search on YouTube for 'SFML 2.4.x Tutorial Series').

On the SFML webpage, why not embed a YouTube video for each respective SFML platform giving step-by-step instructions? I'm sure everybody would find that to be very helpful.

Kind regards,

AshleyF

8
Feature requests / Standardised cross-platform file access
« on: June 13, 2017, 02:04:12 am »
Dear Laurent and Associates,

Would it be possible to standardise cross-platform file access?

For instance, on the Mac:

// ... To get the path to these resources, use the helper
// function `resourcePath()` from ResourcePath.hpp

...

// Here is a small helper for you! Have a look.
#include "ResourcePath.hpp"

int main(int, char const**)
{
...
    if (!icon.loadFromFile(resourcePath() + "icon.png")) {
        return EXIT_FAILURE;
    }
...

As illustrated, an additional 'resourcePath() +' exists on Mac, which on PC, and I gather also Linux, doesn't.

If a solution could be devised, I'm quite sure cross-platform development would be even better.

Kind regards,

AshleyF

9
Dear All,

I was wondering if it might be possible to change:

unsigned int axes = sf::Joystick::AxisCount;

to:

unsigned int axes = sf::Joystick::AxisCount(joystickNumber);

such that it's possible to test exactly how many axes are available on a given joystick, or, going further with it, would it be possible to return appropriate information on a given joystick such that I'd immediately know what axes were available?

The reason why I'm suggesting this is because under macOS, irrespective of the joystick being tested, it always returns 8 as the answer to the query.

Kind regards,

AshleyF

10
Dear All,

On examining JoystickImpl.cpp in the OSX folder for the source code of SFML, I think I may have discovered why SFML still doesn't yet work correctly with my PS4 controller on my iMac.

Before examining the source code, I checked with my existing SFML joystick handler what was and what wasn't detected with my PS4 controller.

All 8 axes were detected correctly, but the PovX and PovY were not listed as detected when tested for individually. I checked the source I'd written on my PC and SFML detects them correctly on the PC.

I have listed the source below to help you in the context of this bug tracking and I think the possible bug in the source code is at the end of the source listing:

// Go through all connected elements.
    for (int i = 0; i < elementsCount; ++i)
    {
        IOHIDElementRef element = (IOHIDElementRef) CFArrayGetValueAtIndex(elements, i);
        switch (IOHIDElementGetType(element))
        {
            case kIOHIDElementTypeInput_Misc:
                switch (IOHIDElementGetUsage(element))
                {
                    case kHIDUsage_GD_X:  m_axis[Joystick::X] = element; break;
                    case kHIDUsage_GD_Y:  m_axis[Joystick::Y] = element; break;
                    case kHIDUsage_GD_Z:  m_axis[Joystick::Z] = element; break;
                    case kHIDUsage_GD_Rx: m_axis[Joystick::U] = element; break;
                    case kHIDUsage_GD_Ry: m_axis[Joystick::V] = element; break;
                    case kHIDUsage_GD_Rz: m_axis[Joystick::R] = element; break;
                    default: break;
                    // kHIDUsage_GD_Vx, kHIDUsage_GD_Vy, kHIDUsage_GD_Vz are ignored.
                }
                break;

            case kIOHIDElementTypeInput_Button:
                if (m_buttons.size() < Joystick::ButtonCount) // If we have free slot...
                    m_buttons.push_back(element); // ...we add this element to the list
                // Else: too many buttons. We ignore this one.
                break;

            default: // Make compiler happy
                break;
        }
    }

If you examine the above source code, you will notice that it does not have a case statement for kHIDUsage_GD_PovX and kHIDUsage_GD_PovY.

Do you think that this could be the cause of the error?

Kind regards,

AshleyF

11
General / Bug with a PS4 controller on the Mac
« on: July 21, 2016, 05:50:00 pm »
Dear All,

I've detected a bug with SFML and its joystick routines on the Mac.

Plug in a PS4 controller via an appropriate usb cable.

Get SFML to detect all the buttons.

Bug is:

It counts 14 but misses the up/down/left/right buttons on the top left of the controller. So it should detect 18, but other than that, everything works fine.

I know that it's an error with SFML as I tested the PS4 controller with an old GLFW program I wrote, and that detected all the buttons appropriately.

If anyone can fix this bug, then I'd be most grateful.

Kind regards,

AshleyF

12
SFML website / Are mailing lists possible?
« on: August 27, 2015, 11:46:10 am »
Dear SFML management,

Would it be possible for you to set up an automated emailing list for updates to SFML such that all users would know when to download the latest version?

Kind regards,

AshleyF

13
SFML website / Are installation videos possible?
« on: August 27, 2015, 11:43:43 am »
Dear SFML management,

Do you think it would be possible for you to put embedded narrated YouTube videos on this site to explain how to install SFML per platform and compiler as new versions get released?

Thanks for your help.

Kind regards,

AshleyF

14
System / SFML 2.3.1 not detecting Xbox 360 Controller under Mac Yosemite
« on: August 04, 2015, 05:30:04 pm »
Dear All,

My Xbox 360 controller is not detected under Yosemite 10.10.4! When I plug the controller into my iMac, the lights for 1 - 4 light up very briefly, but then they all switch off. I know the controller works as I've tested it on my PC.

In attempting to diagnose possible coding problems, the errors are as follows: 1) It doesn't detect it at all; and 2) If you do a cout regarding how many buttons there are, it always reports 32.

Code for joystick detection is as follows:

#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include "ResourcePath.hpp"
#include <iostream>

int main(int, char const**)
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed) {
                window.close();
            }

            if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) {
                window.close();
            }
        }

        window.clear();

        if (sf::Joystick::isConnected(0))
            std::cout << "Joystick is connected" << std::endl;

        window.display();
    }

    return EXIT_SUCCESS;
}

If anyone can enlighten me as to the solution, I'd be most grateful!

Kind regards,

AshleyF

Pages: [1]