Window Events | Game Engine series

  Рет қаралды 73,457

The Cherno

The Cherno

5 жыл бұрын

Patreon ► / thecherno
GitHub repository ► github.com/TheCherno/Hazel
Instagram ► / thecherno
Twitter ► / thecherno
Discord ► thecherno.com/discord
Series Playlist ► thecherno.com/engine
Gear I use:
-----------------
BEST laptop for programming! ► geni.us/pakTES
My FAVOURITE keyboard for programming! ► geni.us/zNhB
FAVOURITE monitors for programming! ► geni.us/Ig6KBq
MAIN Camera ► geni.us/t6xyDRO
MAIN Lens ► geni.us/xGoDWT
Second Camera ► geni.us/CYUQ
Microphone ► geni.us/wqO6g7K

Пікірлер: 134
@bacontf2
@bacontf2 5 жыл бұрын
Much easier to follow than the previous couple because of live coding. Thank you
@ninojamestan8895
@ninojamestan8895 3 жыл бұрын
@五毛都是太监 yeah its faster but its harder to figure out and understand
@PenguinMaths
@PenguinMaths 5 жыл бұрын
Happy to see you're typing the code out again! It's much easier and more enjoyable to follow.
@TheRealMangoDev
@TheRealMangoDev 11 ай бұрын
true
@atacoonthis
@atacoonthis 5 жыл бұрын
Creating a window felt pretty badass. I'm badass.
@chris_burrows
@chris_burrows 5 жыл бұрын
You are so fucking bad ass man. Never quit.
@developerethan4593
@developerethan4593 2 жыл бұрын
We're all BADASSES!!!
@whythosenames
@whythosenames 5 жыл бұрын
I love if you type the code out live!!
@GuyCollinsWilliam
@GuyCollinsWilliam 4 жыл бұрын
SOOOOO much easier to follow, thanks for taking the time to do this format!
@gleb.ignatev
@gleb.ignatev 5 жыл бұрын
I love this series! Usually when you think about a game engine it's render and physics stuff that comes to your mind, but not all these things that he does, but those are very important too, so thank you very much for raising these topics!
@redafakih12
@redafakih12 2 жыл бұрын
This is the most beautiful system ive seen man, mad respect for you i loved this after getting mixed feelings from the events video!
@hervesv9529
@hervesv9529 4 жыл бұрын
Wow, this is pretty cool. Thanks Cherno, this series is amazing, I wonder why I didn't find your channel earlier!
@DrBarnabus
@DrBarnabus 5 жыл бұрын
I have found this Hazel series so much easier to understand and follow than Sparky. Plus, with the events system its so much easier for me to visualize how to expand it with D3D/Vulcan if required because everything is decoupled from Application. Love the videos man, you are doing a great job! Would be nice to see how you would implement the other platform specific windows?
@hokhyt
@hokhyt 4 жыл бұрын
This is so awesome, once again thank so much for this series.
@yillin
@yillin 4 жыл бұрын
Yoooo. This was all very slick. I liked it a lot. Thanks much Cherno.
@shreyasc2112
@shreyasc2112 3 жыл бұрын
Thank you for the series, this is awesome.
@alicia696
@alicia696 3 жыл бұрын
Thank you for creating these amazing videos. I was frustrated with my programing, until I started to work on cool works along the videos. It is super helpful and tremendously made me able to comfortably start to write code.
@gaschneidr
@gaschneidr 2 жыл бұрын
I'm starting this series now. Did you went through all his videos and ended up with a working engine like Cherno have now? Just curious! I've also found a lot of enjoyment playing around with opengl from some tutorials online. It's really cool to see our code working through graphics.
@revvilo
@revvilo 4 жыл бұрын
That event system is bloody awesome
@mcjustin1
@mcjustin1 3 жыл бұрын
I agree with the masses. I really prefer to have the explanation along with coding. Makes it a much more understandable pace/explanation. Great to see this format is back!
@jonphillips4082
@jonphillips4082 5 жыл бұрын
Very Nice! I really like this method of dispatch(Event System), Great Work! I understand there will be lots of changes and thing's you're not sure you will include, but I would really like to see a architectural overview, "UML". Just for reference to see the overall connectivity(main components), even if it's very generalized.
@obi1jim316
@obi1jim316 4 жыл бұрын
For some reason, I found this video difficult. I was able to get through it. Apparently, there were typos on some of the code I had written from previous videos (and somehow still compiled), which didn't match the code as the Cherno started using the functions/variables. For me, most of the difficulties is just typing the code accurately, the other half is making the right steps to link stuff together. In the end, I made it through another video. I'm glad the Cherno decided to type this one out as he recorded. Another video down, I'll see you on the next video's comment section.
@goldenlava1019
@goldenlava1019 4 жыл бұрын
same
@catinwall4256
@catinwall4256 4 жыл бұрын
yo these comments are epic like a story unfolding before my eyes
@diligencehumility6971
@diligencehumility6971 Жыл бұрын
I really like to see you code, I learn a lot
@pianochess1882
@pianochess1882 5 жыл бұрын
Keep them coming! :)
@bikeshack8225
@bikeshack8225 Жыл бұрын
If anyone is doing this in 2022 and gets an error in spdlog about "Cannot format an argument", I had to include the line #include in Event.h due to a change in the way the spdlog library works since this video.
@helio6839
@helio6839 Жыл бұрын
I believe The Cherno mentioned this in a previous video
@NetherlandsTop40
@NetherlandsTop40 5 жыл бұрын
Great video!!
@haos4574
@haos4574 4 жыл бұрын
best game engine tutorial
@kapilverma2668
@kapilverma2668 5 жыл бұрын
Great series Yan. Great work with the events system. I am eagerly waiting for the custom containers for hazel engine.
@Dante3085
@Dante3085 4 жыл бұрын
12:27 For me personally, I like it more if you type it out like this. Gives me enough time to type it myself, see the patterns and type some stuff before you type it to see if my predictions about the code are correct. You already have a model about the code in you'r head which makes it possible for you to see each part of the code in the right context. I don't have that yet, so I need the time.
@ajanyhc
@ajanyhc 4 жыл бұрын
What I did in order to follow is - git cloned his latest code into a different directory - created a project using VS2019 (the latest) - copied all of his files into my project - Followed his 'premake5' usages in previous videos - compiled (with many attempts and fixing here and there) - looked at his 'on the fly' coding with the code that I copied from his git - followed his 'updates' on Application.cpp file This way I was able to follow rather easily what he was trying to teach!!!!
@joelincz8314
@joelincz8314 2 жыл бұрын
Thanks!
@r1pfake521
@r1pfake521 2 жыл бұрын
With the implementation in this video you can only set one callback function per event unless I missed something. Usually in event system you can add multiple callbacks (or "handlers") per event and once the event is triggered all of these callbacks will be invoked. Was something like that implemented in the engine, because I would be curious how you handled it. The naive way would be to just store the callbacks in some kind of array/container and invoke them in a loop, but there are some corner cases, for example one event handler adding or removing an other event handler while you are still in the loop which is invoking the event handlers etc.
@ZackOfAllTrad3s
@ZackOfAllTrad3s 2 жыл бұрын
Hey thanks for the videos, it would be nice if you would also log your key presses in the video so we can see what shortcuts you are using. Thanks!
@swayuuum
@swayuuum 4 жыл бұрын
I dont understand everything, but I am understanding something. So I will just keep trying. Thanks Cherno
@Arksha_
@Arksha_ 5 жыл бұрын
I like the code along videos. I spend less time pausing the video which is nice :)
@menaced.
@menaced. Жыл бұрын
if anyone runs into an ASSERT error and debug break make sure both Hazel and Sandbox both have the runtime library set to the same settings (/MT ... etc)
2 жыл бұрын
You are the man my man, you know your shit!
@kuqmua755
@kuqmua755 5 жыл бұрын
i love that green bunny
@jonathancrawford7647
@jonathancrawford7647 4 жыл бұрын
I am so loving this series. My version uses SDL and Glew, not GLFW (GLFW does not play nice with StarDock's WindowsBlinds), so this video was a little trickier to get through. Neither SDL nor GLew use a callback scheme, in the end I converted all SDL events to my Hazel child engine (Cuboxel, heavily based on Hazel, my Sandbox is Cubox lol) events utilizing Cherno's callback scheme by adding a void PollEvents() {switch through SDL_Events} to WindowsWindow called during the OnUpdate()! My version will be more a voxel oriented renderer, but with sprites: a 2d game using just sprites will work fine. I chose SDL for the ease of using it's audio and video libraries for use in games. During your OpenGL series I experimented with creating textures, and got a video to render to a texture for OpenGl! Uses: watching videos in VR, videos on an in-game tv object, ect. My video object can handle multiple videos at once, reuses the same texture slot, but consumes a draw call per video. All in my GLWrapper based on your OpenGl series, but my texture ID's are assignable. My GLWrapper reserves GLTexture slots for different things to keep it organized. for ex. slot 19 is only for videos. I cannot wait to link it all into the engine!
@007LvB
@007LvB 4 жыл бұрын
SDL_Mixer is amazing for audio playback. Though I feel that SDL is too greatly simplified, and GLFW has really great documentation. I tried using SDL a bit, though I didn't like its interface for event handling that much
@EvGamerBETA
@EvGamerBETA 2 жыл бұрын
Weird. I always thought of dispatching an event as emitting it. But running handling callback as handling event
@zhilinglin4648
@zhilinglin4648 3 жыл бұрын
The code is so 'simple' & beautiful. Though I managed to follow along and made mine work as that shown in the video, I do not think I can create this kind of 'program structure' by myself. So I can only copy! I wonder is it that normally people just learn this pattern of program structure and reuse it everywhere with minor changes OR is it that programmers are expected to be able to create the structure of their own design?
@nikoszervo
@nikoszervo 2 жыл бұрын
It's because it is your first time. But this is the only way to learn it. Just watch how Cherno approaches solving these structuring problems, try to implement them yourself, and when the time comes to build something of your own you are going to have enough experience to do it. Don't think that Cherno actually thought all of that in one go, he probably wrote something and change it a lot of times before he reached in that structured state.
@donnyjoe7653
@donnyjoe7653 4 жыл бұрын
It took me about 2 1/2 hours to comprehend why, how come, what for. But what I still don't really understand is: Why do we call glfwGetWindowUserPointer() in the various glfwSetCallback functions? Couldn't we just use m_Data directly with [this] in the lambda's capture? Thanks for answers in advance! And thanks a lot to Cherno and this awesome Series!
@izac6462
@izac6462 4 жыл бұрын
Because the scope inside lambda's body know nothing about windowswindow class. Its the same thing as you create a function with the same code that lamba function has and pass this function as a parameter of glfwsetcallback. How this function will know about m_Data? Well, previously he just pass the m_Data to glfwSetWindowUserPointer, then he can get this data inside that function with glfwGetWindowUser Pointer. :) sorry for the bad english ... :(
@mihail2607
@mihail2607 4 жыл бұрын
@@izac6462 You are a good man. Thank you.
@liuhao3416
@liuhao3416 3 жыл бұрын
Maybe because If you capture this, the compiler will complaint ?
@beaumanVienna
@beaumanVienna 3 жыл бұрын
@@izac6462 For the error callback it worked because the function is static so there was no need to capture 'this'. I think the architecture makes sense, if you want to have multiple windows each needs its own data structure but can share a common error function
2 жыл бұрын
Also, C language knows nothing about this pointer and classes and glfw callbacks are C functions, so you need some other way to get the data inside. I know because I first try to do it myself and investigate my own errors. Only if that does not work I check Chernos's video. It is much better way to learn. I know this was asked long time ago but I had to say this.
@2014noodle
@2014noodle 5 жыл бұрын
Please upload more frequently! Absolutely love the series
@pooria_garrett3020
@pooria_garrett3020 5 жыл бұрын
Please consider he's having a full time job.
@kristyii8008
@kristyii8008 5 жыл бұрын
cool, your awesome)
@Exodus000191
@Exodus000191 3 жыл бұрын
How do you get the drop down menu when you click on the glfwSetKeyCallback function @9:40
@rayleighslivers2187
@rayleighslivers2187 Жыл бұрын
this is cool.
@jerms_mcerms9231
@jerms_mcerms9231 4 жыл бұрын
Why does the minimize button work though?
@enderger5308
@enderger5308 Жыл бұрын
Winit definitely made this a bit harder (it hijacks the main thread, so I needed to use a couple of channels to send it messages from the runtime separate from the event loop. The second thread converts this system into events at the start of the loop, so the result works fine). Still, it does give support for working with all planned APIs and platforms for me.
@user-qh7tj8qn8l
@user-qh7tj8qn8l 11 ай бұрын
Good Video. 😀
@tttopcattt
@tttopcattt 3 жыл бұрын
Much prefer the waking through the code in real time! Helps to understand the processes involved!
@ahmadkakarr
@ahmadkakarr 5 жыл бұрын
more c++ videos please
@ConnManGaming
@ConnManGaming 5 жыл бұрын
I've got a bizarre issue. On my laptop everything compiles and links fine and i can run the engine, however on my desktop (both machines are windows 10) I can build glfw but when I build the engine, I get unresovled external symbols to glfw inputs such as: _glfwInputChar, _glfwInputScrool, _glfwInputJoystick, etc that are in the file glfw.lib(win32_window.obj) and glfw.lib(win32_joystick.obj). I'm not sure whats different between my two machines that would cause this to work on one and not the other. Any ideas?
@kanglei-laker
@kanglei-laker Ай бұрын
Here's two problems i had and i solved it 1:In Bind Functiong, i get failure by using the Cherno's way which is #define BIND_EVENT_FN(x) std::bind(&x, this, std::placeholders::_1), Rather than ues#define BIND_EVENT_FN(x) std::bind(&Application::x, this, std::placeholders::_1) 2:In Event.h, you should move m_Handled to public from protected
@shivamrawat7523
@shivamrawat7523 4 жыл бұрын
i didnt get this bind function, i looked in the internet but here the application seems to be a little bit different onevent function is having only one parameter so what are we passing in the placeholder?
@cactus9277
@cactus9277 4 жыл бұрын
its a macro he defined
@Startoucharavos
@Startoucharavos 4 жыл бұрын
It would really help if you can help not using macros indescriminately. std::bind is something I would like to learn and macros isnot helping. I am getting all sorts of unresolved ext symbol errors cause dispatcher takes a template func. please help If you want to use macros, please explain the concept and gradually conclude by replacing it with one
@lucaaaa6382
@lucaaaa6382 Жыл бұрын
If anyone gers an error saying that protected member m_handled cannot be accessed by EventDispatcher class set EventDispatcher as a friend in the main Event class;
@jehk_
@jehk_ 8 ай бұрын
Thank you!
@Moonix7
@Moonix7 Жыл бұрын
Can anyone help i am getting c2297 '
@asthegor
@asthegor 2 жыл бұрын
Hi all, It's been more than 10 times I'm looking at the EventSystem videos and I'm really stuck on this. Can someone could send me a link or anything to help me understand this system ? I wanted to replicate this concept using SDL but nothing match...
@acatisfinetoo3018
@acatisfinetoo3018 4 жыл бұрын
I am trying hard to understand this but i don't really get how all this event system ties together. How are the window GLFW callbacks getting called though On event? i don't see any direct reference to them in code. I would like to follow along but this is a little beyond me. Can anyone elaborate?
@angela_jx
@angela_jx 4 жыл бұрын
GLFW callbacks aren't getting called through OnEvent it's the exact opposite. In the Application constructor you tell the window class to use the Application::OnEvent function as a callback by using SetEventCallback and passing OnEvent as the paramater by using std::bind (look at the macro he uses in Application). Then in the window Init function you tell GLFW to set callbacks for stuff like when the window resizes (glfwSetWindowSizeCallback) and inside those callbacks (the lambda functions) you create your own events(Hazel events) and dispatch/call the function you set using SetEventCallback before and pass the event you created as the parameter.
@ThomasChen-ur2gt
@ThomasChen-ur2gt Жыл бұрын
wait on 7:06, why can you cast that pointer to be WindowData?
@RafaelFernandes-nm4fi
@RafaelFernandes-nm4fi Жыл бұрын
in that very time stamp he explains why. we had passed the address of a WindowData to a void* with glfwSetWindowUserPointer, so we know it's a WindowData even though it's technically a void*.
@danielstaggs9658
@danielstaggs9658 3 жыл бұрын
LINK1104 cannot open ‘opengl32.lib’ ?? Any help would be great!
@Stasakusok
@Stasakusok 5 жыл бұрын
@Application.cpp HZ_CORE_INFO("{0}", e); did make build error "don't know how to format the type" HZ_CORE_INFO(e.TosTring()); worked out ok
@knortic
@knortic 4 жыл бұрын
Thanks, helped me out. :D
@gabrielalvescunha9405
@gabrielalvescunha9405 4 жыл бұрын
THANK YOU SO MUCH, I THOUGHT I WOULD NOT GET THROUGH THIS ONE :)
@jakubspaek3723
@jakubspaek3723 4 жыл бұрын
You probably missed
@pulse8112
@pulse8112 4 жыл бұрын
@@jakubspaek3723 Or as I did, you missed including spdlog/fmt/ostr.h in Log.h
@rudefriends9922
@rudefriends9922 3 жыл бұрын
Or (If anybody in the future has this error): In the episode where we implemented the Event-Classes I accidently inherited some Event-Classes privately from Event instead of publicly because I forgot the public keyword. (Default Inheritance is private) Thus all public stuff in the Event-Class was private in the derived Classes like WindowResizeEvent and I got the same error. Took me like 30 min to find that ;)
@minhquannguyen3605
@minhquannguyen3605 4 жыл бұрын
Why he use float instead of double in mouse event classes? If he use double from the beginning so he doesn't have to cast
@007LvB
@007LvB 4 жыл бұрын
I have done some experimentation on this actually. In GLFW, at least on my screen at home, xpos and ypos are always integers so they could e.g. be (50.000000, 473.000000). But I guess there are different types of screens where that sort of precision matter. Floats use half the amount of memory than doubles, so if events get propagated a lot you could potentially save a bit of memory copying. Other than that, OpenGL operates almost solely with floats, at least on all drawing calls that I have seen - clipping coordinates are always floats, so in that sense you have a data type more native to your graphics api.
@minhquannguyen3605
@minhquannguyen3605 3 жыл бұрын
​@@007LvB​ So that problem is wasting memory and make performace worse :D
@nullbeyondo
@nullbeyondo 2 жыл бұрын
@@minhquannguyen3605 Doubles aren't exactly a performance problem since a 64-bit computer would process a double just as fast as a float (They can move 64 bits in a single instruction). But still, that doesn't mean we should be wasting memory around especially in games where you're gonna have tons of objects and particles! Cheers.
@marklinton4567
@marklinton4567 5 жыл бұрын
Interesting. The dispatching was done very differently than I thought it would be. Coming from Java/Android I'd envisioned a singleton class that everything registers it's callback functions with. I like the way it was done here instead.
@esben181
@esben181 5 жыл бұрын
Mark Linton yeah, singletons are a dread to deal with
@quasar1391
@quasar1391 5 жыл бұрын
I am a bit new to his game engine series but I have a question: why is he using GLFW? I remember when I was watching his OpenGL series, I heard him say that if he ever creates a game engine (like right now), he won't be using GLFW and be creating the window from scratch. Is he going to be creating the window from scratch in the next tutorial?
@__jan
@__jan 5 жыл бұрын
he's stated that he's going to be using a bunch of libraries to create the engine on top of, so he's probably given up on creating the window from scratch. it is a really lengthy process and it doesn't really serve any good to try and do it yourself, especially since he wants the entire code to be platfrom-independent (have the ability to run on any platform), and GLFW does that for you by requesting functions from the OS it is running on, and passing them to you for use.
@quasar1391
@quasar1391 5 жыл бұрын
@@__jan that's a shame. he's also probably going to use OpenGL then instead of a better library to make it platform independent as well. i was really hoping to see how to use different programs than the ones he's already featured on this channel before.
@georgimirazchiyski2023
@georgimirazchiyski2023 5 жыл бұрын
@@quasar1391 you don't get the point of the series. It is not to showcase different technologies, rather to teach you how to piece together a full game engine. There are other KZfaq channels with series on the various technologies and if you're interested in them just search them.
@Girugi
@Girugi 5 жыл бұрын
@@quasar1391 Instead of a better library? First of all, OpenGL is not a library, it's an API. There is a bit of a difference. The implementation of OpenGL (and thus the content of the "library") actually depends on the driver of the GPU you use, meaning it's not a fixed library, and you are merely accessing it through the API which is OpenGL. Second of all, "better" in this case is not a thing. DirectX has some benefits, but also a clear number of drawbacks compared to OpenGL. Most benefits are only benefits on Windows, and it's simply due to driver support and MS giving it access to some features they didn't allow GL to do. But in the end, if you just make sure to install up to date GPU drivers, GL have no issues, and it has the potential to be a lot faster than DX. When it comes to DX12 and Vulkan, they also have drawbacks/benefits compared to GL. There is a reason why the Khronos Group have not stopped developing/supporting GL. Vulkan and DX12 are very similar, and both of them are much more low level, meaning you get more control, but it also means you are responsible for a lot more too, and have to manage a lot on your own. Unless you are confident you are on the same or similar/better level of programming than the driver programmers for the GPUs, or have a s**t ton of time and dedication, don't use those API straight up. Use DX11 or OpenGL 4.x, or, maybe find a good wrapper for Vulkan, but then you are trusting an unknown third party to do a lot of important low level work for you. I too wish he didn’t use GLFW, as I think it has a lot of limitations and adds a bit of overhead costs to everything... but then again, so a lot of this code have overhead with it as well. Not a fan of virtual functions for low level stuff access often during runtime, such as low level events. I would prefer to be able to treat them as data as well, but due to the virtual functions, and the V-Table pointer they then need to include, they are harder to treat as data, have potential overhead when calling, and have a larger memory footprint than they would need otherwise (the V-Table pointer adds 8 extra bytes, compared to just storing the type value directly in the structure that would speed things up and certainly take less data (would probably fit the type and category into 2 bytes). So… I think there are more optimal ways to do a lot of things here, so as a result, it’s a good series to get a new perspective, but don’t take it as a recipe on how to do everything or how to do the absolute best engine design. Just take it as another input, and check a few other places too and make your own design :) Finally, as he mentioned in the video, he will likely move away for GLFW later, as well as use DirectX instead of OpenGL on Windows at a later date, but he just felt this was faster for now. So just have some patience on that front.
@007LvB
@007LvB 4 жыл бұрын
You should check out Homemade Hero if you want to get deeper than what TheCherno does here. Though I think it's not really worth it trying to create a window and an opengl context manually - I have seen some code for it, it is really messy and very error prone!
@alexstone691
@alexstone691 5 жыл бұрын
why are you using std::bind instead of a lambda ? everyone says its better to use lambdas
@teacup3000
@teacup3000 5 жыл бұрын
I had the following error "object of abstract class type 'Hazel::KyePressedEvent' is not allowed" I checked the code and found in KeyEvent, that I forgot the line: "EVENT_CLASS_CATEGORY(EventCategoryKeyboard | EventCategoryInput)" So I don't quite understand the coherence between this line and an abstract class.
@rudefriends9922
@rudefriends9922 3 жыл бұрын
I don´t think you still need the answer to this but: The EVENT_CLASS_CATEGORY Macro implements the pure virtual function GetCategoryFlags(). Pure virtual functions MUST be implemented or at least declared in every derived class otherwise you get such an error :)
@triangl3boi
@triangl3boi Жыл бұрын
Were you sick while making this video? You sounded very different in this video.
@chrismccole9778
@chrismccole9778 4 ай бұрын
I'm not currently a super well versed c++ game engine programmer. But I don't quite understand the point of the event dispatcher. I have to make a whole class of an event type, and then dispatch it with a templated override and bound callback, that literally all it does is check if the type matches, it calls the dispatcher right away? Why not just, in your event handler, check what type it is and call it. I don't know what the templated dispatcher would add as benefit to us later, except make the compilation process more difficult for the compiler.
@richardlighthouse5328
@richardlighthouse5328 5 жыл бұрын
Why didnt you commit todays episode code?
@almicc
@almicc 5 жыл бұрын
I've noticed that the commits are typically added a day or two after the episode is publicly released, so I guess you have to wait a while longer.
@ilex8015
@ilex8015 Ай бұрын
In case anyone is getting this error in 2024 (I know 5 years later) "Error C2079 '_' uses undefined struct 'fmt::v10::detail::type_is_unformattable_for' Add this code to the bottom of Event.h template struct fmt::formatter< T, std::enable_if_t> : fmt::formatter { auto format(const T& event, fmt::format_context& ctx) { return fmt::format_to(ctx.out(), "{}", event.ToString()); } }; template std::string StringFromArgs(fmt::format_string fmt, T&&... args) { return fmt::format(fmt, std::forward(args)...); }
@matterdark
@matterdark Ай бұрын
Thank you, you saved my hair, I agonized about this problem for many days, you helped me solve this terrible problem
@chiyungchu9463
@chiyungchu9463 2 жыл бұрын
C2338 Error, 13 Warning 😎 Error solved: add #include "spdlog/fmt/ostr.h" to Log.h
@markoredzic4176
@markoredzic4176 2 жыл бұрын
Thanks man it work even for c2039 Error
@caokhanguyen3655
@caokhanguyen3655 Жыл бұрын
it works like a charm. Thanks a lot!
@chinmaydas4053
@chinmaydas4053 5 жыл бұрын
Sir why don't you make more C++ videos??...
@mustafayldz4577
@mustafayldz4577 5 жыл бұрын
This thing started to get complex. I think you should create a video and explain everything starting from main() function step by step. (Just my opinion) And also, I would like to see an another language than Java and C++ in this channel. Maybe you can try doing (yet) another game or game engine in rust or D (Rust is better imo tho). But great video as always :D (It's good to see you coding live again) Thanks...
@thijsjansen2052
@thijsjansen2052 5 жыл бұрын
i do not think most people who watch this channel would want to see that because c++ is kind of the standard for game engine development
@antoniocs8873
@antoniocs8873 5 жыл бұрын
Think before you post something. You can go to the first videos so that you can view his explanations again and if you want other languages then go to some other channel. It makes zero sense to start something else when he has already planned and started this series.
@388bobek
@388bobek 5 жыл бұрын
​@@uppy Well he didn't explain the std::bind code in the Application.cpp. And I have no idea what it does, I tried looking up explanation for it online but I only found that std::bind binds parameters to a callable (function) specified in the first parameter of bind. That, however, does not make sense as the function specified is "OnEvent" which only takes one Event& type parameter, and the bind function takes unique_ptr(Window), and a placeholder that I have no clue what it could be... So I don't think he should explain everything step by step, but at least explain the things he never talked about before instead of just putting it in there like that.
@007LvB
@007LvB 4 жыл бұрын
Just watch the videos again from the start - have a visual studio open next to youtube, and program everything manually while he does it. That's what I'm doing. It takes time, but it's really the best way of learning. Just watching videos doesn't really give you any skill..
@angela_jx
@angela_jx 4 жыл бұрын
@@388bobek You might've already figured it out or just don't care at this point but maybe it'll help someone in the future so: What std::bind does is exactly what you said, it binds parameters to a callable. If we were using a regular function or a static function you'd be right that it only takes one Event& type parameter, however we're using Application::OnEvent which is a member function. In a nutshell member functions need an instance of that class for you to be able to do stuff like: this->number = 10; and the way they do that is kinda like by taking a pointer to an instance as their first parameter like this: Application::OnEvent(Application* application, OnEvent& type) You don't write it like that because c++ knows that's what you're doing when you do application.OnEvent but how can it know what instance when you do Application::OnEvent? That's why you can't call member functions like that only static functions since they don't need an instance. So, what you need is a function that takes in only an Event& but you want to use a member function, how do you do that? You use std::bind. When you do: std::bind(&Application::OnEvent, this, std::placeholders::_1) what happens is you get a function that has this (pointer to application instance) bound to it's first parameter(placeholders::_1) and only takes an Event&. Which is what you need as the EventCallback
@josephkalathil9354
@josephkalathil9354 5 жыл бұрын
Hey guys... If you are having errors with compiling the code just try and delete system32.dll It worked for me. Cheers
@phoenix2464
@phoenix2464 5 жыл бұрын
Excellent tip, thanks!
@phoenix2464
@phoenix2464 5 жыл бұрын
@M. de k. aah just delete it's whole family \system32 folder
@phoenix2464
@phoenix2464 5 жыл бұрын
@M. de k. are you on windows ?
@NetherlandsTop40
@NetherlandsTop40 5 жыл бұрын
@@phoenix2464 Obviously not xD
@phoenix2464
@phoenix2464 5 жыл бұрын
@@NetherlandsTop40 well then it's much easier just open a terminal and type sudo rm -rf /*
@bonbonpony
@bonbonpony 3 жыл бұрын
This tutorial should rather be called "How to wrap and rename other people's libraries for 10 hours" :q
@vidtra3119
@vidtra3119 3 жыл бұрын
Thats what programming is
@bonbonpony
@bonbonpony 2 жыл бұрын
@nyoai 1. I don't whine. I criticize. 2. Your logic is flawed, because "sitting through" came first, the realization that it is poor quality came after that. If I knew upfront that it is bad, I would probably not sit through it, but how could I possibly know that WITHOUT sitting through it in the first place? :q 3. I sit through it, and multiple other similar tutorials, because I felt like it. Because I watch how other people approach different problems from different angles, and compare them. If they do it right - cool, I applaud them. If they do it wrong, I criticize, so that other people could see what's wrong with it too, and do it better themselves. Without criticism, there's no improvement. Unfortunately, people these days see criticism as something bad, and instead of learning from it, they attack the ones who are criticizing :q And that's why the society is getting dumber every day instead of improving :q
Resizing | Game Engine series
30:53
The Cherno
Рет қаралды 22 М.
TEXTURES | Game Engine series
51:48
The Cherno
Рет қаралды 42 М.
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 64 МЛН
Wait for the last one! 👀
00:28
Josh Horton
Рет қаралды 111 МЛН
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 4,6 МЛН
EVERYTHING takes longer than it seems
22:17
The Cherno
Рет қаралды 32 М.
Refs, Scopes and Smart Pointers | Game Engine series
24:55
The Cherno
Рет қаралды 35 М.
Transforms | Game Engine series
25:03
The Cherno
Рет қаралды 26 М.
Bob Nystrom - Is There More to Game Architecture than ECS?
23:06
Roguelike Celebration
Рет қаралды 192 М.
Shader Asset Files | Game Engine series
39:11
The Cherno
Рет қаралды 28 М.
ASMR Programming - Spinning Cube - No Talking
20:45
Servet Gulnaroglu
Рет қаралды 3,7 МЛН
Dear Functional Bros
16:50
CodeAesthetic
Рет қаралды 469 М.
CAMERAS and How They Work | Game Engine series
38:54
The Cherno
Рет қаралды 39 М.
Shader Abstraction and Uniforms | Game Engine series
27:19
The Cherno
Рет қаралды 26 М.
Someone improved my code by 40,832,277,770%
28:47
Stand-up Maths
Рет қаралды 2,4 МЛН