• Re: 'Graphics' of libwy

    From David Brown@21:1/5 to wij on Mon Dec 16 10:29:48 2024
    On 15/12/2024 11:04, wij wrote:
    I had headache whenevr I think about graphics in C++. Why C++ does not provide
    a graphics library (lots complaint about this), not even a simplest one for demonstrating its 'power' of C++ itself?

    There are 101 C++ graphics libraries, all with their pros and cons and different use-cases. How could the C++ standard library pick just one
    of them?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lynn McGuire on Tue Dec 17 08:49:46 2024
    On 17/12/2024 01:47, Lynn McGuire wrote:
    On 12/16/2024 3:29 AM, David Brown wrote:
    On 15/12/2024 11:04, wij wrote:
    I had headache whenevr I think about graphics in C++. Why C++ does
    not provide
    a graphics library (lots complaint about this), not even a simplest
    one for
    demonstrating its 'power' of C++ itself?

    There are 101 C++ graphics libraries, all with their pros and cons and
    different use-cases.  How could the C++ standard library pick just one
    of them?

    Open Source and LGPL would be a good place to start.
       https://en.wikipedia.org/wiki/List_of_widget_toolkits


    So that leaves - what - 20-odd different libraries from that page that
    are open source, cross-platform and suitable for C or C++ ? And there's
    maybe an order of magnitude more that not on the Wikipedia page but are
    still established enough to be contenders.

    Then you need to consider that the C++ world is not just *nix, MacOS and Windows - and that even for those, needs vary enormously (big, small, easy-to-use, wide selection of widgets, 2D, 3D, etc.). The things /I/
    want from a gui library for an embedded system are hugely different from
    what you would want on a PC. And of course LGPL is useless for me.

    No, that page is not really a good place to start - unless you are using
    it as a starting point for showing how meaningless it would be to try to
    pick a single gui library that is somehow "standard" for C++.


    I don't know if that will stop the C++ committee from trying to pick or
    make a standard GUI library - after all, it's certainly an appealing
    idea. But if the "success" of C++'s threading support is any judge,
    they have a hard road in front of them.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to Lynn McGuire on Tue Dec 17 16:38:49 2024
    On 17.12.2024 02:41, Lynn McGuire wrote:
    On 12/15/2024 4:04 AM, wij wrote:
    I had headache whenevr I think about graphics in C++. Why C++ does not
    provide
    a graphics library (lots complaint about this), not even a simplest
    one for
    demonstrating its 'power' of C++ itself? Then, I suddenly realized
    that the
    minimal answer is already there because the resolution of modern text
    screen
    (emulator) is barely enough (width can be >320).
    ...

    I totally agree that C++ should have a graphics library and a user
    interface library both.

    Have you looked at
       https://wxwidgets.org/

    "wxWidgets is a C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base. It
    has popular language bindings for Python, Ruby, Lua, Perl and several
    other languages, and unlike other cross-platform toolkits, wxWidgets
    gives applications a truly native look and feel because it uses the platform's native API rather than emulating the GUI. It's also
    extensive, free, open-source and mature."

    wxWidgets does work and is better than MFC, but not extremely so. Also,
    it is not exactly light-weight, a git checkout is 803 MB. Good luck for
    the standards committee to standardize anything like that.

    Also, wxWidgets would be only part of the solution, it would still need
    a graphics back-end for actually drawing anything, plus some fonts for rendering texts. On some platforms the graphics back-end is built into
    the OS, on others it is not.

    BTW, what has happened with Mr Flibble and his neoGFX library?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Paavo Helde on Tue Dec 17 15:34:58 2024
    Paavo Helde <[email protected]> writes:
    On 17.12.2024 02:41, Lynn McGuire wrote:
    On 12/15/2024 4:04 AM, wij wrote:

    wxWidgets does work and is better than MFC, but not extremely so. Also,
    it is not exactly light-weight, a git checkout is 803 MB. Good luck for
    the standards committee to standardize anything like that.

    Also, wxWidgets would be only part of the solution, it would still need
    a graphics back-end for actually drawing anything, plus some fonts for >rendering texts. On some platforms the graphics back-end is built into
    the OS, on others it is not.

    BTW, what has happened with Mr Flibble and his neoGFX library?

    neoGFx appears to still be actively maintained.

    https://github.com/i42output/neoGFX

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Tue Dec 17 16:02:16 2024
    On Tue, 17 Dec 2024 16:38:49 +0200
    Paavo Helde <[email protected]> wibbled:
    On 17.12.2024 02:41, Lynn McGuire wrote:
    On 12/15/2024 4:04 AM, wij wrote:
    I had headache whenevr I think about graphics in C++. Why C++ does not
    provide
    a graphics library (lots complaint about this), not even a simplest
    one for
    demonstrating its 'power' of C++ itself? Then, I suddenly realized
    that the
    minimal answer is already there because the resolution of modern text
    screen
    (emulator) is barely enough (width can be >320).
    ...

    I totally agree that C++ should have a graphics library and a user
    interface library both.

    Have you looked at
       https://wxwidgets.org/

    "wxWidgets is a C++ library that lets developers create applications for
    Windows, macOS, Linux and other platforms with a single code base. It
    has popular language bindings for Python, Ruby, Lua, Perl and several
    other languages, and unlike other cross-platform toolkits, wxWidgets
    gives applications a truly native look and feel because it uses the
    platform's native API rather than emulating the GUI. It's also
    extensive, free, open-source and mature."

    wxWidgets does work and is better than MFC, but not extremely so. Also,
    it is not exactly light-weight, a git checkout is 803 MB. Good luck for
    the standards committee to standardize anything like that.

    Also, wxWidgets would be only part of the solution, it would still need
    a graphics back-end for actually drawing anything, plus some fonts for >rendering texts. On some platforms the graphics back-end is built into
    the OS, on others it is not.

    Does wx do 3D stuff? If not you'd need yet another library to do that too.

    Personally I'd go with Qt. Its mature and cross platform and does what 99%
    of most people need.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to David Brown on Tue Dec 17 18:53:04 2024
    On 17.12.2024 18:30, David Brown wrote:

    I think if there is ever going to be a standard gui library for C++, it
    will be written specially for the purpose.  That has some big advantages
    - if the designers decide they need extra language features for signals
    and slots, for example, then those can be added to the language rather
    than using an external tool.

    For curiosity I looked at the https://neogfx.org page. Among other
    things it says: "C++ lambdas have made traditional signals and slots redundant".

    It also promises "modern C++20 design" and "no reliance on macro-based
    code generation".

    NeoGFX itself has a too restrictive license (GPL), but at least it
    suggests that C++ nowadays is expressive enough to actually allow for
    some kind of self-contained and concise GUI library.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Tue Dec 17 16:53:23 2024
    On Tue, 17 Dec 2024 17:30:18 +0100
    David Brown <[email protected]> wibbled:
    On 17/12/2024 17:02, [email protected] wrote:
    Personally I'd go with Qt. Its mature and cross platform and does what 99% >> of most people need.


    No, it doesn't come close to that. It's a solid gui library with lots
    of extra tools, and is useful to many people - but it's nothing remotely
    like you suggest.

    It has a license that is totally unsuitable for standardisation. I'm
    not complaining about the license - the people that wrote the library
    get to pick the license. But a standard C++ gui library, if such a
    thing is ever made, has to have a very liberal license - BSD/MIT at most.

    And Qt is hardly a lightweight choice either.

    None of them are. If you want lightweight don't use a cross platform library.

    I think if there is ever going to be a standard gui library for C++, it
    will be written specially for the purpose. That has some big advantages
    - if the designers decide they need extra language features for signals
    and slots, for example, then those can be added to the language rather
    than using an external tool.

    You don't want a library that only works with the latest bleeding edge versions of C++. IMO C++ 2011 would be a reasonable oldest version.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Ahlstrom@21:1/5 to David Brown on Tue Dec 17 11:54:43 2024
    David Brown wrote this post while blinking in Morse code:

    <snip>
    I don't know if that will stop the C++ committee from trying to pick or
    make a standard GUI library - after all, it's certainly an appealing
    idea. But if the "success" of C++'s threading support is any judge,
    they have a hard road in front of them.

    I was just going to say "imagine how long that would get tied up in the standards committee."

    Anyhoo, years ago I used Borland's OWL and it was decent for the time.

    Years after that, Borland used VCL as it's C++ graphics library... written in Object Pascal. Some weird shit went on in the debugger with that one.

    --
    Illiterate? Write today, for free help!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Tue Dec 17 17:30:18 2024
    On 17/12/2024 17:02, [email protected] wrote:
    On Tue, 17 Dec 2024 16:38:49 +0200
    Paavo Helde <[email protected]> wibbled:
    On 17.12.2024 02:41, Lynn McGuire wrote:
    On 12/15/2024 4:04 AM, wij wrote:
    I had headache whenevr I think about graphics in C++. Why C++ does not >>>> provide
    a graphics library (lots complaint about this), not even a simplest
    one for
    demonstrating its 'power' of C++ itself? Then, I suddenly realized
    that the
    minimal answer is already there because the resolution of modern text
    screen
    (emulator) is barely enough (width can be >320).
    ...

    I totally agree that C++ should have a graphics library and a user
    interface library both.

    Have you looked at
       https://wxwidgets.org/

    "wxWidgets is a C++ library that lets developers create applications for >>> Windows, macOS, Linux and other platforms with a single code base. It
    has popular language bindings for Python, Ruby, Lua, Perl and several
    other languages, and unlike other cross-platform toolkits, wxWidgets
    gives applications a truly native look and feel because it uses the
    platform's native API rather than emulating the GUI. It's also
    extensive, free, open-source and mature."

    wxWidgets does work and is better than MFC, but not extremely so. Also,
    it is not exactly light-weight, a git checkout is 803 MB. Good luck for
    the standards committee to standardize anything like that.

    Also, wxWidgets would be only part of the solution, it would still need
    a graphics back-end for actually drawing anything, plus some fonts for
    rendering texts. On some platforms the graphics back-end is built into
    the OS, on others it is not.

    Does wx do 3D stuff? If not you'd need yet another library to do that too.

    Personally I'd go with Qt. Its mature and cross platform and does what 99%
    of most people need.


    No, it doesn't come close to that. It's a solid gui library with lots
    of extra tools, and is useful to many people - but it's nothing remotely
    like you suggest.

    It has a license that is totally unsuitable for standardisation. I'm
    not complaining about the license - the people that wrote the library
    get to pick the license. But a standard C++ gui library, if such a
    thing is ever made, has to have a very liberal license - BSD/MIT at most.

    And Qt is hardly a lightweight choice either.

    The other big issue I see with wx and Qt are that they are /old/ - very
    old. Maturity is not a benefit if there is to be a standard C++ gui
    library - it needs to be something that makes use of modern features of
    C++, not something that is grounded in C++98 and an API that is barely
    above a C-style library, with home-made classes for strings, lists,
    threads, and just about everything else.

    I think if there is ever going to be a standard gui library for C++, it
    will be written specially for the purpose. That has some big advantages
    - if the designers decide they need extra language features for signals
    and slots, for example, then those can be added to the language rather
    than using an external tool.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to David Brown on Tue Dec 17 17:08:12 2024
    David Brown <[email protected]> writes:
    On 17/12/2024 17:02, [email protected] wrote:

    I think if there is ever going to be a standard gui library for C++, it
    will be written specially for the purpose. That has some big advantages
    - if the designers decide they need extra language features for signals
    and slots, for example, then those can be added to the language rather
    than using an external tool.

    It would likely be modeled after AWT or Swing.

    https://en.wikipedia.org/wiki/Abstract_Window_Toolkit https://en.wikipedia.org/wiki/Swing_(Java)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Chris Ahlstrom on Tue Dec 17 22:52:15 2024
    On Tue, 17 Dec 2024 11:54:43 -0500
    Chris Ahlstrom <[email protected]> wrote:

    David Brown wrote this post while blinking in Morse code:

    <snip>
    I don't know if that will stop the C++ committee from trying to
    pick or make a standard GUI library - after all, it's certainly an appealing idea. But if the "success" of C++'s threading support is
    any judge, they have a hard road in front of them.

    I was just going to say "imagine how long that would get tied up in
    the standards committee."

    Anyhoo, years ago I used Borland's OWL and it was decent for the time.

    Years after that, Borland used VCL as it's C++ graphics library...
    written in Object Pascal. Some weird shit went on in the debugger
    with that one.


    Should have been not many years.
    Even Borland itself very quickly understood that OWL was crap.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Wed Dec 18 09:09:22 2024
    On 17/12/2024 17:53, [email protected] wrote:
    On Tue, 17 Dec 2024 17:30:18 +0100
    David Brown <[email protected]> wibbled:
    On 17/12/2024 17:02, [email protected] wrote:
    Personally I'd go with Qt. Its mature and cross platform and does what 99% >>> of most people need.


    No, it doesn't come close to that. It's a solid gui library with lots
    of extra tools, and is useful to many people - but it's nothing remotely
    like you suggest.

    It has a license that is totally unsuitable for standardisation. I'm
    not complaining about the license - the people that wrote the library
    get to pick the license. But a standard C++ gui library, if such a
    thing is ever made, has to have a very liberal license - BSD/MIT at most.

    And Qt is hardly a lightweight choice either.

    None of them are. If you want lightweight don't use a cross platform library.

    That's not true - FLTK comes to mind. (I have not used it.)

    Sometimes you want a heavyweight toolkit with lots of features,
    sometimes you want a lightweight toolkit. And sometimes you want
    something completely different, such as an immediate mode gui toolkit.
    This is why a /standard/ C++ gui library makes little sense.

    Look at other languages - Python has a "standard" gui library based on
    Tkinter, but there are a dozen other popular gui toolkits used with
    Python. One size does not come close to fitting all for gui toolkits.


    I think if there is ever going to be a standard gui library for C++, it
    will be written specially for the purpose. That has some big advantages
    - if the designers decide they need extra language features for signals
    and slots, for example, then those can be added to the language rather
    than using an external tool.

    You don't want a library that only works with the latest bleeding edge versions
    of C++. IMO C++ 2011 would be a reasonable oldest version.


    I'd much rather have one that takes advantage of relatively modern C++
    features than one that re-invented these same features in their one
    special ways - which is what you see with these older libraries. I'd
    put C++11 as a minimum stepping point - C++ post-C++11 is a very
    different language from that of pre-C++11. But if I were looking for a
    new, well-designed modern C++ gui library, I'd want to see concepts, std::format, ranges, and that the whole thing was organised in modules.
    That all means C++20. It's worth upgrading your tools for those for
    something like a gui library.

    But if the C++ committee were to make a standard C++ gui library as part
    of the C++ standard, then it would by definition be part of a later C++ standard. So if it was targeted for C++29, then of course it could rely
    on all the language and library features of standard C++ up to and
    including C++29.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Chris Ahlstrom on Wed Dec 18 08:34:03 2024
    On 17/12/2024 17:54, Chris Ahlstrom wrote:
    David Brown wrote this post while blinking in Morse code:

    <snip>
    I don't know if that will stop the C++ committee from trying to pick or
    make a standard GUI library - after all, it's certainly an appealing
    idea. But if the "success" of C++'s threading support is any judge,
    they have a hard road in front of them.

    I was just going to say "imagine how long that would get tied up in the standards committee."

    Anyhoo, years ago I used Borland's OWL and it was decent for the time.

    Years after that, Borland used VCL as it's C++ graphics library... written in Object Pascal. Some weird shit went on in the debugger with that one.


    I only used Borland C++ Builder on a couple of small projects. The
    thing that bugged me was the number of string types involved in doing
    anything much - you had C strings, Pascal strings (fixed length and
    dynamic), Windows strings, all with wide character variations.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Paavo Helde on Wed Dec 18 08:38:15 2024
    On 17/12/2024 17:53, Paavo Helde wrote:
    On 17.12.2024 18:30, David Brown wrote:

    I think if there is ever going to be a standard gui library for C++,
    it will be written specially for the purpose.  That has some big
    advantages - if the designers decide they need extra language features
    for signals and slots, for example, then those can be added to the
    language rather than using an external tool.

    For curiosity I looked at the https://neogfx.org page. Among other
    things it says: "C++ lambdas have made traditional signals and slots redundant".

    It also promises "modern C++20 design" and "no reliance on macro-based
    code generation".

    NeoGFX itself has a too restrictive license (GPL), but at least it
    suggests that C++ nowadays is expressive enough to actually allow for
    some kind of self-contained and concise GUI library.



    I haven't looked at NeoGFX in any detail - a one-person GPL'ed PC gui
    library is not something I would find useful for my work, for a good
    many reasons. (But good luck to the developer anyway.)

    Certainly lambdas can significantly simplify a lot of event-style
    programming.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Wed Dec 18 09:16:17 2024
    On Wed, 18 Dec 2024 09:09:22 +0100
    David Brown <[email protected]> wibbled:
    On 17/12/2024 17:53, [email protected] wrote:
    You don't want a library that only works with the latest bleeding edge >versions
    of C++. IMO C++ 2011 would be a reasonable oldest version.


    I'd much rather have one that takes advantage of relatively modern C++ >features than one that re-invented these same features in their one
    special ways - which is what you see with these older libraries. I'd

    A lot of companies systems don't have their compilers upgraded if consistency are whats required. A security company I worked at a few years ago only
    went up to C++14 because they didn't want any nasty security hole surprises
    if they upgraded the compiler and started using the new features (or even the older ones).

    new, well-designed modern C++ gui library, I'd want to see concepts,

    Ugh. Concepts and constraints are yet another syntatic soup solution to a problem almost no one has except in various academic ivory towers.

    But if the C++ committee were to make a standard C++ gui library as part
    of the C++ standard, then it would by definition be part of a later C++ >standard. So if it was targeted for C++29, then of course it could rely
    on all the language and library features of standard C++ up to and
    including C++29.

    Well they won't because sensibly they realise graphics capabilities are so variable - or non existent - between systems that there's absolutely no point trying to develop a standard library for it. I was surprised they even
    included a threading library given on various embedded systems threading is
    not available. Plus its inconsistent - why multithreading but no multiprocess?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Wed Dec 18 13:58:02 2024
    On 18/12/2024 10:16, [email protected] wrote:
    On Wed, 18 Dec 2024 09:09:22 +0100
    David Brown <[email protected]> wibbled:
    On 17/12/2024 17:53, [email protected] wrote:
    You don't want a library that only works with the latest bleeding edge
    versions
    of C++. IMO C++ 2011 would be a reasonable oldest version.


    I'd much rather have one that takes advantage of relatively modern C++
    features than one that re-invented these same features in their one
    special ways - which is what you see with these older libraries. I'd

    A lot of companies systems don't have their compilers upgraded if consistency are whats required. A security company I worked at a few years ago only
    went up to C++14 because they didn't want any nasty security hole surprises if they upgraded the compiler and started using the new features (or even the older ones).

    Sure. There are many reasons for not upgrading tools, and/or not
    changing standards - some good reasons, some bad reasons. I have never
    been a fan of upgrading just for the sake of upgrading. But in the case
    of a gui toolkit, I think there is a lot to be gained from more modern C++.


    new, well-designed modern C++ gui library, I'd want to see concepts,

    Ugh. Concepts and constraints are yet another syntatic soup solution to a problem almost no one has except in various academic ivory towers.


    Let's just call that a matter of opinion and move on.

    But if the C++ committee were to make a standard C++ gui library as part
    of the C++ standard, then it would by definition be part of a later C++
    standard. So if it was targeted for C++29, then of course it could rely
    on all the language and library features of standard C++ up to and
    including C++29.

    Well they won't because sensibly they realise graphics capabilities are so variable - or non existent - between systems that there's absolutely no point trying to develop a standard library for it.

    Yes, that's what I have been saying.

    I was surprised they even
    included a threading library given on various embedded systems threading is not available. Plus its inconsistent - why multithreading but no multiprocess?


    Threading in C11 and C++11 was too little, too late. And it doesn't
    take into account the significantly different threading systems used in different OS's. For embedded systems, how is anyone supposed to use a threading library that doesn't handle priorities, stack size, and the like?

    I am not surprised they /tried/ to have a standard thread library. And
    some of it could, I am sure, be useful to some people. But I expect
    most people use system-specific thread libraries in practice.

    I think trying to standardise a C++ gui library would be like
    standardising threading, but orders of magnitude worse.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Wed Dec 18 14:07:38 2024
    On Wed, 18 Dec 2024 13:58:02 +0100
    David Brown <[email protected]> wibbled:
    On 18/12/2024 10:16, [email protected] wrote:
    I was surprised they even
    included a threading library given on various embedded systems threading is >> not available. Plus its inconsistent - why multithreading but no >multiprocess?


    Threading in C11 and C++11 was too little, too late. And it doesn't
    take into account the significantly different threading systems used in >different OS's. For embedded systems, how is anyone supposed to use a >threading library that doesn't handle priorities, stack size, and the like?

    Until 2017 when shared_mutex came along it couldn't even do 3 level locking which would be a deal breaker for a lot of people. Certainly was for me.

    I think trying to standardise a C++ gui library would be like
    standardising threading, but orders of magnitude worse.

    Agreed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Mon Dec 23 09:59:22 2024
    On Mon, 23 Dec 2024 14:32:38 +0800
    wij <[email protected]> gabbled:
    On Sun, 2024-12-22 at 15:26 -0800, Chris M. Thomasson wrote:
    On 12/22/2024 10:50 AM, wij wrote:
    [...]
    I just wrote two program (face_svr.cpp, face_cli.cpp) to test what I th= >ought.
    It looks plausible using C++ to write graphic programs without using an= >y
    graphic library. Dream come true! 'C++ graphics' is possible and easy. >>=20
    Well, sure. PPM's are rather easy to create. :^)
    =20
    Creating OBJ files in C/C++ is rather easy as well.

    For simple GUI, e.g. drawing graph of math. functions, statistics, Mandelbr= >ot
    set,...) is no problem.

    int main() {
    Array2D<Pixel> img;
    draw_mand(img);
    put_image("graphics_server", img);
    zoom_event_handler();
    }

    The solution of C++ graphics (or GUI) is no graphics in C++.

    And that'll work with X windows will it? Where you are setting the display
    IP and screen number or does it just always use the default?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)