int main(){} to game // Creating a window

Поділитися
Вставка
  • Опубліковано 12 лис 2024

КОМЕНТАРІ • 33

  • @aspzx
    @aspzx 2 дні тому +3

    I've been following along by recreating the project in Visual Studio 2022. It took a little while before I figured out how to set the language to C++23 but after that everything worked fine including the debug information in the stacktrace. It might be worth checking out the default config you get when you create a new CMake project in Visual Studio and comparing it to what you're doing.

    • @dieSpinnt
      @dieSpinnt 2 дні тому

      Essential information missing: What compiler are you using (VS can use several!)? What is the version of your compiler? What are the options used? What kind of Subsystem and so on ... :)
      It's important, because std::stacktrace is cutting edge, non production ready tech. Also it may be compiler dependent AND is implemented in the STL. For example, see: STL/issues/1447 "P0881R7 " and cppreference, topic "compiler_support/23": Stacktrace library = MSVC STL 19.34, meaning VS2022 17.4 onwards. GCC 12 has partial support and 14 requires linking against "-lstdc++exp". Others lack implementation, yet.

    • @aspzx
      @aspzx 2 дні тому +1

      @dieSpinnt I don't even know enough to know what compiler I'm using. I just used the project structure given when starting a new CMake project after changing the CXX version to 23.

    • @nathanbaggs
      @nathanbaggs  2 дні тому +1

      Nice you’re following along! Going to have a play around and see if I can get it working

  • @toksic424
    @toksic424 2 дні тому

    Ooh I'm pretty excited for this

  • @ColonDee.
    @ColonDee. 2 дні тому

    Looking forward to the next streams

  • @ferdynandkiepski5026
    @ferdynandkiepski5026 2 дні тому +1

    You shouldn't actually need to copy the compile_commands to the top level directory. Clangd should pick it up when it's in build. At least does for me. Also you can use -Bbuild to be able to configure from the top level directory into the build folder. Then you just run cmake --build build.

    • @nathanbaggs
      @nathanbaggs  2 дні тому

      Interesting, it’s just something I’ve always done automatically but will give it a try. Also good tip for the build, again I’ve just always had a separate window in the build dir

  • @dave7244
    @dave7244 2 дні тому

    I have a flick through this as I was interested to how you would have done it compared to how I've done this in my own OpenGL code. I essentially wrapped the GLFW commands in my own Window object so I could manage the runtime and used a deleter on a shared pointer. I was initially confused why you were handling this yourself but it appear to be something windows specific.
    Win 32 style APIs I find very confusing coming from a C#/Java background and I just avoid them when doing any C++ stuff and use the cross platform stuff. So I would be interested in how you are going to handle that.
    The Cherno has his own OpenGL tutorials and what I found was that it mismatched with how OpenGL worked (especially on how he was handing Index Buffers). So I am interested in how you handle that.

  • @alexsteve647
    @alexsteve647 2 дні тому +2

    Stream was fire🔥🔥🔥

  • @Digitalgems9000
    @Digitalgems9000 2 дні тому

    i will never understand templates i just never will i think. my brain can't comprehend em LOL. iuno how you do it. one smart cookie for sure

    • @chrisnevermorebotha3040
      @chrisnevermorebotha3040 2 дні тому +1

      I hope this helps, templates is just a tool that can make code that has a specific task more generic. for example if you have a function that prints integers you will have to pass in only integers but if you use a template you can pass in floats and strings etc. as well

    • @Digitalgems9000
      @Digitalgems9000 2 дні тому

      @@chrisnevermorebotha3040 i see yeah. my brain just gets lost at the different types being passed in there iuno how to explain LOL

    • @justshinigami9364
      @justshinigami9364 День тому

      @@Digitalgems9000 That may seem that way if you have not worked with templates a lot. Templates are a strong tool if you understand how to work with them. But i do think most people overdo it with them, im at 29:00 and i already think this project will be template hell. Just try to use templates more often in your projects. Start with small things and work your way up. And if you feel confident, try templated classes and inheritance with template classes, there is much to learn from this

    • @dave7244
      @dave7244 День тому

      Learn Generics in C#/Typescript/Python or something similar and then come back to C++ as it makes a lot more sense. Pointers in Go, helped me to understand pointers in C++.

    • @dave7244
      @dave7244 День тому

      @@justshinigami9364 I have to watch this fully one evening, but just flicking through and looking at the code he is making it a bit too complicated. I wouldn't have bothered. Then again I am not as good as C++ as he is.

  • @MegaJohnny74
    @MegaJohnny74 2 дні тому +1

    ​​/Z7 there is a godbolt exemple on stack trace page

    • @nathanbaggs
      @nathanbaggs  2 дні тому

      Doesn't work - I suspect some sort of discrepancy with wine msvc

    • @dieSpinnt
      @dieSpinnt 2 дні тому

      Really, is it so effing hard to give concrete directions?
      Under the cppreference page "basic_stacktrace" (Which Nathan had open), navigate to the "Example" section. First line shows links to msvc and gcc. On the msvc COMPILER EXPLORER (Matt Godbolt ... is the NAME of the creator) example, x64 msvc 19.latest (11. November 2024) is used as a compiler with "/std:c++latest /Z7" options.
      No offense, you don't seem to be a native speaker (I'm not either), but is it too much to ask that you at least provide correct information that makes sense? In no language in the world would your sentence structure and the incorrect information you provide make any sense. You wanted to help people and share your knowledge, am I correct? So you should check the correctness of your information beforehand, to see if it works... or can work at all!!! (Google would be enough. If you type your comment in there... you could spend hours searching helplessly).
      Anyway, this is once again a good example of how "well-intentioned" is usually just poorly executed, or laziness. But thank you, for your "secret" discovery:)
      Also, on my hour long search and thanks to Johnny (thanks again ...) I discovered many bugs and problems with the stacktrace implementation and visualizer of MSVC. This feature may not be production, or even nerd-tryout ready at this time and in no way safe for platform independent use. See stackoverflow topics like "MSVC 2022 Template Build Errors No Compile-Time Strack Trace?"; CppInsights Issue 188, "Crash with stack trace, trying to get insight about std::tuple"; stackoverflow "Is it possible to obtain a stack trace on Windows without PDB files present? If yes, how?" and so on ...
      There are also alternatives, like Cpptrace ("Cpptrace is a simple and portable C++ stacktrace library supporting C++11 and greater on Linux, macOS, and Windows including MinGW and Cygwin environments. The goal: Make stack traces simple for once."), which to use is not the goal of Nathan in this project, but his "The Life and Times of Grizzly Adams" (movie series about a man living in a log cabin alone in the wilderness and is self-sufficient, from the 1977-1978) approach, hehehe.

  • @BboyKeny
    @BboyKeny 2 дні тому +3

    1:56

  • @costindinoiu7440
    @costindinoiu7440 6 годин тому

    1.47.01 Scooby-Doo laugh

  • @abit_gray
    @abit_gray 19 годин тому

    Check one thing for me please - in default constructor of AutoRelease, what value should you pass for T ? {} or Invalid?

    • @nathanbaggs
      @nathanbaggs  8 годин тому

      Good spot. It’s still works as the dtor is empty, but will change it to make it clearer

  • @chrisnevermorebotha3040
    @chrisnevermorebotha3040 2 дні тому +1

    @Nathan is it possible to share your nvim setup to work with c++ ?

    • @dieSpinnt
      @dieSpinnt 2 дні тому

      Yeah, good idea, Chris! How about a -repository with your config preferences and plugins for nvim.
      ... for us lazy folks?
      Thanks in advance, @nathanbaggs!:)

    • @nathanbaggs
      @nathanbaggs  2 дні тому +1

      github.com/nathan-baggs/kickstart.nvim

  • @neonbyte1337
    @neonbyte1337 20 годин тому

    What about std::unique_ptr instead of AutoRelease?

    • @nathanbaggs
      @nathanbaggs  8 годин тому

      unique_ptr models a pointer which is subtly different to what I want. For example I don’t want operator-> and I want a custom invalid value (can’t assume nullptr is invalid for all types)

  • @oguzcanylmazlar
    @oguzcanylmazlar 2 дні тому

    whats the font ?