Resizing | Game Engine series

  Рет қаралды 24,140

The Cherno

The Cherno

Күн бұрын

Пікірлер: 50
@TheCherno
@TheCherno 5 жыл бұрын
One other thing with handling the resizing that you need to consider is performance; you probably don't want to be resizing all of your framebuffers whilst resizing is taking place (as seen by the log text at 11:30), but rather after resizing has finished.
@shifengliang5660
@shifengliang5660 5 жыл бұрын
Excited about multi-threading! Hope it will come soon! xD
@benfeldbergcollins6568
@benfeldbergcollins6568 2 жыл бұрын
Great video as always, Just a quick one a more robust way to handle the minimizing is to use the glfw function glfwSetWindowIconifyCallback(window, window_iconify_callback); This is similar to other glfw callbacks set in the WindowsWindow.cpp file. If you create a new ApplicationEvent for WindowMinimizedEvent you can set the minimized state in the WindowData. This will help anyone having issues on Mac / Linux with minimizing as the window size is not set rather the window is push to a background task and 'iconified' Thank you for this series :)
@rakshitx1
@rakshitx1 6 ай бұрын
+1
@almirfirmo3742
@almirfirmo3742 11 ай бұрын
I don't know if that happenend only to me, but the resizing was working fine already (exactly like his at the end of the video). And It took me some time to figure out that in the ImGuiLayer class, at the End() method, I was running the following piece of code: GLFWwindow* window = s_GetNativeWindow(); int display_w, display_h; glfwGetFramebufferSize(window, &display_w, &display_h); glViewport(0, 0, display_w, display_h); Which already corrects the size of the viewport on every Run() call of the Application class based on the Frame buffer size (apparently GLFW updates the frame buffer size when the window resizes?).
@0x356
@0x356 5 жыл бұрын
The calculation you are looking for to keep everything same size and just see more when the window is resized is as follows: Obviously its bad to have that 720.0f in there - you'd need to pass that in from sandbox somehow. bool OrthographicCameraController::OnWindowResized(WindowResizeEvent& e) { float yScale = e.GetHeight() / 720.0f; m_aspectRatio = yScale * (float)e.GetWidth() / e.GetHeight(); m_camera.SetProjection(-m_aspectRatio * m_zoom, m_aspectRatio * m_zoom, -yScale * m_zoom, yScale * m_zoom); return false; }
@Marsman512
@Marsman512 5 жыл бұрын
Considering MacOS has some weird things when it comes to window size vs frame buffer size, I wouldn't use a glfwWindowSizeCallback for resizing the frame buffer. GLFW does have a glfwFramebufferSizeCallback though, or at least that's what I use.
@incognito9374
@incognito9374 5 жыл бұрын
OMG, I learned English only for watching your videos. Perfect work, Yan. (Здесь русские есть?)
@esben181
@esben181 5 жыл бұрын
Inco Gnito noice
@agfd5659
@agfd5659 5 жыл бұрын
Zdyes nyet russkogo
@warstt
@warstt 5 жыл бұрын
@@agfd5659 Zdyes yest ruskovo!
@KennyTutorials
@KennyTutorials 5 жыл бұрын
@@warstt Konehn!
@KennyTutorials
@KennyTutorials 5 жыл бұрын
Im learn English only watching ThinMatrix (Karl), TheCodeUniverse and TheChernoProject (Yan) videos.
@tinyrobot7443
@tinyrobot7443 5 жыл бұрын
I have built some kind of mixture between cropping and scaling: when resizing vertically (changing 1920x1080 to 1920x800) it gets scaled as I want to fit exactely 2 units into my ortographic camera. When resizing horizontally it gets cropped. You can change that behaviour in the camera to scale horizontally and crop vertically.
@theo-dr2dz
@theo-dr2dz Жыл бұрын
With what we have now, it should be possible to create a view/viewport system comparable to what sfml has. This would combine the camera, the camera controller and some of the stuff of this episode. Only I would do it differently, because I think the sfml approach is very confusing and hard to use. For someone with my kind of brain, it's hard to keep the aspect ratio right with the sfml approach, because they have the view in pixels, but the viewport in normalised units that are relative to the window. I would fix it so that the aspect ratio of the view and the viewport are always equal, so that the graphics are not getting distorted when the aspect ratio of the window is changed by a resize. This implies that either change in width or change in height is dominant. Also I would do the api entirely in pixels and convert it to normalised units internally. I would also make the viewport the "main" thing instead of the view. Of course in opengl there is one viewport per context, so that if you want to draw to multiple viewports, you would have to have multiple scenes that each have a viewport. Every begin_scene would change the opengl viewport to reflect the scene viewport.
@michamarzec9786
@michamarzec9786 5 жыл бұрын
0:58 Java won't ever let you forget about updates.
@miguelg.s.1246
@miguelg.s.1246 3 жыл бұрын
27:54 It's not a bug it's a feature!!
@christianheidemann3829
@christianheidemann3829 5 жыл бұрын
Perfect timing Cherno, just came home from Uni!
@msid9870
@msid9870 5 жыл бұрын
Haha same
@jacob26referibles
@jacob26referibles 5 жыл бұрын
When you were just starting out, what books did you use to get the fundamental basics of what makes up a game engine and walked you through implementing a simple one?
@pooria_garrett3020
@pooria_garrett3020 5 жыл бұрын
Game Engine Architecture is one
@spencersmith4305
@spencersmith4305 3 жыл бұрын
I'm having a lot of problems with the resizing. I copied all of the code exactly to see if it would work, but when I resize the window everything rotates by almost 90 degrees on the y axis. (or it's just squishing everything to be very thin, it's hard to tell) Has the glViewport() command changed or something?
@spencersmith4305
@spencersmith4305 3 жыл бұрын
Nevermind I just had a random - symbol where it shouldn't have been. I spent 2 hours on this haha
@RandomGuyyy
@RandomGuyyy 5 жыл бұрын
Cherno said in a couple of videos (I think) that his favourite graphics API is DX11 - How about a DirectX 11 series? Like, it could be a sort of conversion course comparing it with the equivalent OpenGL calls and pipeline.
@weltlos
@weltlos 5 жыл бұрын
He already said that the engine is definitely going to support DX11 and maybe Vulkan at some point too. If you can't wait maybe look into ChiliTomatoNoodle's tutorials. He is currently doing something similar but with DX11.
@supremedeity9003
@supremedeity9003 4 жыл бұрын
@@weltlos He Jumps the gun a lot, new episode and bam all windowing stuff + input done. following along can be a hassle that way.
@weltlos
@weltlos 4 жыл бұрын
@@supremedeity9003 Yes, I agree, his way of explaining things is pretty straight forward. At the same time, however, you get the feeling that it is actually your project and that you are researching how specific things _can_ be done, how specific mechanisms work and not so much how to implement them step by step, because this is mainly your task, as project manager, so to say. Good luck!
@whythosenames
@whythosenames 5 жыл бұрын
Can you also render while resizing or doesn’t it work in opengl?
@cheako91155
@cheako91155 5 жыл бұрын
You've stopped the forwad progression of time during minimize.
@sumitdhingra9520
@sumitdhingra9520 4 жыл бұрын
I don't know for some reason on my Mac OpenGL 4.1, the resizing was working fine without setting the viewport. Does anyone know if there a particular reason for that?
@sumitdhingra9520
@sumitdhingra9520 4 жыл бұрын
for anyone looking for answers it has something to do with RetinaDisplay
@nauq302
@nauq302 4 жыл бұрын
Window Resize Event not show the {0,0} in Minimized in my Ubuntu 20.04
@sam_is_people1170
@sam_is_people1170 3 жыл бұрын
thanks!!!
@tim21010
@tim21010 5 жыл бұрын
So excited about each new vid!
@theo-dr2dz
@theo-dr2dz Жыл бұрын
He keeps saying that you shouldn't use imgui in the game itself, just in debugging and development tools, but he never gives a reason why not. Now, I think imgui looks pretty good (better than most actually) and it has a lot of functionality. I guess for a game it looks a bit office-y, but building your own gui is quite a project in its own right. Is there any reason beyond looks not to just use imgui as the game gui?
@Destroyer19941995
@Destroyer19941995 4 жыл бұрын
My entire picture stretches when I do that
@JinkunOu
@JinkunOu 7 ай бұрын
You need to update the camera's orthogonal matrix at the same time.
@chris_burrows
@chris_burrows 5 жыл бұрын
Early squad reporting in
@pooria_garrett3020
@pooria_garrett3020 5 жыл бұрын
Oh look whose squad it is ;)
@kavishshah6441
@kavishshah6441 5 жыл бұрын
Can you make a video on what visual studio plugins you use and what are the best ones For eg: How do you get the words underlined in red when there's an error and stuff I don't get that in my vs Please!
@Stephen_Samuel
@Stephen_Samuel 5 жыл бұрын
There should be an option in the tools>options
@nicolassurfay2585
@nicolassurfay2585 5 жыл бұрын
Ah, what is your VS theme it kinda looks cooler than the default one. BTW AWESOME VIDEO!
@scrub6515
@scrub6515 5 жыл бұрын
default VS theme with visual assist x
@nicolassurfay2585
@nicolassurfay2585 5 жыл бұрын
@@scrub6515 wait I didn't understand the orange, yellow combination of the text color comes with visual assist x?
@JackPunter2012
@JackPunter2012 5 жыл бұрын
@@nicolassurfay2585 yes it does, you may need to go into visual assist settings and turn on the plugins highlighting
@nicolassurfay2585
@nicolassurfay2585 5 жыл бұрын
@@JackPunter2012 OK!
@_vnzin.7
@_vnzin.7 5 жыл бұрын
Br?
@tanujmehta7155
@tanujmehta7155 5 жыл бұрын
Make videos about competitive programming with c++
@BrokenPuzzle03
@BrokenPuzzle03 5 жыл бұрын
I always feel like we don't do anything in your tutorials. I'm a beginner and I learn by doing not listening.
@knodelcrafter6888
@knodelcrafter6888 5 жыл бұрын
Broken Puzzle maybe creating a game engine is not really suitable for beginning to program. Maybe consider some other tutorials?
Renderer API Abstraction | Game Engine series
47:17
The Cherno
Рет қаралды 55 М.
BLENDING | Game Engine series
19:21
The Cherno
Рет қаралды 23 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Perspective Projection - Part 1 // OpenGL Tutorial #11
24:13
Visual Profiling | Game Engine series
28:46
The Cherno
Рет қаралды 25 М.
OpenGL - shadow maps (for directional lights)
17:32
Brian Will
Рет қаралды 22 М.
AI Makes a Physics Engine (ChatGPT)
6:21
Zyger
Рет қаралды 20 М.
CAMERAS and How They Work | Game Engine series
38:54
The Cherno
Рет қаралды 41 М.
Picking a Game Resolution
6:22
Jon Topielski
Рет қаралды 27 М.
ALL IT TAKES... A Vulkan Story
29:10
The Cherno
Рет қаралды 134 М.
How To Render CIRCLES (OpenGL/Vulkan/DirectX/Metal)
39:56
The Cherno
Рет қаралды 102 М.
C++ 3D MULTIPLAYER GAME FROM SCRATCH // LIVE TUTORIAL
2:28:10
The Cherno
Рет қаралды 21 М.
Physics Engine from Scratch
11:19
therealjtgill
Рет қаралды 19 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН