2019-02-03 11:08:40 (edited by Omar Alvarado 2019-02-03 11:22:33)

Ok ok ok. There's been a lot of this lately but I feel I should ask.
I'm wanting to leave bgt behind, mostly because of the fact it's not being updated anymore, and secondly for it's inability to perform decently these days.
I think what I know best is c++, compared to something like python. Not trashing on python, though c++ is what I feel I would have an easier time with.
I could learn the basics in probably a few days, though I'd like to know what those of you who code in c++ are doing for the following:
Please note, Please only post current working solutions, not solutions that last worked like 10 years ago.
Sound playback, sound pool like behavior would be neat but isn't explicitly necessary. Once I learned how to play sounds good enough I could probably make my own functionality.
Keyboard input. Obviously. Lol.
Timers! Would you believe it? I haven't been able to find a decent example of a timer that didn't cause my head to explode or didn't use the internal sleep function. Because sleeping for 250 ms to run a function is not optimal!
And lastly, compiler. To build my projects into consumer playable things, would prefer to avoid visual studio though if I can't, that's fine too.
Thanks all!

Thumbs up

2019-02-03 13:08:01

SFML seems a good candidate for your use case. The sound system is not probably what you are used to in BGT though, But it has keyboard input sounds etc. You can try SDL2 as well.

There once was a moviestar icon.
Who prefered to sleep with the light on.
They learnt how to code, devices sure glowed,
and lit the night using python.

Thumbs up

2019-02-03 13:28:56

Personally I use SDL2 for keyboard input, displaying my window, and any other input controls I might want like mouse or joystick. If I ever make a large scale game I will roll my own audio solution though. However, FMOD and Bass are good alternatives if you don't mind getting something commercial.

SDL2 has timers. In BGT I used a master timer that updates steadily in the background, and all the individual timer objects are simply integers which store timestamps relating to the global timer so you can compare them against each other. Therefore, each individual timer does not have the overhead of calling upon the OS.

For compilers, I use both MinGW and Visual C++ on a daily basis. Both can be invoked from the command line and are easy to use. For debugging I tend to prefer GDB, which means that you'll generally need to build with MinGW to get the symbols.

Kind regards,

Philip Bennefall

2019-02-03 13:52:36

Regarding using sound, I know libaudioverse can also be used with C++. I have never done so however.

golfing in the kitchen

Thumbs up