toad.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server operated by David Troy, a tech pioneer and investigative journalist addressing threats to democracy. Thoughtful participation and discussion welcome.

Administered by:

Server stats:

211
active users

#sfml

1 post1 participant1 post today

Трогаем Синглтоны в C++
Проект: #dungeon_archeology

Немного нагружу предысторией. Dungheon Archeology - это мой проект за 2 семестр по плюсам. Т.к. я ленивая жепа, то я заговнокодил его за 24 часа. Сейчас же я переписываю его, чтобы это чудо выглядело прилично.
Сама игра написана на C++ с использованием SFML 2.

Решил попробовать такой паттерн, как Singleton (я о нем знал раньше, но особо не использовал). Решил реализовать менеджер сцен. Спрятал в приватную область конструктор с деструктором, а для доступа к классу написал вот такой метод (см картинку)
Ну и дальше обращаюсь к нему через SceneManager::GetInstance()

Люди, которые знают C++, насколько такой способ правильный?? Поделитесь опытом)
Репо для тех, кому интересно: github.com/Befrimon/DungeonArc

Did you try #DeerPortal 🦌💎and why don’t you like it?
It is a board game driven by a 🦌 Deer god and classical elements 🔥 💦 💨 🌍

#DeerPortal #GameDev #update #sfml #osx #linux #linuxgaming #freesoftware #FOSS #FreeGame #opensource

Most comments which I received and some reviews which I was reading were clear that nobody had a clue what is happening during the game in the context of the cards. I added a simple overlay text, will replace later with some proper graphic for UI, but for now it explains actions after taking the cards.
github.com/deerportal/deerport @sfml

I made a video last week (scheduled to release *next week*) looking at SFML 3.0rc release candidate vs. SFML 2, Allegro 5 vs. Allegro 4, and SDL 3 vs. SDL2. Just had to re-edit the video to mention the 3.0 launch and reupload. Still will be out next Saturday. ^_^;

I've been thinking about SFML3 so much since making this though and am so hyped to update my chalo-engine next year. :3

#Allegro#SDL#SFML
Replied in thread

@bagder Are those de-duplicated? How are dealing with push vs PR builds?

#SFML is currently getting ~100 builds, but on a PR it's always duplicated because we can't (easily) get GitHub Actions to ignore PR if it also runs for push.

Cross-platform, cross-language development is quite tedious... 🙃

You need to wait for builds to finish, then test on three different OS with different ways to load things.

At least with a Windows machine, you get a Linux environment via WSL2 for free, although it doesn't launch via dotnet run.
And finally you also need access to macOS somehow.

But it's quite satisfying seeing the library build automatically on all the different configurations: github.com/SFML/CSFML/pull/249

GitHubAutomatically Create a CSFML NuGet Package by eXpl0it3r · Pull Request #249 · SFML/CSFMLBy eXpl0it3r
#SFML#cpp#c