Boost logo

Boost :

Subject: Re: [boost] The future and present of Boost
From: degski (degski_at_[hidden])
Date: 2018-10-24 07:25:45


On Tue, 23 Oct 2018 at 14:26, charleyb123 <charleyb123_at_[hidden]> wrote:

> On Tue, Oct 23, 2018 at 2:36 AM degski via Boost <boost_at_[hidden]>
> wrote:
>
>> <snip, question of essential C++ functions>
>> Well, in respect of the 2D Graphics proposal(s), I don't get it. There is
>> a
>> perfectly good (C++, cross platform, mature) 2D Framework [SFML]
>> available,
>> which seems to have been discarded from the block. No, instead we're gonna
>> get [probably] some poofed up C thingy, which does not even allow you to
>> write that little 2D Game [because we need a mouse, a window, touch, sound
>> (formats), image formats, etc etc]. I agree with RR, though, these things
>> should not be part of C++, I don't even think the Network TS should be in
>> the standard, it's highly specialized stuff, with heaps of pitfalls [most
>> user posted problems on this list pertain to ASIO [and Beast (no criticism
>> intended, it's just complicated stuff)].
>>
>
> FYI, the SDL2 backend is now merged into the ‘master’ repo (of
> https://github.com/cpp-io2d/P0267_RefImpl).
>
> To use it, io2d needs to be compiled with the CMake flag,
> -DIO2D_DEFAULT=CAIRO_SDL2
>

Should I cheer or cry? FYI, I'm crying. Let's have a look a basic thing
like creating a Window. I'm taking the Samples/ rocks_in_space as an
example as that seems to be as close as it gets to "a simple 2D game". So
we are creating a window:
https://github.com/cpp-io2d/P0267_RefImpl/blob/master/P0267_RefImpl/Samples/rocks_in_space/Win32Win.cpp
and
https://github.com/cpp-io2d/P0267_RefImpl/blob/master/P0267_RefImpl/Samples/rocks_in_space/XlibWin.cpp.
Somebody must have lost their mind, it's just raw Win32-code (and
corresponding Linux x11 code (Wayland anyone? I'm on Fedora)).

Now let's see how we do that in SFML:

#include <SFML/Window.hpp>
int main()
{
    sf::Window window(sf::VideoMode(800, 600), "My window");

    // run the program as long as the window is open
    while (window.isOpen())
    {
        // check all the window's events that were triggered since the
last iteration of the loop
        sf::Event event;
        while (window.pollEvent(event))
        {
            // "close requested" event: we close the window
            if (event.type == sf::Event::Closed)
                window.close();
        }
    }

    return 0;
}

Just to be clear we did not just do that, we created a window, an
event-loop and a functioning "close that window button". This code will run
as is on Windows, Linux and OSX (each in its proper native look).

But, on the bright side, I'm happy that potentially P0267 will be
standardized, then SFML can keep on being developed as is and can progress,
introduce breaking changes if deemed useful and will not be stuck in a 3
year update cycle.

degski

-- 
*“If something cannot go on forever, it will stop" - Herbert Stein*

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk