This Release is Insane!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
looks like we're live hello everyone and welcome to yet another recreational programming session with Ausin let's make a little bit of an announcement and officially start the stream so let's do red circle live on Twitch and what are we doing today on Twitch at do at television website today uh we are migrating to R uh 5.0 that's right I'm going to give the link to where we doing all that uh twitch.tv/ toing and I'm going to Ping everyone who's interested in being pinked and there we go the stream has officially started the stream has officially started so uh essentially recently um rayap 5.0 came out right so thank you so much rayan for working tirelessly uh on this release tirelessly on this release and I suppose it's a major release and as far as I know if I have any experience in software development that that means the shed may break right the shed may break so essentially in Sim ver right so if you if you hear about sver I don't know if rip actually um follow with semantic versioning right so but usually the conventional wisdom is you have a major version and minor version right and essentially the minor versions are Backward Compatible and you um Reserve backward incompatible changes for the major right so uh as soon as you increment this number usually that means that the may break and you need to be aware of that so because of that I decided to spend like um dedicate an entire session just going through maybe what was introduced in R what was changed in R and also migrating our application uh Mizer the music visualizer to this uh specific version and we kind of want to do that because there's a variety of bugs that people reported that are related to R so and as far as I know uh some of those bugs were actually fixed in the in the latest rip release uh right so essentially if we manage to M rate to rip 5.0 we get those fixes for free essentially uh right so um I'm going to give the link to to the releas in here so it's already in the chat uh right so the bot already automatically sent the message right thank you who actually set today right and for people on uh on YouTube it's going to be in the description I'm going to put everything in the description so essentially today is a Mizer stream uh right but as part of the mutualized stream we're going to be looking at R 5.0 so that's basically the plan for today all right so uh here's the release of R 5.0 right so let's take a look at what we've got in here so as far as I know they kind of restructured the uh the whole architecture right so now you have several plat platforms um so it it became easier to actually add more platforms if I understood correctly uh so and JFW which they used as the sort of like an initializer for open JL now became as a separate separate platform so and because of that to test the entire architecture they added sdl as another platform so you can use sdl as open jail initializer instead of jail of W so people are complaining about bit rate this is probably because there's a lot of text in here I don't know how to combat bit rate I can increase the text does does it help with the bit rate so hopefully that helps with the bit rate uh so yeah essentially they they added sdl and stuff like that I'm sure if I'm going to be using sdl to be fair kind of I thought array leap is basically new sdl right I thought they are on the the same level so I I'm not sure if I'm going to be using it and if I correctly they edit it as a proof of concept right so just to demonstrate how the new architecture works and how easy it is to add sort of new platforms new sort of like backends for this library right so it's not like they this is sort of like they encourage you to use it's just like a demonstration right if you need it for example they also have a Nintendo switch back end uh which is close Source right so Ray leap so you can develop like games for Nintendo switch using Ray leap uh uh right so but due to licensing they they they couldn't actually release this entire thing so it's actually kind of interesting uh classic Nintendo classic Nintendo am I right uh so splines drawing evaluation API okay so I don't really need splines uh like quadratic bizier and cubic bizier and if I needed to be fair I would probably implement them myself uh right but it's it's nice to know that uh now we have them right so it's nice to know that we have them so the random number generator okay so it's not like this is rust right but I mean um I don't know maybe like specific sudo random number generators are important for game development they surely important for cryptography right so for cryptography for instance you wouldn't use a standard random number generator uh but for the game development if I understood correctly right quite often game developers like like to use very specific random gen uh random number generators for specific particle effects for instance right specific particle effects I I remember reading some articles uh from Jonathan Blow about braid how he developed braid and stuff like that and if I remember correctly he designed a specific random number generator for the like Cloud particle effects to make them like easily scrollable back and time time right so he crafted a very specific random number generator for for this kind of effects uh right so and I suppose the the standard C random number generator is not going to be suitable for that particularly um so automated event system API oh uh so for the Benny Hills test right so I suppose for the Ben his uh so R for the official r immediate mode guy Library oh Ray GOI we don't use uh Ray GUI uh we actually kind of developed our own like immediate guy library for the uh for the visualizer I can actually show you right so let's actually take a look so let me start the visualizer all right so because I wanted a very specific look and feel uh very specific basically Discord Discord look and feel um right so I'm going to just put it in here so yeah we're basically developed our own gu library that allow allows us to do these kind of things uh right as you can see it's it's basically custom elements and stuff like that so you can actually move around in here uh it's pretty cool uh it's pretty epic in my opinion you can mute this entire thing and stuff like that it's pretty it's pretty nice so this is our own uh UI Library I I don't think we're going to be using rayi I don't think we're going to be using rayu uh Ray web example functionality and I don't really think we need uh web right now so so the biggest uh R leap update in 10 years so would you look at that the biggest R leap update in 10 years I wonder how many things are going to break I really wonder how many things are going to break and by the way uh I was in contributors look at that so I made my first contribution and look at that the the uh po request 3434 so we can actually take a look what what exactly contributed I didn't really contribute anything particularly interesting or special I just addit a new function to set the master sound because it was kind of missing so I just like extended like edit one method so uh I didn't think I contributed a lot right but I actually extended public API I made changes not internally but public API changes the these are quite dangerous changes mind you right because if you're making changes to the public API you making a commitment you making a commitment because now you're supposed to uh support that API otherwise you're going to break uh the the the users of those API right and look at that I extended API and now rayan is the one who's going to support it from now on I mean it's actually pretty trivial thing so I didn't think it's that difficult to support it but I mean welcome to open source welcome to open source um is this the react fan club yes we're all like to like to program in react in here uh we really like reacting here and writing reactive application um okay so let's go ahead and just maybe download the source code and try to build it right so there was already pre-build binaries and stuff like that uh but I think I'm going to be uh you know building this entire stuff from scratch so I'm going to just like copy the address in here and I think there is a problem with downloading this thing with uh WG so it's better to actually click on it like that uh so is it downloading is it doing things apparently it is doing thing it's not I hope it's not going to take too long so it's already 6 megabytes why is it taking so much time I honestly don't know show all the downloads okay uh look at this speed violence momentum what the is going on can I maybe cancel this and retry it again maybe it will actually connect to a different server which is a little bit it cannot retry that um that is bizarre sodan is technically in Europe isn't it uh I'm technically in Asia like I'm in Asia so I'm on an Asian oh the classical it didn't even resume immediately and now it's downloading it twice software in 2023 I swear to God why is it so up Russian AP throttle maybe maybe there are tht uh so but the interesting thing is that usually it it happens like that right so usually it happens so I don't think it's that big of a deal uh do we have R de I don't see R in here oh because I canceled the download so H oh boy so we can try to maybe copy uh this entire thing uh so visualizer uh is it better is it better like that oh that's that's a worst idea um if it's not going to help if it's not oh now it is okay all right now it is working if if I do that with WG it is working fine but it didn't rename the archive right so here is the funny thing like this is something that I can't get over um like about GitHub so the URL is just the version tar gz it's just the version tar gz which is kind of weird but okay when you click on it when you click on it it actually starts downloading this thing but it renames it to a proper name right when you when you click it but if you download it with WG it still keeps it as 5.0 tar gz why is it doing like that like I mean I know that majority of people don't care but these kind of small details piss me off to like to no end like why is it acting like that and here's the thing it's been acting like that for as long as I can remember GitHub they they never fixed it it was always like that why it is like that it's just it is so weird was like what the is going on uh the file name is in the header oh okay so I suppose you need to maybe so WG doesn't accept the haters or doesn't doesn't process them or something like that but it's just like and yeah when I download it by clicking clicking it it's kind of throttled right so I can just try to download it one more time and we can clearly see that the speed is basically throttled right so it's not very fast but if I do that with wble get it's actually way faster and I already finished it so no anyway uh software in 2023 software in 2023 I swear to God okay so let me rename it myself right so and I suppose the first thing we need to do we're going to do unboxing we're now unboxing Channel I'm unboxing the new release uh yeah there we go okay so we just unboxed a new release of R 5.0 isn't that PO I think that's pretty progress okay let's go into the folder all right looks as usual uh so shed ton of different building options because uh people want to contribute something right they feel an urge to contribute something they can't really contribute anything useful so they cont I mean I'm joking I'm always a joke so um yeah so as far as I know rayan himself uses make files right so he created just make files and all the rest of the building options like C Zig and stuff like that they were contributed by other people so but make files is the official thing um so I suppose we can try to Simply go ahead and maybe just do the make uh I'm not sure if it's a good idea I never actually tried make files in here so I'm not sure how it going to work okay so it's doing something we are compiling the first module which is our core so this is the core of this thing okay so Ray shapes uh our texture so so far everything is familiar so this is the modules that we seen in the previous release in 5 point in 4.5 right so yeah so R text okay so I don't remember if we had R text before RG lfw okay so G Source redefined uh so some notes our models okay so this is for 3D models and stuff like that okay okay uh anything else anything else our audio very very important because we're doing audio so where what's going to be the next one I wonder if it's going to build uh sdl though I wonder if this is something that is going to build our audio is probably like a very heavy module as you can see it is a very heavy module it's still building it okay so it exploded with uh you know warnings and stuff like that and it finally build a static executable right so rief static Library generated r. a in uh SRC okay so here is the final thing that we have in here so it didn't really build uh okay so it's it's it's really not really useful to open it like that it didn't really build sdl one right it didn't really build sdl module but we can actually look for our sdl is there something our okay so there there are platforms um right and I don't really see sdl where is sdl I don't see sdl are there is rgf W but I don't see sdl where is it I don't see it what the hell is going on can we just grab this entire thing and see where is this DL so oh here okay so uh PL forms R call uh oh okay I see I see roree desktop sdl so I feel like it's by default not really um you know build um and it's there's probably some sort of flag that enables the sdl back end right so we use external glfw uh platform desktop if platform is one of those things um um okay so there is a variable called platform and okay by default the platform is platform desktop right and I suppose there's a platform desktop sdl so if you want to build a different platform you have to probably say platform equal platform desktop sdl if I understand how like make files work by the way this is my first unfiltered reaction uh and boxing of rayap 5.0 like I have no idea what to expect we could expect anything we could even expect Ray San 5 himself jumping out of the SRC folder or something like that we don't freaking know so anyways so let's try to build it with sdl right so we can try to do that so we can do that uh platform uh platform equal platform desktop at sdl so by the way if you want to set uh some sort of variables I wonder if you can I remember some time ago you could said make file variables by providing them as arguments to make like this uh right so platform uh equals platform desktop sdl uh okay so that didn't work we can provide them before that didn't work either okay so the only option that we have in here is maybe providing it like that and then try to do it like that okay so probably it doesn't matter probably it doesn't matter because it didn't detect yeah so it basically build all of the dependencies it didn't detect that something changed in here right so I suppose the thing we have to do we have to do make clean to remove all of these things and only then uh we'll be able to just do that uh and there you go it tried to build sdl and it failed because I don't have sdl I think uh I haven't used sdl for quite some time since I got r i just like don't use sdl anymore uh it's not really needed but we can try to install it right so we can try to install it for the sake of experiment right so uh Le uh let me actually do teames let me actually do teamuk and I'm going to search for lib sdl2 def do we have lib sdl2 def I think uh there we go so here it is it's a li sdl2 Dev should be installed should be installed I think we should installed uh so yes yes yes can this just a sec I forgot that I didn't have admin permissions on on this account now now we got reported actually reported actually reported okay um all right let let me quickly to actually let me quickly to do that okay huh that is really weird you know why you know why because apparently it's already installed so I wonder what the is going on like why couldn't it actually find this entire thing why I couldn't find it uh is that because I have to um external as the it uses wait a freaking second so there is a all right so it goes back SRC external sdl and there's no sdl in here but it expects an external sdl uh plat it requires de to be provided externally is not included in it must be configured by users ah that is a very interesting choice architectural choice but I mean I respect that so uh we literally have to download the source code of wl2 I want like uh that's that's really interesting but I mean it's it's an experimental platform anyway right it's it is an experimental platform so maybe that's fine so sdl releases um so they use actually fourth version right so there uses fourth but there was already fifth one right so uh there is already fifth one so let's take the fourth one are you freaking serious uh okay so and of course we probably want to download that with WG right so we probably want to download it with WG uhuh so we're going to put that in here oh should have done it like this um okay so let me see who subscribed thank you so much cyers Sonic iio for twitch and TTY bitnik thank you so much for which PR thank you thank you thank you really appreciate throwing all of the money at Jeffrey bases Jeffrey Jeffrey bases uh okay so let's actually unpack unpack not UNP uh all right so there is a release but in a make file it is not called release it is called like that so essentially we have to call it something like this for this thing to be correct uh if I understand correctly right it's kind of funny right so I I don't know if there's any instructions about how to build the sdl platform but I mean it's pretty self-explanatory if you ever worked with uh with make files right if you ever worked with make files it's actually pretty self-explanatory so this is how we do that essentially um okay so let's try to build this entire thing and see what is going on and that didn't freaking work okay so this is maybe because uh this particular file didn't exist right so we can try to maybe find oh yeah it doesn't exist so I feel like uh it simply doesn't exist external sdl2 include oh include does exist and here is sdl but it couldn't find that um I don't really know why can't you find that why can't you find that because it's right here right there um okay did they download four people say I downloaded five really F okay I didn't scroll oh my God this is so bad I'm so sorry God damn it uh so okay so let's let's actually do that like I was that sure I downloaded the right thing I was that sure um okay why not use 2285 because I mean the like rip is built with an assumption of uh the fourth one and I'm doing this thing for the first time and here's the thing here's the thing right so this is a very valuable lessons for you if you're ever going to be exploring someone else source code you don't make such a bold assumptions right like I literally looking at this cord code for the first time and I don't want to make an assumption that it will just magically work with a different version of the thir P dependences why would I shoot myself into into the lag so much while just exploring the thing no no no you don't do it like that you don't do it like that and unless you want to have a really bad time right you see you look at the make file you look at the make file so the author of this make file stated explicitly that they use this version you use that version as well why would you go out of your way to use a completely different version like especially if you have so much uncertainty about this project just think about it like why would you do that why would you make your life so much difficult you already explor the code that you never seen before you have a lot of uncertainty you're going to introduce even more uncertainty into the situation this is very dangerous that is why that is basically why I know that it's even like a you know bug fix version not a minor version but again this is the code that I have zero idea about here's the thing like I just downloaded this code I've never seen it before I don't know what to expect I literally don't know what to expect and in my opinion it should be obvious that in this particular situation you just don't randomly change versions around make sense make sense we're on the same page right okay cool [Music] so okay good it's a very important lesson for you trust me I've been in situations like that many times uh right okay Z2 that's the version uh okay so what we have okay it is building it is building it's doing something and it's actually built as you can see so it already finished uh making our core uh right so that means it is working that means it is what it is least working and it keeps using it look at that so it uses includes and stuff like that and it's all building I feel like it built faster than yeah I I I feel like it built faster actually right than the glfw version uh though it feels like maybe it build less things I don't freak know maybe so um as we can see as we can clearly see as we clearly see the sdl platform builds successfully right it does in fact build successfully uh one of the things we can try to do is maybe just make a Hello World application that uses all of that right so let's go ahead and do that so let's do hello. c uh and in here we're going to be including I suppose R.H right so we're going to be including r. H and so I'm going to just go ahead and say okay initialize window uh and it's going to be 800 by 600 uh right so let's actually do ray lib 5.0 so if I remember correctly what should do while not window should close you begin drawing right so you begin drawing then maybe you want to clear background with like a red color and then you end drawing and then you close the window so the cool thing about Ray leap is that that's the entirety of the boil plate right so that's basically it and now we can try to build this entire thing so it's going to be main main.c but it's not going to build because uh right so the name is completely different right so this is going to be hello uh there we go so it doesn't see Ray leap right so one of the things we want to do when I say okay search for the includes in SRC uh right so Ray Li H is not located in SRC that is very interesting so R.H it is located in SRC so the reason why it couldn't find that I suppose is because I used the wrong uh brackets right so I suppose for things in the include path you have to use the the quotes right so you're supposed to use the quotes it still can find them huh that is really weird because I am an idiot I put double dot in here that's why okay so that's cool so it found everything but it couldn't link shed so and the reason why it couldn't link shed is because we never provided the leap R.A I think if we provide it like that it will work as you can see it kind of worked but it failed uh because it couldn't find mathematical functions right so another thing that it probably wants it it wants mathematical Library so it's actually linked with mathematical Library okay here is an interesting thing it depends on sdl dynamically that is very interesting so I thought just because we provided the source code of sdl it is going to link sdl statically but apparently it doesn't isn't that fascinating like why the did we provide the source code in the first place if the only thing it used is the uh headers like I thought it's going to do the same thing as uh with JFW you know what does it do with JFW uh right so it is experimental yeah so my hat is actually right so it may be experimental but I expected that it's going to do the same trick as with gfw right so with JFW it's kind of interesting it basically concatenated the entirety of JFW into single translation unit and just compiled it and linked it with with the library so you don't even depend on the external jlw which is actually kind of cool I expected that it's going to kind of do the same thing but this DL but didn't do that maybe because it's experimental maybe because it's more difficult I don't know so it it doesn't really matter to be fair it doesn't really matter one of the things we can do we can actually do L sdl2 uh and there we go we successfully linked with this entire stuff and we got hello executable which is in fact uh 64bit uh Pi executable blah blah blah so let's actually take a look at at its dependencies what does it depend on it depends on a lot of things and one of the things it depends on is leap two uh right which is a system one right it's really funny how we downloaded sdl purely for the headers and then still use the system sdl isn't it f i mean again I understand that it is experiment but it's just funny right we download it an entire source code I was hoping it's going to like link it statically or do something about that I don't even know if it's possible Maybe there's something in sdl2 that makes it impossible to just do the same Dr with jlw but it's just like it's kind of funny it's kind of funny not going to lie okay so let's actually try to run this entire thing and it's running right so it is working it is working it's using sdl apparently uh right does it even say anything about the sdl oh yeah it does say that it is sdl look at that so it does say that it is sdl um right so far I did notice any you know backward incompatibility in terms of API on a very basic level on a level of just like using that I don't really see any problems with anything so everything is pretty straightforward um everything is pretty straightforward so maybe one of the things we should try to do we should try to um integrate all of that with Mizer right so we should probably try to integrate that with Mizer so let me see let me see so um Mizer we build Mizer with our own build tool called knob right so people who watched my streams they kind of know uh this the gist of this entire stuff right so we're building C project with C program we have a dedicated C program to build our Big C project so and essentially right so I can actually remove this entire thing there's no make files there's no cake there's no zek or whatever the people came up with like for this year uh right so essentially you just build no. C right and you get a single executable so you build it once and you build it with a very simple command just like straightforward command without any Flags without like anything just build it and it will build because it doesn't really depend on much right except uh you know lipy and then uh you run this entire thing and this thing already configures everything uh you know finds the sour SCE code and build the source code and so on and so forth uh one of the things it does it actually builds Ray for you right so we Supply the source code of rip with our project that's how simple rip is by the way that's one of the things I like about rip uh is that it's so simple you can just copypaste rip into your project and build it with the project and it will just statically linked and stuff like that um so and uh I can even demonstrate you that right so like I'm going to remove the build folder because like in the build folder uh we have R and there you go here are all the things in here right so we actually successfully build this entire thing but I'm going to delete it just to demonstrate how it does that so I'm going to just run it one more time as you can see it's building rap but it's building rap uh 4.5 the previous version right so it's building the previous version so what we need to do we need to now migrate the build to the latest version and see how well it builds um so that one is going to be rather interesting okay so let me see so the way it works the way it works we have different sub commands and stuff like that so but the most important sub command is basically the build subcommand it's also the default subcommand right so if you didn't provide any subcommand we automatically set the subcommand to uh like imagine writing C make scripts but in C Imagine That C scripts but in C this is roughly how it feels like actually this is roughly how how it feels like um so but I mean you have a little bit more control over what is going on right so because it's more like writing shell script right it's more like writing sh scripts and see um so what we doing here so we have separate functions for building rap then for building visualizer and then for copying the resource folder into the build and stuff like that so the most interesting part for us is building Ray liip right so here we're building rip uh and what we do essentially in here is we just do that here's the interesting thing R uh that in how many places we actually mention this version aha what if we made this version part of the configuration so we already have a r folder within the r folder we have two folders with different versions what if we just keep both of the versions for now and make a configuration flag configuration flag that allows you to switch between the versions of R so we can test uh build with that version and then build with that version and see how it goes right I think that's a pretty cool idea I I think it is so uh we may want to actually go ahead and extend our configuration so here's the conf configuration so and config allows you to basically control uh the build itself right so what's going to be the target for what Target for what platform You're Building visualizer and we have several Targets on here so uh specifically Linux uh Windows using mjw Windows using msvc and Mac OS so this is the platforms we support for now roughly right so I never actually tried to build it for micros because I I'm poor that's the entire explanation that's why I never tried to build it for micos because I'm poor all right but some other peoples my viewers who are rich uh actually try to build it for micos and they say that it works but there are some problems with uh right some problems with with the sound right but it has nothing to do with the build so the whole project builds fine and the problems with the sound are allegedly solved in rayap 5.0 by the way so that's one of the reasons we are upgrading we're going to get a fix for Mac OS for free right so it's really nice to have things for free when you're working with Apple products right it's kind of nice just saying um Mac audio is a mess it's actually quite surprising because as far as I know a lot of musicians and audio Engineers use Apple products it's kind of but maybe that's the reason why it is mess here's the thing right because usually software becomes a huge mess when a lot of people use it for different purposes so essentially developers basically pile complexity more and more and it becomes kind of a mess it's one of the reasons so increas the complexity it's not the only one right so the complexity can increase for different reasons but it's one of them so the fact that you have to install kernel extension to enable Discord screen audio it's still hilarious to me I didn't know that that's kind of funny so it's a you're not losing much as a non consenting Mac User it suck BS interesting but I always wanted to try it so but from what I heard and saw like I actually saw a like MacBook IRL I know it was mindblowing I actually saw like this aluminum thin thingy and it was just like it's is that a MacBook what the and I looked into into the screen like and I saw the person who's working there and it looked like Unix like it's just like I mean right it's just basically Unix isn't it so I don't know okay um so and we have uh what else do we have in the configuration uh so we have hot reloading hot reloading is actually a very cool feature it essentially allows me to uh modify the code and hot reload it right so it basically does exactly what it says right so it does exactly what it says so to enable hot loading we have to actually go to the configuration and uh say true in here uh and let's actually try to build uh this with h reloading that will require rebuilding the whole oh it didn't really rebuild the whole rip it actually relinked Ray deep to be a dynamic Library okay so and if I now uh do I have uh the file manager I need the file manager super quick uh I need you to call me a f file manager um all right so let's put some music maybe so I want to demonstrate how hot reloading [Music] works all right so we have this thing right so we can do some stuff and I can now make modifications to the source code so let me open maybe plug and let's modify something for instance uh we can modify in the accent color right so as you can see we're using an accent color which is basically bluish right so it's sort of like a bluish we can make it uh basically red and what I'm going to do I'm going to just recompile the whole thing and I'm going to say okay hot reloaded and there we go we automatically updated it's a native application uh right and uh you can modify things and H to reload and update and stuff like that it's very convenient when I'm developing UI uh right so it's actually pretty cool so somebody asks how uh this is a basic functionality of um your operating system Believe It or Not uh but if you want to get like the gist of how exactly it is organized when hot reloading is enabled 95% of the application is actually moved into a dll right so 95% of the application is moved into gll and the actual executable of the application uh becomes just an event Loop that calls to a dll right so we have things like pluging it uh plug update and plug update renders a single frame and it calls to a function in a DL and all of the work of uh rendering a single frame is happening in the dll essentially when you press h what we do uh we just swap the dll to a new version and continue the loop that's how we do that so and since majority of the functionality is located within uh the dll we can hot to reload pretty much anything except this Loop right if I want to modify something with it within this thing I won't be able to do that without restarting the whole application but I don't remember the last time I touched this part of the application ever like I just wrote it once and I forgot about it because it's it doesn't contain anything it's just a loop that keeps pulling the frames from the dll and everything literally everything is H is happening within that dll and here's an interesting thing then you can disable hot reloading and all of the logic is moved automatically into the executable and actually linked statically so this uh entire thing can work uh with hot Lo and without the hot reloading so uh basically in the release we disable hot reloading and you get get a static executable which actually has less dependencies less moving parts and those more reliable generally right I don't really want to ship this H reloading feature to the user I don't think it makes sense to ship that to the user though in the future we're going to have a system of plugins which allow which will allow you to like plug in different visualization but that's a completely different story that's a completely different St oh yeah like I mean I'm using word dll and is so interchangeably like as a synonyms yeah obviously I I I thought it it will go without saying I I did I didn't expect that they'll have to you know clarify that but yes I'm using D Ando interchangeably and also interchangeably with d LI or whatever the you have in Mac OS it doesn't matter the concepts are in all the separating systems are the same okay anyways so let's actually bring this entire thing back uh so and yeah so the last thing that we have in a config is a microphone so this is unfinished feature so essentially I want to enable visualization from the microphone uh essentially we can just enable this entire thing and you know build this entire thing one more time and what it does it uh you know enables an an finished feature which allows you to visualize uh by the microphone it's it's kind of funny that it cannot pick it up uh but let me see maybe there's something with power control um why there's a playback from China oh this is because it's plain sounds okay so we have input devices so all right oh okay so it uses by default the mic from the webcam but the mic from the webcam is is actually muted so we can unmute it and it doesn't really do anything um so it doesn't even pick up anything but we can just try to oh there we go so I just switched to I hope the sound is okay uh but yeah so we're now using the mic that OBS uses so and you can visualize the voice so this is unfinished feature right I didn't really fully integrate it into the main application that's why it's behind the feature flag right so I'm practicing future Flags so yeah Okay g so that's basically what we have in here and one of the things I want to do now I want to add another config parameter that allows you to specify the versions of the r of rip uh right so I think that makes sense right so let's go ahead and try to do that and see how it goes um so what do we have array lib version right so Ray lib version so we have a function that basically initializes the config the default config initializes the default config so by default it disables all the features that disables H reloading in microphon so that is fine and the target is set according to where you're running the program from right so if you're running it on Windows 32 from uh you know msvc if you compiled knob with msvc so the target is going to be wi 64 msvc I know that wi64 is not a platform like I mean but who cares it's Windows uh so and one of the things I want to do now I suppose by default we're going to say that the r version uh the r version is actually this one right so four 4.5 and another thing we need to be able to do we need to be able to parse uh one of the flags so what kind of flag should we assign for rayap uh that's a very interesting question so we already have uh things like things like minus r minus r enables hot reloading minus Su enables the microphone H is help so what's going to be the flag for the rip uh maybe it's going to be simply uh rip right so if a flag is Rip uh we have to do something in here right in one of the flags that we can have in here is going to be RP um let's put it like this a version of radp vertion of RP so obviously uh at the end we're going to have only one version of radi but while we're migrating it's nice to have like a flag to switch between the versions and see how it works right so let's not jump into completely deleting the previous source code let's just have both of them uh and see how it goes so by the way we need to provide a parameter so that means we need to check that the parameter exists right so if r c is less or equal than zero uh that means we need to do Noob log uh so Noob error and we're going to say no argument is provided I think we already have that uh no value is provided for flag blah blah blah uh right and we can even copy paste this entire thing but here we're logging available targets right so but instead what we should log in here we should log available versions right so what kind of versions do we support uh there going to be no blog so when I log available yeah I'm using using error available available versions uh and what versions we're going to have as available ones right so I suppose this one or this one so we support only two versions for now we support only two versions for now after that uh we just get that value we just get that value and I suppose I think I want to just check if value Str strcmp Str Str CMP uh 4.5 is equal to zero we're going to just huh so I'm just thinking how I want to organize all of that all right so essentially I want to do something like a r Lead version equal to Value um so I suppose it would make sense to always set R version to value and when this thing is not equal to this thing we're going to say something like this and uh not equal to five we're going to do Noob log Noob error uh this is not a supported uh version of rip uh right so we're going to do value and we probably want to log available versions so I'm copy pasting the code because I I think majority of this code is going to go away once we migrate it to Rel right so that's why I'm copy pasting uh right if I was sure that this code was going to you know stay here for a long time I would probably created something like this like loog available targets for instance right and here we're loging available targets and probably even could have created something like this as well well for the for the versions but I don't plan to have this code for too long right so it's just a temporary code that's why I'm copy pasting it's fine to copy paste code chat it's fine to copy paste code especially if it is temporary and especially if it's just two places just quick it's okay it's okay right nobody's going to give you a bad grade at exam or anything like that this is not uni this is real life it's fine [Music] dry was a lie dry actually can be extremely toxic to be fair if taken like too far because quite often uh maybe you want your code act like a list of things and in that case copy pasting actually makes things more readable right when you apply drop you're actually compressing the code those kind of decreasing the readability of the code here's the interesting thing here's the interesting thing copy pasted code is more readable copy pasted code is more readable copy pasted code is more readable you know why because when you look at copy pasted code you instantly go oh it's a copy paste how did you guess it's a copy paste how did you guess it's a copy paste like just just think about the level of readability of the code you look at the code and you instantly identify the problem with the code that's how readable it is that's how readable it is copy paste is more readable it's just a fact you can test it for yourself by getting rid of the copy paste you com pressing the code thus decreasing its readability but all comes at the cost right and again I'm not saying that you have to copy paste the code all like all the time from now on what I'm saying is there are tradeoffs in real world right so you see where I'm going with that you see what I'm talking about isn't it interesting isn't it freaking interesting I think it's freaking interesting right so yeah and the way I usually use copy pasting is that I let the code to multiply until certain Parn emerge and once you see certain Parn those certain parns are easier to compress to factor out right so but until the patterns are copy pasted sufficiently enough there is no point in spending time compressing those patterns if you know what I'm talking about right and especially when you're going to delete this code anyway so what's the point right so there's no point in spending time on that anyway anyways so uh you and in case of an error obviously want to return with false right I obviously want to return with false so let's try to reild this entire thing and what do we have and yeah so when we load the config okay so we're loading the config we'll log in the config right so Ray Ray Li version right so we didn't finish this entire thing fully we didn't finish it fully uh login is important because we use this function to basically tell you like the current configuration right so uh when we start the build we tell you what's the current configuration what's the current configuration and then we start building and it's it's actually kind of useful right so I want to instantly see so we're building for the Linux uh hot reloading is disabled microphone is enabled right so that's the current configuration so uh also uh dumping configuration is when we basically serialize it so this is one of the things I probably want to be able to do uh right so let me quickly do that so might as well actually copy paste this entire thing uh all right so it's going to be Ray lib um Ray Li [Music] version uh so config parse okay so now we need to be able to parse the uh the config file okay so there's so many places I have to make the change is in to add a new configuration parameter so maybe I want to you know work on that so if um we encounter if we encounter rib we have to parse it correspondingly right so we have to par it corresponding this one is rather weird honestly this one is rather weird so we parse Boolean how we going to parse all over that we're going to all over that uh so this is the key and this is the value so I can't just assign the value I can't just assign the value to the config right because the value is string view but one of the things I can do actually one of the things I can do I can actually do a comparison I can compare this entire thing to one of the available versions one of the available versions uh like so all right and if it's equal to that I'm going to config array Li version assign this entire thing to just that otherwise if something like this ah so this is not fully closed this is going to be something like that right so the reason why I'm doing it like that again is because uh the value is actually not an ultimated string and it is located in uh a memory that could be delocated at any moment because we're reading the entire file into the memory entire configuration file into the memory we parse it and then we may deallocate it I didn't think we deallocate the content right now but we may deallocate it so uh because of that I can just assign this thing in here uh right because of the difference in the Lifetime right Ras developers would lifetimes and stuff like that so that's why I'm assigning a thing that has a static lifetime do do you guys know what is a static lifetime the static lifetime is basically the object leaves for the entirety of the application and string lals have a static lifetime uh right so yeah uh so uh otherwise we may want to do something like that so we can say maybe this thing is not a supported R version so I copy pasted this thing three times already so uh I copy ped three times so this thing is not a supported version but I suppose uh the way we have to do that is SV fmt uh SV AR right otherwise we won't be able to do that um so and we also need to be able to specify the location right so file Zu so path R plus one so we need to specify the location uh okay so I guess that's it basically that's it and we by the way in case of an error want to return with defer okay let's go through the compilation and see if it's going to work so something with a warning in here um so it's a knob SV it's a noob s what else do we have in here Noob s another one what else you want all right so if I take a look at this thing so Ray n aha because it was never actually uh yeah it it doesn't exist in in a final configuration in here right so it just simply doesn't exist which is kind of funny um all right so which is weird didn't I say in a default configuration in a default configuration that just use this as the default one especially when I just run it and we're loading this entire thing don't we load the configuration from the default config we don't I just realized the problem or do we right so if this thing exists yeah we compute the default config then we okay let's very interesting so if file exist we just load this thing but we never okay that makes sense so essentially what we have to do we have to use the default config then load the config on top of the default one and only then it will make sense okay so that makes sense now there we go so as you can see the r leap is actually set to be 4.5 blah blah blah right so uh let me actually delete uh this entire thing and I'm going to do no config uh right so it's using radep 4.50 and if we take a look at the configuration in here right so here it is so we have that uh which is kind of cool so adding a new parameter to the configuration must be easier it must be easier I think but I'll work on that I'll work on that I'll will make it easier at some point so because it's all in the development state right so uh this is an experimental very very much experimental building tool just like sdl support in R right so it's all of that is just experimental so that's why it uh it's rough around the edges uh so I think we need to actually start using uh the the version The Rib version so let's go to the build rib and let's find where we refer to the version right so here we refer to the version so now we can say Okay use the version from the configuration R version version there we go so as you can see now it's going to be using that specific version depending on the version is going to be simply using a different folder right it's simply going to be using a different folder and as you can see in here we have two folders 4.5 and 5.0 right so uh let's find all of the places where yeah there we go so here is another one so this is going to be S uh Noob TMP uh s print F right so we're going to be doing that just like that config array lib version there we go uh so here is another one uh so let's quickly do that so this is going to be as no uh temp s printf so config R version and uh so okay so there's actually several can I simply use a little bit of a emac magic to achieve an epic Victory Royale I don't think I easily can unfortunately all right so that's kind of a little bit of knowing but okay uh maybe what if I record a macro right so I'm going to do three 4.5 right so I'm going to replace this entire thing with that then I'm going to find this Noob uh tmps printf uh then I'm going to find the opposite thing in here so config Ray version and I'm going to close that and I'm going to finalize the macro and then I'm going to repeat the macro uh Down Below on this thing right so I'm going to just press F4 and it didn't work okay so uh yeah this is because I made mistake during recording the macro but one of the things you can do in emx is that you can record the sequence of actions you can replay the the sequence of actions you can do that in v as well but something went wrong during the recording so I don't really know what uh right so because I made a mistake I made an oopsy doopsy and potentially Walky it do be like that sometimes but that's fine I didn't think I have too many places where I have to make the changes and stuff like that so at least I didn't see any more plac this is where I have to make that right so 4.4 yeah okay so if I take a look at the version ah it's still being referred to in okay in these places so maybe I can query replace this entire thing super quickly with Noob uh tmps printf uh can can you even see what I'm doing in here I'm not really sure if you can see what the I'm doing in here but yeah so okay so Ray uh it's a config Ray lib version uhuh so let's do this replacement sort of speak uh hopefully that is correct let's find another R uh 4.5 this one I think that's the only place where we do all this stuff right uh yeah this is the last place finally um M so uh Noob tmps Sprint so as you can see I had coded the version and now I have to change it in all the places but I mean I didn't expect that I'm going to be changing that version I mean I should have expected that right so but I didn't I really didn't but that's fine I mean it's not that big of a deal uh holy uh okay so here we passing config by uh so to Fair quite often we passing config by a value so maybe doing it like that was not a particularly great idea so let's go through all the places where we just call that so luckily in emac It's relatively easy I can just jump to the compilation errors and uh basically fix all that I don't know why I assumed uh they are passed by reference but I mean this is one of the annoying things think in C to be fair in my opinion C should just have Auto referencing it should just have Auto referencing right so essentially it's super easy it's super easy to detect at compile time that uh you have a poter to a structure on the left hand side of the point of the dot and just assume Arrow instead it's super easy and if you just add that to the C compiler it doesn't break any of the existing code it just doesn't so I think I even did a stream on that where I extended TCC to do that and it was actually very successful uh so I don't remember if I uploaded that to YouTube I don't remember but maybe I did so let me let me see so some people in the chat do remember that stream right so some people in the chat do remember that soing uh Auto uh ding uh so let's actually see oh I I think I remember how the stream was called uh hacking C compiler I think that's the stream yeah hacking C compiler it's that one oh yeah so I do remember that after yeah so that's the stream that's the Stream So basically in this stream I uh extended TCC to support out the referencing of the structures right so essentially what we did we extended it so that it looks at the left hand side and if it sees the pointer to a structure it just replaces that dot with arrow it basically does the same action as the arrow uh and it didn't break any of the existing code in fact we could compile TCC with itself with that extension and it compiled fine so it it just worked fine you can just enable that extension it won't break any of the existing code though it will create the code that is backward incompatible with all the C compilers right so and maybe that's why it's never going to be enabled but uh it's relatively easy change so I know so I'm going to put that in the description for yoube people as well so uh soing hacking C compiler right uh by the way so I recently studed to use uh this pretty cool extension for YouTube which basically removes all of the suggestions and stuff like that uh it's it's literally called remove YouTube s suggestions uh remove uh remove YouTube suggestions thank you uh hovi for suggesting that uh extension so it's remove YouTube suggestions and I actually like this uh this extension right I really really like it so I think I can provide the uh leing Chrome yeah so this is the website official website um one of the projects yeah remove YouTube suggestions so this one so there extension for uh Chrome and for Firefox and stuff like that so here it is and I'm going to put that in description as well so recently the way I started to use YouTube I started to use YouTube in a very oldfashioned way so with this extension I removed all of the suggest questions and uh now I'm only watching the videos in my subscription feed without any suggestion algorithms or anything like that like it used to be like 10 years ago right and you won't believe how many channels I discovered that I completely forgot about it's insane how algorithm buried so many cool channels I subscribed to just because they were not engaging in enough like I don't want to watch engaging content I want to watch the content that I like and here is the thing engaging engaging content does not equal to the content you like so it's not the same thing if something is engaging if something make you engage with the video and leave a comment because something pissed you off that doesn't mean that you actually like it right so I don't want want to watch engaging videos I want to watch the videos that I like and the videos I like I know the videos I like I subscribe to those channels you and your algorithms seriously all of that so and I like recently started to enjoy YouTube more just because I have control over what I watch finally old man yells at algorithms I don't know I'm enjoying YouTube do you enjoy YouTube uh maybe you do so yes yes yes okay so what we want to try to do we want to try to uh Delete uh this entire thing I'm want to try to delete this entire thing and I'm going to do config uh rip uh 5.0 right so and as you can see uh you can't see that uh Rel 5.0 okay so let's try to now build with a newer version is it going to work okay so we're building the 5.0 which is nice uh I really like that so that means our build system our build system actually works uh with a newer version of rip so let's see if it's going to work U if rip newer rip is going to work with our application um okay so okay apparently everything compiled everything compiled fine um okay that's cool so no special migration is required which is kind of surprising um so seems to be working it just works how can we know the version of r that is currently we're using currently yeah we're using R 5 so a huge win for rayan I suppose uh I mean yeah by the way web deaths can your web Technologies do that I just made a major version upgrade like that can your framework web libraries web Technologies browsers do that just works new version no changes required major I don't think so I don't think so anyways imagine if rayan asked for donations in this info print out as far as I know there there are ways to support rayan so I think he accepts donations let's actually see uh there should be some way to support him um I wish I could support him though I don't really have a way to transfer money to uh to people in Europe so as far as I know he's in Europe so you can basically sponsor right so but I can't sponsor via uh via GitHub maybe there is an option through crypto right so I I'll research that right I'll research that I'll see if I can actually transfer some money by a crypto um so but yeah so if you want to support him and he does deserve support really so this is like he's doing an amazing job because maintaining Library like this and making sure that you can just upgrade from uh 5 4.5 to to the major new vers major version is a lot of work it is hard it is enormously hard so he does deserve more recognition uh and more money that's for sure um so yeah and this is not a small application uh so well I mean we have mini audio well let me actually quickly remove mini audio right so I'm going to do clock and how many so yeah 2,000 lines of codes so mutual Isa as of right now is 2,000 lines of code right right so it's I would to say it's a big application but it's I mean it's an all right application to introduce some problems during the upgrade of the dependes so yeah um what people what do people use rip for you want to see what people use rap for didn't I just show it Poli this I don't know what to say uh for putting rectangles on new screen yeah exactly so it just allows you to put rectangles on your screen um reactive guy without react that's right that's right that's right um okay guys so that was easier than expected so this is basically the the new version of radi that's basically the new version of R uh so yeah I'm reg streaming for one half of an hour or I'm my sleeping schedule is still a little bit uh broken so I don't want to stream for too long so I'm going to call it a day for today uh right so I also didn't stream for quite some time so I need to get into the um how I say into the rhythm again right so uh people who stream probably know that if you didn't stream for quite some time it's kind of difficult to get into into that again so you want to go back slowly so let's not push it to two hours right so let's let's stop at one and a half and we already did everything I wanted to do for today I wanted to check the the newest release I wanted to uh upgrade Mizer um so yeah essentially we probably don't even need all of that code that I've written for picking different versions of rip and stuff like that uh I can simply just use the version 5.0 uh but I need to spend some time like preparing everything right so especially I like to uh one of the things I like to do with the rip is to remove everything except SRC because I don't need any of that stuff right so uh I'd like to remove that I don't want to commit all of that uh I want to just keep SRC because that's the thing I need anyway I'm going to do all of that offc screen and then I'm going to commit that and hopefully hopefully that is going to fix some of the problems um there is a very interesting thing by the way so I'm probably going to stay for a little bit longer um in 4.5 in 4.5 there was some problem if I enabled multi sampling antialiasing msaa right so um so essentially let me show you um and this is where switching between the versions is actually very useful right this is where switching between them very useful so but I still have to remove the uh the folder so Noob uh let's do the default config right so we're going to use the older version uh and let's build this entire thing so uh let me go to the Mizer let me go to the Mizer and how do I enable MSA m s AA so rip SRC rip. H uh msaa so what it does it basically enables antialiasing and gets rid of the uh of the pixelated like staircase edges and stuff like that uh which is extremely useful right so here's the config flag I don't remember so maybe set config yeah so you're supposed to set config flag uh to enable this entire stuff I don't quite remember where you set it I think you said it before you initialize the window right so but we're going to keep it in here so it is not initialized for now right so we're going to keep it uninitialized uh and I'm going to Simply run visualizer um so let's take a look at the version of RA the version is 4.5 right so 4.5 and if I add a little bit of the music uh right and we take a look at the uh rounded edges as you can see there are staircases and they're not very smooth or antialias or anything like that for example I have Meep maps for for the icon right so for different resolutions and stuff like that and it is anti-alias and it actually looks nice especially when you zoom out a little bit right all of that anti-aliasing it actually shows it actually works really nice I really like that but it doesn't work for the for the rounded edges it doesn't work for the rounded edges because we never enabled that anti-aliasing thing so uh we are on the old version of RA let's actually try to enable the anti-aliasing so and there was a bug for a long time in R uh that make that not really work great for circles and rounded Corners so let's try to rebuild this entire thing um right so and I can't hot reload by the way because I'm modifying things in a vent Loop right so because it's initialization uh so it's kind of difficult to yeah okay there we go uh this is the bug for some reason there is this extra pixels as you can see the edges are anti-s so everything is okay but then within the section there's this noise and I don't really know where it's coming from and as far as know Ray s is a was a aware of that and I remember him asking on Twitter if anyone knows what could be the case I wonder if that bug was fixed in in the latest major version right I wonder if it was fixed because I kind of want to have like anti-aliasing around the edges in here because it kind of makes it look a bit better but this bug it just kind of kind of kind of M in my opinion so let's actually uh remove all of that stuff right so I'm going to reconfigure this entire stuff to use 5.0 right so let's quickly rebuild uh everything and see if it's going to make it look better all right so let me see uh if this thing is working now so let's actually double check the version the version is 5.0 as you can see it is in fact 5.0 and let's enable some music and let's take a look at the rounded edges thank you rayan thank you you won't believe how thankful I am for fixing that bug because the rounded rectangles are so ugly without anti-aliasing but then you enable anti- Ling and it makes it even worse it just makes it even worse thank you for fixing that rayan Ray Sama Ray Sama thank you so much for fixing that I really really appreciate that so the whole application became slower right so it doesn't resize so responsive anymore because I mean there's more fragments to render right I suppose so that's that's the the reason but overall I mean it just looks nice it just looks nice so I'd like to maybe add a little bit more uh samples in here so uh we have more things to scroll uh so yeah and so generally all of that just looks nice it's a bit slower yeah like msaa actually makes it a little sluggish especially when I'm streaming so but I'm going to check it when I'm not streaming all right and um maybe maybe it's going to be faster so maybe I'm going to also create an option to disable that um when I'm streaming right so it doesn't Rec consume too much resources because I'm using 10 years old laptop right so and it's difficult for such a laptop to stream and also do you know multi like anti alling simultaneously uh all right so die but anyway that's it for today thanks everyone who's watching right now I really appreciate it have a good one and I see you all on the next recreational programming session with mis a I love you
Info
Channel: Tsoding Daily
Views: 53,040
Rating: undefined out of 5
Keywords:
Id: CfeHFIP_xEI
Channel Id: undefined
Length: 85min 55sec (5155 seconds)
Published: Thu Dec 21 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.