bare minimum, but complete for a (first) use ... thank you for the series 👏
@MikeShahКүн бұрын
@@mrdebug6581 cheers!
@rishi-o3iКүн бұрын
im confused if we use return inside a function, how to call it? and when we use printf/cout inside a function, then how am i supposed to call it?
@twenty-fifth420Күн бұрын
Whenever Mike comes back making d videos, I cant wait to see generic programming for structs/classes to meet our templates and other future metaprogramming techniques! For now though, I wait as this video will ease the withdrawals.
@thewelder3538Күн бұрын
You've demonstrated the EXACT reason why auto is a bad idea when used in such ways. Now I've been coding a VERY long time and the first thing my brain asked when you got that compilation error was... Well, what type is print expecting? Okay it needs to be constexpr, but what is its type?!? As an example, what is the type of format1 and format2? Are we used supposed to guess? Come on man, you're supposed to instructing people, not showing them how to write unintelligible code. It should be immediately obvious what the first argument to std::print is.
@MikeShahКүн бұрын
Thanks for the feedback, what is the timestamp? Using 'auto' is fine sometimes, probably varies on team culture on how it's used. format_string is a somewhat nasty alias, so I would probably recommend auto versus the underlying type: en.cppreference.com/w/cpp/utility/format/basic_format_string The comment section is otherwise useful for exchanging ideas, I'm curious if your team has any philosophy around auto?
@thewelder3538Күн бұрын
@@MikeShah the timestamp is 06:02. You used auto for the format strings, but it's absolutely not apparent what those types actually are. Which means, that when you had that compile error, someone with less knowledge would struggle to figure out what was wrong. Now I've been coding a long time, so I reckon auto probably defaulted to something like: const char* const format1 = "{} {}"; But as you can see, I'm literally just guessing because I've no idea what auto created for those types. That's the problem. I've no problem with auto being used in certain scenarios etc, especially to shorten declarations, such as: std::vector<uint8_t>::const_iterator iter = blah.begin(); Because in the above, it's obvious what iter is going to be if you removed that long type definition because it's equal to begin() which returns an iterator. However, where you used auto, you've no idea what the type is. It could be a char array or anything. In fact, if you'd been explicit with your type, you might not have made the mistake of not making it constexpr. As for my personal opinion of auto, it's this... Being explicit is in the majority of cases better than using auto. Firstly, someone can immediately see what the type is without having to guess what auto is going to generate. Secondly, if a type ever changes auto could hide that error from you. Being explicit would generate a compile time error whilst with auto it might compile and now you're having to do some serious debugging. Lastly, I've found myself recently working on a really old codebase where there is no constexpr or auto and although this video is focusing on C++ 23 features, an explicit declaration would have compiled on any C++ standard. Auto serves a purpose, sure, but I tend to use it ONLY when it's completely clear what type it's going to yield and there's no risk of it being mutated into something else.
@finlaymetcalfe63602 күн бұрын
Hi Mike hope you are doing well! I am following along this series as I have come to a roadblock working on my SDL2 application. I wanted to add shading to a SDL_Texture/Surface. I've come to find that SDL2 renderers do not support gpu shading. I'd be interested in seeing if you have any tutorials covering encapsulation of different opengl renderables? E.g. TexturedRectangle from your sdl2 series.
@MikeShah2 күн бұрын
@@finlaymetcalfe6360 we will eventually texture a quad in this series 🙂
@sam_phys-yz7fr2 күн бұрын
Fantastic series, still really enjoying it, thank you so much! I have a small comment (I'm a physicist and therefore it bugs me ;) ) : the 45 refers to degrees, not radians. Greetings! Ah and ps. you inspired me to make my own series on molecular dynamics simulation of H2O (using the Julia language), see my channel if u are interested. Thanks Mike!
@MikeShah2 күн бұрын
Indeed, I think you might be right -- GLM flipped these at some point -- I think it was radians by defualt, or I had otherwise defined them as such: glm.g-truc.net/0.9.4/api/a00151.html#ga283629a5ac7fb9037795435daf22560f . Very nice job on the new series!
@tanveerasif59782 күн бұрын
I just finished your design pattern series and learn a lot. Thank you so much for the great content.
@MikeShah2 күн бұрын
@@tanveerasif5978 cheers!
@KodokTroll2 күн бұрын
what's your keyboard? it sounds good on the video
@MikeShah2 күн бұрын
I have a System76 Heavy
@xealit3 күн бұрын
my understanding, if you want to add normals to the mesh (to make lighting for example) and want to have minute control of them (e.g. to have sharp edges sometimes), you basically have to skip the indexed buffer and pass each vertex multiple times: once per facet. You could calculate the normals with geometry shader. But everyone on the internet seems to recommend to just pass a large vertex array, with duplicated vertices. The internet says it is typically faster, it uses more memory but that's not a big concern, and you can have 3 different normals per a triangle, instead of only 1 per vertex with indexing or 1 per triangle calculated by the geometry shader. With 3 different normals, the fragment shader should be able to interpolate them and create an impression of a bent surface.
@MikeShahКүн бұрын
Indeed, that is correct! Because say a corner of a cube for example, each vertex will be a part of 3 faces, thus need 3 unique normals for each face. Many tools will otherwise give the option to 'average vertex normals' and just emit one normal per-vertex, but it just depends on what type of lighting you need.
@a.v79983 күн бұрын
I have Been Trying really hard to learn SDL2 from the documentation with C! I have made one game Successfully (all by myself) without watching tutorial, just Refering Documentation! But Making a Bigger game is was more of Struggle! I like Learning by doing and Failing at things rather than Following along on KZfaq projects! Thanks for the resources! Now I decided to Learn OpenGL with C++!
@lightningshark673 күн бұрын
Only recently found your channel but been loving the content! I also wanted to ask, I always see the "Ph.D" at the start of the video and was wondering if you've ever covered what your Ph.D is in?
@MikeShah3 күн бұрын
Cheers! I have not -- it was a mix of visualization tools and program analysis. I have some videos of LLVM burried away on my channel somewhere that provide introductions to some of the program analysis stuff for getting started otherwise.
@mr.randomly27993 күн бұрын
THANK YOU FOR THE NEW UPLOAD MIKE SHAH!!!
@MikeShah3 күн бұрын
Cheers!
@kcvinu3 күн бұрын
Nim is a nice language but I found there are some draw backs in Nim. There is no concept of package. If you are a library developer you need to redesign your project and eventually lose some nice features. But there are workarounds in Nim though. I would like to try something in Nim without GC. All my nim projects are using GC.
@MikeShah3 күн бұрын
Interesting -- thanks for sharing!
@rishi-cl2xr3 күн бұрын
i wanna learn dsa with c++, how much or to which lecture i should watch and practice code, then im able to start DSA?
@MikeShah3 күн бұрын
Working through this series will get you started with the language. Later on we work with the 'STL' containers which are data structures and the 'STL' algorithms. As of now, I do not have a Data Structure and Algorithm (DSA) series -- but I am planning one in the future.
@rishi-cl2xr3 күн бұрын
@@MikeShah i really like the series, thank you so much
@MikeShah3 күн бұрын
@@rishi-cl2xr Cheers!
@rishi-cl2xr3 күн бұрын
came here from reddit, lets goo btw which book should i follow along this course? and for problems? please help me out
@MikeShah3 күн бұрын
Cheers -- welcome aboard! There's no specific book for the series, but I have some recommendations here: kzfaq.info/get/bejne/Z8h_hLdqsNalf6c.html I might recommend either 'Tour of C++' or 'C++ Game Programming' from the video as nice videos to read and supplement what you learn in this playlist, which you can watch in a linear order.
@rontarrant4 күн бұрын
It's amazing how often KZfaqrs say, "go ahead and..." Once you notice, it's really hard to ignore.
@rontarrant4 күн бұрын
Sorry. It's just too much. Can't watch a video where every few seconds someone says, "go ahead and..." It's far too distracting!
@DoubleDan4 күн бұрын
the best teacher on youtube.
@MikeShah4 күн бұрын
Cheers, thank you for the kind words!
@pramodkumarkar65734 күн бұрын
So Nice !!!
@MikeShah4 күн бұрын
Cheers!
@GaryChike4 күн бұрын
The incredibly talented programmer 'Tsoding' recently completed two videos on C3 - one entitled "Programming in C3 to Annoy Zig Programmers!"
@MikeShah4 күн бұрын
Indeed, I saw this on Twitter -- I haven't seen the videos yet though.
@aberbaCodes4 күн бұрын
D:s approach always clean
@MikeShah4 күн бұрын
Agreed !
@aberbaCodes4 күн бұрын
I need to watch more of your videos
@MikeShah4 күн бұрын
We're approaching episode 100 soon 😁
@DarenC4 күн бұрын
5 minutes in, but lack of dark mode is hurting my eyes 😭😭
@MikeShah4 күн бұрын
Sorry about that -- one reason I do keep my terminal dark is to help ease on the eyes. I think everyone has different preferences on this though.
@DarenC4 күн бұрын
@@MikeShah to be fair, it was made worse because I was watching at 11pm or so in the dark. I'll give it another go in daylight and I expect it'll be better =)
@MikeShah4 күн бұрын
@@DarenC Many of us have been known to code late into the night 😁
@purpletom_yt31384 күн бұрын
Hey amazing tutorial! Made it so simple! I can finally get a simple understanding on writing coroutines in C++! Keep up the good work! :)
@MikeShah4 күн бұрын
@@purpletom_yt3138 cheers!
@guilherme50945 күн бұрын
👍!
@MikeShah5 күн бұрын
Cheers!
@twenty-fifth4205 күн бұрын
0:55 I love how Khronos keep their old OpenGL stuff up. This, along with I think general shading practice with 'LearnOpenGL' is how I got started. Once you see the graphics API as a 'pipeline', it almost feels like a recipe. Even if you made a bad recipe, cook again. You might be surprised how far you can get with this staging. *coughs shadertoy*
@romangeneral235 күн бұрын
It's called Dark Mode. Use it please!!!!
@brucewernick65426 күн бұрын
When I first saw this, I was impressed. This D language looks really fast. I generated 2 random double matrices 250x250 and multiplied them. As you show, it was fast. But then, I wrote the same thing in Delphi 2010 and it was faster by 15%.
@MikeShah6 күн бұрын
I'll have to do a proper test with optimizations and using the LDC2 compiler in D. I suspect it will be very fast😀
@JumpercraftYT6 күн бұрын
LETS GOOOO 23 HOURS AGOOOO.. wait a sec i gotta "sleep" soon and "focus" on sleeping, totally not gonna use my phone. also, if I watch this video without following along, will I still like learn new stuff? cause im away from my pc rn.
@MikeShah6 күн бұрын
I think so -- the next few videos are about code refactor -- so how we go from a 'triangle' to start building a framework for more general purpose use.
@JumpercraftYT6 күн бұрын
@@MikeShah thanks! Im going to sleep now i think
@kyrsanmora6 күн бұрын
I think the best book is smth like "Metaprogramming in Ruby", about eigenclasses etc. Ordinary stuff does not show it and it looks basically like Python per se, but its actually incredible dynamic language, I remember to constantly write my own little sub-languages in ruby. I don't think Python allows it, and its actually strange how fast for what it does it can run comparably to Python and PHP, some crazy c vm wizardy)
@bsdooby7 күн бұрын
Tcl, the scripting language, is also called "Lisp for the Masses", ...
@MikeShah6 күн бұрын
Indeed!
@axthd7 күн бұрын
I wish C3 will be the next systems programming language.
@MikeShah4 күн бұрын
Time will tell!
@TimHaga7 күн бұрын
Thanks. Did not expect to have another Episode of this great series so fast after the last one. Keep it going Mike!
@MikeShah6 күн бұрын
Cheers -- more coming this week!
@farianderson1687 күн бұрын
Is there a quick way to initialize raw arrays with a default value? Or we always have to use algorithms?
@MikeShah6 күн бұрын
You can always make a raw array 'static' to zero-initialize it, as that memory needs to be reserved. I haven't covered 'constinit' yet, but that can be helpful to gaureentee static initialization. Otherwise, the use of 'constexpr' can shine here for compile-time execution, and filling in your array :) Perhaps this is a separate video in the future.
@farianderson1686 күн бұрын
@@MikeShah tnx❤
@kyrsanmora7 күн бұрын
Hey thanks a lot for a great series! It would be cool to see video about memory arenas style if programming in c, and how you can basically create stacks for yourself dynamically, or at least its how I understood it)
@MikeShah6 күн бұрын
Cheers! That's a nice idea -- I have some materials on this for C++, so I can consider a video like this in the future
@twenty-fifth4207 күн бұрын
'Mesh' and 'Uniforms' are my favorite words in graphics programming because as unintuitive as other concepts such as 'vertex shaders' or maybe even stuff like vectors/matrix... In fact, I think these are the words most gamers will often refer to generally, that is how powerful the word is!
@MikeShah6 күн бұрын
Agreed -- mesh is something most folks know. Neat if non-programmers are also learning uniforms, they're way ahead of me when I was just playing games then :)
@smaplessmap53557 күн бұрын
Why is it not popular? Is it use srsly anywhere?
@MikeShah4 күн бұрын
C3 as I understand is still under active development. There may be projects using C3, but have not otherwise disclosed -- sometimes it's a competitive advantage not to give away your toolstack for companies.
@smaplessmap53554 күн бұрын
@@MikeShah thx
@francobevacua65737 күн бұрын
Thanks a lot Mike! I've always been really interested in graphics programming but I didn't know where to start. This resources seems to be very nice for starting. I hope you make more videos about this topic :)
@MikeShah7 күн бұрын
Cheers! 3 more videos coming this week in my opengl graphics series 🙂
@V000idZer0007 күн бұрын
What I missed in this one is the fact that std::unique does not make the range unique. It only removes consequite duplicates, hence the cppreference example was sorted. The first example only worked because the original array was sorted. Still this series is just awesome!
@MikeShah7 күн бұрын
Cheers! Indeed, works like the unix command 'uniq' removing adjacent values :)
@duncangibson62778 күн бұрын
A much clearer approach to the matrix multiplications needed to place objects than other basic tutorial courses which the waters by adding the camera class after the fact. I'm looking forward to an explanation of modelling a hierarchy of objects with cumulative modelling transformations which the other tutorials only hint at.
@MikeShah8 күн бұрын
@@duncangibson6277 that's where we're heading 😁
@user-qu9pq6sw6k8 күн бұрын
Hi Mike. Could you suggest some good Books, Courses, Videos to study Embedded C/C++ for IOT development including RTOS? I'd like to get into it
@MikeShah7 күн бұрын
Unfortunately I have not done much in the embedded space in some time. There's a specific conference for C++ and embedded space that otherwise has resources: embo.io/
@TimHaga8 күн бұрын
Great lesson. Thanks!
@MikeShah8 күн бұрын
@@TimHaga cheers!
@jaycarlson25798 күн бұрын
Your a great teacher!
@MikeShah8 күн бұрын
Cheers, thank you for the kind words!
@IsaacC208 күн бұрын
@28:44 How do you use declspec to check value category of expressions?
@MikeShah7 күн бұрын
There's a trick you can use with templates to get the decltype of a type. See stackoverflow.com/questions/16637945/empirically-determine-value-category-of-c11-expression
@imteajsaimun41348 күн бұрын
why don't u use smart pointers
@MikeShah8 күн бұрын
It's an attempt to manage the 'noise' in learning the graphics API. Many folks are also following along this series in other languages that do not use unique_ptr 🙂Perhaps towards end of series I will do a larger refactoring to modernize the code.
@JumpercraftYT9 күн бұрын
This is the most w sigma opengl series 🔥
@beholdenspore289 күн бұрын
You keep making these and I'll keep watching them guaranteed. This is the #1 opengl series for my learning style. Thanks for making them!
@MikeShah9 күн бұрын
Cheers -- episode 36 is hot of the presses today! kzfaq.info/get/bejne/a618YJZz28rKaJs.html