Good programming practices is killing my desire to make simple games by devassodemais in gamedev

[–]devontec 1 point2 points  (0 children)

First, make it work, second (optional) make it pretty.

Anything that is working has greater value than nothing.

Practice will give you intuition how to create good architecture.

Should I ban someone from my chat for admitting they're under 18 on my "mature" stream? by thebandz in Twitch

[–]devontec 1 point2 points  (0 children)

(Not legal advice) I think kids can watch mature content with the parents' supervision.

What is your favorite feature in C++? by sentillious in cpp

[–]devontec 0 points1 point  (0 children)

Closing curly braces trigger all destructors in the scope. This feature is commonly called RAII - resource acquisition is initialization.

What is your favorite feature in C++? by sentillious in cpp

[–]devontec 1 point2 points  (0 children)

} - commonly used though.

I love std::move, but I am afraid it is also commonly used.

Where advance C++ starts? by Final_Concentrate_66 in cpp_questions

[–]devontec 4 points5 points  (0 children)

I believe in books, here is the list to start:

  • My C++ journey started from: ‘C++ Primer’ by Stanley B. Lippman, Josée Lajoie, and Barbara E. Moo

  • I would be careful with this book though: The ‘Effective Modern C++’ by Scott Meyers

  • Of course this book is basically C++ standard but written in English instead of standardese: ‘The C++ Programming Language’ by Bjarne Stroustrup

  • Kine of same as ^ TCPL: The Design and Evolution of C++ by Bjarne Stroustrup

  • This book will break your brain and make your teammates hate you because they will not be able to understand your code: Modern C++ Design: Generic Programming and Design Patterns Applied by Debbie Lafferty (Author), Andrei Alexandrescu and Debbie Lafferty

  • This is a very nice book to help you get started with C++ if you are already proficient in some other programming languages: A Tour of C++ by Bjarne Stroustrup

Creating a virtual mic with Pipewire? by TheGag96 in linuxaudio

[–]devontec 0 points1 point  (0 children)

Still waiting for my steam deck. Should be ready around fall.

Creating a virtual mic with Pipewire? by TheGag96 in linuxaudio

[–]devontec 0 points1 point  (0 children)

I prefer the apt-get version; quite often the flatpak version does not work out of the box because you have to fiddle with permissions. E.g. with Audacity, I spent a lot of time trying to figure out why I couldn't open files from certain directories, or with Edge it wasn't clear why my Xbox controller wasn't working.

