Пікірлер
@mrdebug6581
@mrdebug6581 Күн бұрын
bare minimum, but complete for a (first) use ... thank you for the series 👏
@MikeShah
@MikeShah Күн бұрын
@@mrdebug6581 cheers!
@rishi-o3i
@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
@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
@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
@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
@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.
@finlaymetcalfe6360
@finlaymetcalfe6360 2 күн бұрын
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.
@MikeShah
@MikeShah 2 күн бұрын
@@finlaymetcalfe6360 we will eventually texture a quad in this series 🙂
@sam_phys-yz7fr
@sam_phys-yz7fr 2 күн бұрын
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!
@MikeShah
@MikeShah 2 күн бұрын
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!
@tanveerasif5978
@tanveerasif5978 2 күн бұрын
I just finished your design pattern series and learn a lot. Thank you so much for the great content.
@MikeShah
@MikeShah 2 күн бұрын
@@tanveerasif5978 cheers!
@KodokTroll
@KodokTroll 2 күн бұрын
what's your keyboard? it sounds good on the video
@MikeShah
@MikeShah 2 күн бұрын
I have a System76 Heavy
@xealit
@xealit 3 күн бұрын
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
@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.v7998
@a.v7998 3 күн бұрын
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++!
@lightningshark67
@lightningshark67 3 күн бұрын
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?
@MikeShah
@MikeShah 3 күн бұрын
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.randomly2799
@mr.randomly2799 3 күн бұрын
THANK YOU FOR THE NEW UPLOAD MIKE SHAH!!!
@MikeShah
@MikeShah 3 күн бұрын
Cheers!
@kcvinu
@kcvinu 3 күн бұрын
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.
@MikeShah
@MikeShah 3 күн бұрын
Interesting -- thanks for sharing!
@rishi-cl2xr
@rishi-cl2xr 3 күн бұрын
i wanna learn dsa with c++, how much or to which lecture i should watch and practice code, then im able to start DSA?
@MikeShah
@MikeShah 3 күн бұрын
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-cl2xr
@rishi-cl2xr 3 күн бұрын
@@MikeShah i really like the series, thank you so much
@MikeShah
@MikeShah 3 күн бұрын
@@rishi-cl2xr Cheers!
@rishi-cl2xr
@rishi-cl2xr 3 күн бұрын
came here from reddit, lets goo btw which book should i follow along this course? and for problems? please help me out
@MikeShah
@MikeShah 3 күн бұрын
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.
@rontarrant
@rontarrant 4 күн бұрын
It's amazing how often KZfaqrs say, "go ahead and..." Once you notice, it's really hard to ignore.
@rontarrant
@rontarrant 4 күн бұрын
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!
@DoubleDan
@DoubleDan 4 күн бұрын
the best teacher on youtube.
@MikeShah
@MikeShah 4 күн бұрын
Cheers, thank you for the kind words!
@pramodkumarkar6573
@pramodkumarkar6573 4 күн бұрын
So Nice !!!
@MikeShah
@MikeShah 4 күн бұрын
Cheers!
@GaryChike
@GaryChike 4 күн бұрын
The incredibly talented programmer 'Tsoding' recently completed two videos on C3 - one entitled "Programming in C3 to Annoy Zig Programmers!"
@MikeShah
@MikeShah 4 күн бұрын
Indeed, I saw this on Twitter -- I haven't seen the videos yet though.
@aberbaCodes
@aberbaCodes 4 күн бұрын
D:s approach always clean
@MikeShah
@MikeShah 4 күн бұрын
Agreed !
@aberbaCodes
@aberbaCodes 4 күн бұрын
I need to watch more of your videos
@MikeShah
@MikeShah 4 күн бұрын
We're approaching episode 100 soon 😁
@DarenC
@DarenC 4 күн бұрын
5 minutes in, but lack of dark mode is hurting my eyes 😭😭
@MikeShah
@MikeShah 4 күн бұрын
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.
@DarenC
@DarenC 4 күн бұрын
@@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 =)
@MikeShah
@MikeShah 4 күн бұрын
@@DarenC Many of us have been known to code late into the night 😁
@purpletom_yt3138
@purpletom_yt3138 4 күн бұрын
Hey amazing tutorial! Made it so simple! I can finally get a simple understanding on writing coroutines in C++! Keep up the good work! :)
@MikeShah
@MikeShah 4 күн бұрын
@@purpletom_yt3138 cheers!
@guilherme5094
@guilherme5094 5 күн бұрын
👍!
@MikeShah
@MikeShah 5 күн бұрын
Cheers!
@twenty-fifth420
@twenty-fifth420 5 күн бұрын
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*
@romangeneral23
@romangeneral23 5 күн бұрын
It's called Dark Mode. Use it please!!!!
@brucewernick6542
@brucewernick6542 6 күн бұрын
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%.
@MikeShah
@MikeShah 6 күн бұрын
I'll have to do a proper test with optimizations and using the LDC2 compiler in D. I suspect it will be very fast😀
@JumpercraftYT
@JumpercraftYT 6 күн бұрын
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.
@MikeShah
@MikeShah 6 күн бұрын
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.
@JumpercraftYT
@JumpercraftYT 6 күн бұрын
@@MikeShah thanks! Im going to sleep now i think
@kyrsanmora
@kyrsanmora 6 күн бұрын
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)
@bsdooby
@bsdooby 7 күн бұрын
Tcl, the scripting language, is also called "Lisp for the Masses", ...
@MikeShah
@MikeShah 6 күн бұрын
Indeed!
@axthd
@axthd 7 күн бұрын
I wish C3 will be the next systems programming language.
@MikeShah
@MikeShah 4 күн бұрын
Time will tell!
@TimHaga
@TimHaga 7 күн бұрын
Thanks. Did not expect to have another Episode of this great series so fast after the last one. Keep it going Mike!
@MikeShah
@MikeShah 6 күн бұрын
Cheers -- more coming this week!
@farianderson168
@farianderson168 7 күн бұрын
Is there a quick way to initialize raw arrays with a default value? Or we always have to use algorithms?
@MikeShah
@MikeShah 6 күн бұрын
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.
@farianderson168
@farianderson168 6 күн бұрын
@@MikeShah tnx❤
@kyrsanmora
@kyrsanmora 7 күн бұрын
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)
@MikeShah
@MikeShah 6 күн бұрын
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-fifth420
@twenty-fifth420 7 күн бұрын
'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!
@MikeShah
@MikeShah 6 күн бұрын
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 :)
@smaplessmap5355
@smaplessmap5355 7 күн бұрын
Why is it not popular? Is it use srsly anywhere?
@MikeShah
@MikeShah 4 күн бұрын
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.
@smaplessmap5355
@smaplessmap5355 4 күн бұрын
@@MikeShah thx
@francobevacua6573
@francobevacua6573 7 күн бұрын
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 :)
@MikeShah
@MikeShah 7 күн бұрын
Cheers! 3 more videos coming this week in my opengl graphics series 🙂
@V000idZer000
@V000idZer000 7 күн бұрын
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!
@MikeShah
@MikeShah 7 күн бұрын
Cheers! Indeed, works like the unix command 'uniq' removing adjacent values :)
@duncangibson6277
@duncangibson6277 8 күн бұрын
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.
@MikeShah
@MikeShah 8 күн бұрын
@@duncangibson6277 that's where we're heading 😁
@user-qu9pq6sw6k
@user-qu9pq6sw6k 8 күн бұрын
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
@MikeShah
@MikeShah 7 күн бұрын
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/
@TimHaga
@TimHaga 8 күн бұрын
Great lesson. Thanks!
@MikeShah
@MikeShah 8 күн бұрын
@@TimHaga cheers!
@jaycarlson2579
@jaycarlson2579 8 күн бұрын
Your a great teacher!
@MikeShah
@MikeShah 8 күн бұрын
Cheers, thank you for the kind words!
@IsaacC20
@IsaacC20 8 күн бұрын
@28:44 How do you use declspec to check value category of expressions?
@MikeShah
@MikeShah 7 күн бұрын
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
@imteajsaimun4134
@imteajsaimun4134 8 күн бұрын
why don't u use smart pointers
@MikeShah
@MikeShah 8 күн бұрын
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.
@JumpercraftYT
@JumpercraftYT 9 күн бұрын
This is the most w sigma opengl series 🔥
@beholdenspore28
@beholdenspore28 9 күн бұрын
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!
@MikeShah
@MikeShah 9 күн бұрын
Cheers -- episode 36 is hot of the presses today! kzfaq.info/get/bejne/a618YJZz28rKaJs.html
@vanvothe4817
@vanvothe4817 9 күн бұрын
Do you use LSP for navigate code in project?
@MikeShah
@MikeShah 9 күн бұрын
For larger projects I do
@guilherme5094
@guilherme5094 9 күн бұрын
👍
@user-vs7yy7nh9x
@user-vs7yy7nh9x 9 күн бұрын
Define aura : mike shah 🔥✌️
@MikeShah
@MikeShah 9 күн бұрын
Cheers!
@user-hc4we4kb4j
@user-hc4we4kb4j 9 күн бұрын
thinks for the goode video tutorail
@MikeShah
@MikeShah 9 күн бұрын
Cheers!