[SDL2] UI project in C

Hi Nathaniel,

I would be happy to join your project, however… I have my own. For SDL 1.2 I created and published a GUI toolkit called SDL-Widgets, and I used it for several of my own projects. I’m redesigning it now for SDL2, which is ‘interesting’ because SDL2 is a totally different beast compared to SDL 1.2, at least if you want to use hardware acceleration too.

By the way: why do you want to use C? C++ is so much easier and more robust.

wboe

I pre-emptively suggest that any discussion on this point is taken off list ;)…On Thu,? 6 Sep 2012, 08:00:20 BST, wboe <w.boeke at upcmail.nl> wrote:

By the way: why do you want to use C? C++ is so much easier and more
robust.

You making this cross platform? If so I could probably help out a bit on OSX and iOS

Nathaniel J Fries wrote:> A few days ago I started writing a UI library for SDL2 in C.

I’m not typically a C programmer, can only test on Windows, and work full-time; so development would go painfully slow on my own. I figured I’d reach out and see if anyone else wanted to assist.

I have created a project on SourceForge: https://sourceforge.net/projects/sdlui/

By the way: why do you want to use C? C++ is so much easier and more
robust.

wboe, you’ll probably find that many people do not like C++ because it
generally means less control over how the code is executed, and if you keep
going to C#, it’s even worse. C++ may give you classes and polymorphism,
but these things are simple enough to emulate in C.

-Alex

Hi

Although Tim Agnus seems to dislike it, I stil want to reply to Alex.

wboe, you’ll probably find that many people do not like C++ because it generally means less control over how the code is executed, and if you keep going to C#, it’s even worse. C++ may give you classes and polymorphism, but these things are simple enough to emulate in C.

Don’t forget that you can write pure C code in a C++ program, so no less control. You also could avoid exceptions and STL constructs. Of course you can emulate classes and polymorphism in C, but your code will be a lot messier then needed, see e.g. gtk and even SDL. At that there is one modern feature in C++ that is very convenient for a toolkit designer: lambda functions. You can specify them in the parameter list of functions and constructors, and you don’t have to invent function names for them. When you understand C++, then writing C feels like being double left-handed!

Regards,
wboe

It really depends on the programmer. Many programmers are left-handed and
would thrive with two left hands!

Jonny DOn Thu, Sep 6, 2012 at 9:11 AM, wboe <w.boeke at upcmail.nl> wrote:

**
Hi

Although Tim Agnus seems to dislike it, I stil want to reply to Alex.

Quote:

wboe, you’ll probably find that many people do not like C++ because it
generally means less control over how the code is executed, and if you keep
going to C#, it’s even worse. C++ may give you classes and polymorphism,
but these things are simple enough to emulate in C.

Don’t forget that you can write pure C code in a C++ program, so no less
control. You also could avoid exceptions and STL constructs. Of course you
can emulate classes and polymorphism in C, but your code will be a lot
messier then needed, see e.g. gtk and even SDL. At that there is one modern
feature in C++ that is very convenient for a toolkit designer: lambda
functions. You can specify them in the parameter list of functions and
constructors, and you don’t have to invent function names for them. When
you understand C++, then writing C feels like being double left-handed!

Regards,
wboe


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I think this is why there was a preemptive request to move this off-list :slight_smile:
The hardcore on each side are just not going to agree which language is
the best. Better to just avoid the discussion entirely.

BTW, I feel that C++ is more suited to GUI-related stuff, but that C has
its place too. I use both, but I never emulate C++ in C; in that case you
might as well just use C++.

SAOn September 6, 2012 10:52:38 AM Jonathan Dearborn wrote:

It really depends on the programmer. Many programmers are left-handed
and would thrive with two left hands!