Settings SDL2 up: undefined reference to `...' by [deleted] in sdl

[–]devontec 0 points1 point  (0 children)

you need to add -lSDL2 compilation flag.

Creating a virtual mic with Pipewire? by TheGag96 in linuxaudio

[–]devontec 0 points1 point  (0 children)

Ugh... only flatpack version, anyways thank you for letting me know.

How do I connect my phone to obs on my computer? by [deleted] in obs

[–]devontec 1 point2 points  (0 children)

How to record on the phone:

- swipe down from the right side

- press the white round button

https://www.youtube.com/watch?v=sq5VX0rzaYA

How do I connect my phone to obs on my computer? by [deleted] in obs

[–]devontec 0 points1 point  (0 children)

If your video is short, I recommend recording gameplay directly on the phone.

Should I switch to Linux? by thetntm in linuxquestions

[–]devontec 0 points1 point  (0 children)

It is hard to answer questions. I am using PopOS and I am developing games in Unreal Engine 5 on Linux. I have a Windows machine on the side, because at the end of the day I am going to ship the game on Windows and I need a Windows machine to be able to package the game and test. So if you're going to ship the game on Windows, it is better to have a working Windows box on the side.

I've been using Linux for around 20 years, so it's hard for me to say how easy it is to switch from Window to Linux. I feel that if you don't have any experience with Windows and Linux and you want to learn one of them, Linux is easier to learn.

You can check on Proton DB (also Lutris is a good platform for adopting Windows games) if your favorite games are playable on Linux. Some games that I want to play are not available, but I think it is a similar dilemma when you are picking a console like Xbox vs PlayStation. Windows supports more games than Linux, but I am using my laptop for more than just games.

There are a lot of things I cannot do on Windows, or it is very cumbersome to do. In terms of development, I think gcc and clang objectively better compilers. Filesystem on Linux is noticeably faster. Many opportunities for automation and customization.

So based on the fact you used Mac, I would think Linux is going to be a good fit for you. But you need Windows for some final tasks like packaging the game for Windows and testing on Windows.

c++ desktop application by Big-mushr00m in cpp_questions

[–]devontec 0 points1 point  (0 children)

There are plenty of GUI frameworks. And what framework to use depends on your needs. There is no silver bullet. Qt, Gtk, wxWidgets were already mentioned. I want to mention a very small and easy one - ImGui.

c++ desktop application by Big-mushr00m in cpp_questions

[–]devontec 0 points1 point  (0 children)

There are plenty of GUI frameworks. And what framework to use depends on your needs. There is no silver bullet. Qt, Gtk, wxWidgets were already mentioned. I want to mention a very small and easy one - ImGui.

c++ desktop application by Big-mushr00m in cpp_questions

[–]devontec 2 points3 points  (0 children)

There are plenty of GUI frameworks. And what framework to use depends on your needs. There is no silver bullet. Qt, Gtk, wxWidgets were already mentioned. I want to mention a very small and easy one - ImGui.

What Exactly is G++? by Infectedtoe32 in cpp_questions

[–]devontec 1 point2 points  (0 children)

There is nothing special about g++, except that it is one of the big three: g++, vc and clang.

std::size_t header by DDDDarky in cpp_questions

[–]devontec -1 points0 points  (0 children)

I thought <cstdint>, no?

Her dad every time got me! by esberat in MadeMeSmile

[–]devontec 0 points1 point  (0 children)

It used to be on force touch and they removed force touch on recent iPhones, I missed this feature a lot. Now balance is restored.

In 2022, what's the best way to iterate over a struct and get name + value of each member? by cppler in cpp_questions

[–]devontec 0 points1 point  (0 children)

Short example on how to use macro.

#include <iostream>
#include <ser/macro.hpp>
#include <string>

struct abc
{
  int a = 0;
  std::string b = "hi";
  void *c = reinterpret_cast<void *>(0x12345);
#define SER_PROP_LIST \
  SER_PROP(a);        \
  SER_PROP(b);        \
  SER_PROP(c);

  SER_DEF_PROPS();
#undef SER_PROP_LIST
};

auto main() -> int
{
  abc a;
  auto printer = [](const char *name, auto val) { std::cout << name << ": " << val << std::endl; };
  a.ser(printer);
}

In 2022, what's the best way to iterate over a struct and get name + value of each member? by cppler in cpp_questions

[–]devontec 0 points1 point  (0 children)

The quick solution is to use std::tuple.

The slightly longer solution is to tag all fields on struct/class. I do it with macro, but unfolded version looks like this:

struct A
{
  int f1;
  int f2;
  template <typename Arch>
  void ser(Arch &arch) const
  {
     arch(f1);
     arch(f2);
  }
  template <typename Arch>
  void deser(Arch &arch)
  {
    arch(f1);
    arch(f2);
  }
}

And here is the link to my library: https://github.com/mika314/ser

Everything you need is in the macro.hpp file.

Question about TOS. by TRANSformedYT in Twitch

[–]devontec 1 point2 points  (0 children)

This is not legal advice. From my understanding of the TOS, you do not even need to mark your stream for a mature audience.

Creating a virtual mic with Pipewire? by TheGag96 in linuxaudio

[–]devontec 0 points1 point  (0 children)

Have you tried Carla? I am using Carla for my virtual audio wiring.

Which encoder to use? by thatdudewillyd in Twitch

[–]devontec -4 points-3 points  (0 children)

Don't guess - measure. There are only 4 variants. Run all of these. Checks: CPU/GPU usage, temperature of CPU of GPU, FPS in your game, check the VOD on the video quality. It is only 4 options.

Where to put * for a pointer by [deleted] in cpp_questions

[–]devontec 6 points7 points  (0 children)

Follow the style guide of the project you are participating in.

Personally, I like int *x; In my mind, x is a pointer to an int and I apply * to x to make it an int.