Thanks for watching guys, hope you enjoyed the video! Code for this video will be up on GitHub in a couple of days, give it a try yourself in the meantime! Next episode is already available for Patrons at www.patreon.com/posts/23947394 ❤️
thanks for letting me know just saw your vid that not using namespace std is better for starter im still in college and now on 2ndyear i want to be a c++ professional like you and i wanna know what kind of track did you took and what kind of practices i should do or know thanks for the knowledge gonna keep watching your vids
For the latest ImGui version, the files Cherno copied are located in the backends folder of imgui, also, to use glad with imgui, there will be a #include "imgui_impl_opengl3_loader.h", you need to change the entire block, including the #define and #endif to: #define IMGUI_IMPL_OPENGL_LOADER_CUSTOM #include #endif There is no need to have the imgui_impl_opengl3_loader.h file as we are already using glad.
I can confirm this works now. Few notes. Don't remove anything from the block above it. Only thing you change is where it starts at #define that changes to the new one from the old and you change it to glad. If you remove the rest of the block it comes up with errors.
if you have complier error like:undeclared identifier error,the 'DC' is undeclared ,then you need to change the 'imgui.cpp' file , find the line 3839 and 3841,change it to "for (int i = 0; i < window->DC.Layouts.Data.Size; i++)" and "ImGuiLayout* layout = (ImGuiLayout*)window->DC.Layouts.Data[i].val_p;"
Also add window != NULL in the loop conditional. Seems to have been the cause of a headache for me using imgui 1.88 involving crashes when interacting with the demo window
Hi, thank you for your comment. Can I ask you a question? I have LNK2019 errors when I generate "Hazel" I try to resolve this problem but I cannot find the solution despite reading the documentation. That said, when I press f5 and force execution the program launches and the window opens without problem. Do you know where this error could come from? thanks in advance
Hey Cherno, I just wanted to tell you that you are an amazing teacher. Your explanations are logical and easy to follow along and you always find just the right balance between theory and practice/demos. I learned almost everything I know about c++ and how a computer works (in a more detailed way) from you. You’ve made my IT lessons in school (11th grade atm) just a tad bit easier and you got me to consider a career in the IT field. I don’t have the money to donate anything so I can just give you this. Always know that your videos are a wonderful resource. Greetings from Germany. (Btw, I love how the quality of your videos just went through the roof compared to the first few videos in the c++ series)
In a more recent version of the Imgui repo (not cherno's) the files he's copying come from imgui/backends instead of imgui/examples as shown in the video.
I did not get it to work by doing the modifications he did to the files. I did get it to work by simply copying the three OpenGL3 backend files and included the precompiled Hazel header to the top of the source file. I also read the repo's BACKENDS.md and EXAMPLES.md files. They added some more insight to ImGui file architecture. They are easy to digest, I really encourage reading them.
If you're trying to follow this tutorial now and getting build errors, you have to define IMGUI_IMPL_OPENGL_LOADER_CUSTOM so that ImGui knows you're using Glad. Otherwise, ImGui will try to use its own OpenGL loader.
Just a bit of advice if you're attempting to build against the latest version of ImGui instead of the older version from Cherno's repo, you'll need to add imgui_tables.cpp to your premake file, spent a while stumped about a linking error because of this and thought I'd spread the word.
These small troubleshooting episodes like 11:31 are awesome! Diagnosing build problems is an essential skill, but I've never seen anyone teaching it before.
I found that in imgui.cpp "CD" errors and my solution is: if(window) for (int i = 0; i < window->DC.Layouts.Data.Size; i++) { ImGuiLayout* layout = (ImGuiLayout*)window->DC.Layouts.Data[i].val_p; IM_DELETE(layout); }
The blend of pre-coding the mundane, and live coding the more "interesting" bits is definitely welcome. I'm following this series with anticipation. Thank you for your hard work, and keep it up!
I really liked the little "homework" you gave at the end of the episode! It really helped me understand how the event system works better and figuring it out was rewarding! I hope there are more of these in the future videos!
When using the latest version of ImGui. You must also include `imgui_impl_opengl3_loader.h` when copying the files to the OpenGL folder. One must also include `imgui_tables.cpp` in the files in the premake file for ImGui. When adding files to this list, take note of the file extension. (I got linker errors because i added a `.h` file instead of a `.cpp` file.
For people building on macOS (tested on 12.5.1 (21G83) / M1, with GLAD GL v4.6 Core prof.) and you happen to see the following run-time error when running SandboxApp: ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile vertex shader! ERROR: 0:1: '' : version '410' is not supported ERROR: 0:2: 'layout' : syntax error: syntax error ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile fragment shader! ERROR: 0:1: '' : version '410' is not supported ERROR: 0:5: 'layout' : syntax error: syntax error ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to link shader program! (with GLSL '#version 410 ') ERROR: One or more attached shaders not successfully compiled Segmentation fault: 11 Insert the following code in , just before m_Window = glfwCreateWindow(...); // GL 3.2 + GLSL 150 const char* glsl_version = "#version 150"; glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // Required on Mac (copy/pasted from imgui/examples/example_glfw_opengl3/main.cpp)
At around the 7:21 mark you should probably note that you have the Virtual Assist Plugin which allows you to create the definitions in the .cpp by clicking on the class name in the .h file. Most of us probably don't have that plugin unfortunately. However you can still do it on a per-member-basis by right-clicking on each of the declarations in the .h file, going to Quick Actions and selecting "Create definition of 'XXXMember' in ImGuiLayer.cpp". You have to do this for each one unfortunately which is cumbersome and possibly slower than just copying the members and paste/editing them manually in the .cpp.
If you just highlight all of them within the class and right click, it will do all of them all at once. However, it will append the namespace to it like: void Hazel::Application::OnUpdate() BUT!!!!! If you go into the .cpp file and type out the namespace and the brackets before performing the quick actions - create def... like: namespace Hazel { } ... when you perform the quick actions, it will add the function definitions inside the brackets without appending the namespace.
For those rolling through this right now. I had to add the line "#include "ImGui_tables.cpp"" to a generic .cpp file (Just create a rando one in the OpenGL folder) in order to remove all the linker errors that popped up. Might be because I'm working with the latest imgui and the folder structure is very different.
If anyone else has the problem of the config flags for docking and viewports not being defined, it is because you did not get the docking branch from the git submodule. I fixed this by cloning the imgui folder from the Hazel repository. Hope this helps :)
For anyone who has a problem with Exception thrown at 0x000... in Sandox.exe: 0xC0000005: Access violation executing location 0x000... its a problem with the initialization of GLW or Glad. Try to check WindowsWindow.cpp file for int status = gladLoadGLLoader((GLADloadproc)glfwGetProcAddress); or int success = glfwInit(); in Init function in the section about GLWF and overall make sure that Init function is set correctly. Good luck
This is where I have been stuck, thank god you spoke about it. So you mean I must initialize glad in the windowswindow rather than in opengl cotext class?
For 1.89.8 you need to have this in the top of the cpp file: #include "hzpch.h" #include #define IMGUI_IMPL_OPENGL_LOADER_CUSTOM #include "imgui_widgets.cpp" #include "imgui_tables.cpp" #include "imgui.h"
1.89.9 It game me a define MATH_OPERATORS error removed the widget and tables to make it work: #define IMGL3W_IMPL #include "hzpch.h" #include "imgui.h" #define IMGUI_IMPL_OPENGL_LOADER_CUSTOM #include #endif
Do you need multiple Applications? Doubtful in this case so why add more steps and overhead just to say we are not using a singleton? Curious if there is a reason to do this other then "Boo Singletons..."
Just a helpful tip, with the new way ImGui is set up, you no longer need the examples folder, he points out a function or two going back to it, but those function are now held in the root folder of ImGui, I say that because I was experiencing some clashing problems when it to building my engine project.
I was trying out the solutions from the comments but I am still unable to solve it. So I copied the files like he did, they were in the backend directory, and after doing everything. I get an error telling me to include the precompiled header but it's coming from the old file that is still in the backend directory instead of the copied files I edited. EDIT: I do not know how but I solved it somehow. I basically removed all project files and reran premake and that fixed it, it seemed to have some weird connection. SOLUTION: You can follow everything in the video perfectly and the only difference is the header file. You have to search for #define IMGL3W_IMPL #include "imgui_impl_opengl3_loader.h" and then replace these two lines with #define IMGUI_IMPL_OPENGL_LOADER_CUSTOM #include You don't need the loader because you are using glad. This is the only extra thing I did and it started working and I am using the latest imgui repo from cherno.
I have a weird problem. When I try to build the imgui project it fails because inside it, in the file imgui.cpp I get a undefined symbol error at line 3840 because apparently the variable DC is undefined. Now mind you I have the imgui premake exactly like his and I'm pretty sure that's not the problem as DC is used inside imgui.cpp a lot and the only place where it is undefined is in the declaration of the function SetActiveID. I know this because I've looked up all the refferrences of DC and it only is undefined in to places inside SetActiveID. If you have any idea about what I could do please help me because I really want to move forward and continue this series.
@@hubbacubba I switched to a newer version and I don't have that problem anymore. Plus note that he switches to the docking branch of Imgui a few videos later and you'll have to do that too
For some reason ImGui_ImplOpenGL3_RenderDrawData() throws and access violation when trying to set the vao_handle variable on line 194 (abouts). The exact error says "Access violation executing location 0x0000000000000000. I'm kind of new to C++ so I'm not sure what I screwed up. Once the Hazel repository is updated I'll look to see if I messed anything up.
This is most likely an issue with using an OpenGL loader that hasn't been initialized. OpenGL being a mess all the function pointers need to be dynamically loaded, there are many helper librairies for that. Note that imgui_impl_opengl3.cpp is using the gl3w loader by default, if you use another change the define/include accodingly
Cherno said Application will be a Singleton, but I find no Application constructor call. And isn't the Application constructor call should be in the getter and App's contructor should be private, based on Design Patterns by Gang Of 4?
On Windows and went over the code several times to make sure everything matches but still do not see the Demo window even though everything builds fine. Did anybody else run into this issue?
@@wopsieneter did not get a chance to try yet but will probably just try to create a fresh project and integrate everything without all the Hazel stuff
@@anthonypham7518 I fixed it since actually. Maybe you dont have the same problem, however for me the reason it wasnt working for me was because in the Application::Run, I was doing the Window Update before the Layer Update. When I swapped that it was all working as expected.
On Mac Put these right after your glfwInit() in platform specific Window class: // Have to specify these on macOS glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); // to prevent 1200x800 from becoming 2400x1600 glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_FALSE);
Hi, this thread is a little old, but I am trying to run this on mac with Xcode11 and got EXC_BAD_ACCESS (code=1, address=0x0) errors on runtime. Looks like I am not compiling or linking with the good settings. Anyone got a similar error or have any idea how to fix it? Thank you
You probably mean override, because he is overriding inherited methods. Overloading is when you make more than one methods with the same name but different method signature (different parameters). The overriding keyword is not required, but when you use it you can make sure that the method you are trying to override is indeed marked as virtual in the base class, else the compiler is going to throw an error.
If watching now, I had to #include "backends/imgui_impl_opengl3.cpp" to ImGuiLayer.cpp in order to run, this is where ImGui_Impl functions are defined, and maybe it was personal, but VS couldn't find their definitions.
I tried to run this following along and I got an *Exception thrown at 0x000... in Sandox.exe: 0xC0000005: Access violation executing location 0x000...* And visual studio is pointing at "delete app;"
For anyone else having this error, I had this problem earlier when I was accidentally logging something before the log was initialized. Check your call stack to see what is calling delete app.
Ok, so I've got a solution to this error. I was trying to add the ImGui layer before creating the window. You need to create the window first, otherwise Glad won't be initialized.
For those who had problems during the assembly of .dll, which gave LNK2001 errors, but disappeared if the onAttach and onUpdate functions were commented out in the imgui_layer.cpp file. You need to clone the repository from the Cherno/Imgui master branch and do everything exactly as in the video (including adding 2 files to platform/opengl and #include in the imgui_layer.cpp file, not #include example/imgui_impl_opengl3.h ). Then everything will work for you
Hey, I know that this video is already one year old, but could anyone tell me how to stop the window (not the console) from flickering? The flickering stops whenever I resize the Window.
If someone's going through this: check you're not running more than one window update in Application::Run() or your equivalent. If you are not, then check all render/update methods that are happening for duplicates, but it's probably coming from Application
at 24:11 why layer->OnAttach() needs to be there? It is an empty function. (As of now in series.) I tried without it, Window opens and closes automatically. What it is doing basically? can someone explain?
My project compiles out but when I click Local Windows Debugger I get an error window saying my Hazel.dll is not a valid Win32 application. If I go to Sandbox.exe and run that though everything seems to work fine. Anybody have any idea what's wrong and how I can fix it?
In case anyone else is having this problem, it's due to Hazel being the start up project. Right click on sandbox in VS and "set as start up project". Or add startproject "Sandbox" to the Hazel workspace in the premake script
Why don't you leave a direct link to the github dedicated to the video?! there are always errors and things to modify because of that... It's really annoying! You say teaching but it's not teaching, it's more about wanting to sell your Patreon... If anyone has a link to a RUclipsr who has taken up this project I would be delighted.
I feel like listening to this series would be a whole lot more satisfying if you spoke with a mic closer to your mouth, it usually makes a deeper and more pleasant-sounding voice.
I want to ask something offtopic not related to any programming language. I have a facebook jewellery business page and I would like to copy and paste all the albums from my facebook business page to instagram, linked in, twitter and so on. How do I do that. Every album has almost like 500-1000 pictures and there are atleast 60 albums on my fb page. Do you know someone who can do that. I know there must be a code or something which you people in your field might be knowing or if you can ask someone about it who could help me. Because I cant sit for hours and hours and upload 1 picture to all these other social media websites. So please if you can guide me or help me out in anyway then would really be very very grateful to you.
I skipped this whole episode because I was really not enojoying the "explaining while typing" thing, I guess maybe it's the crying babies from the last couple episodes' comment sections made you do this. But I can see this is much streesful to you, and does not provide any more information rather than us just look through the commit history. I don't understand those people's mentality which is "I can't follow it at all if you just show the full plain English paragraph, but if you type it line by line for me I will understand them all."
5 лет назад+1
I'm sorry to say this was one of your most unprepared videos ever. If people want you to code on the fly then I think it would be better if you try everything out first. Every mistake teaches something yeah but it took too long to fix just small stuff.
Cherno man... can you please stop with that intro hand flail stuff? I get that you want it to be something more personal and definitive to your youtube persona but... it's just... it seems too cringey for me man, especially when I can see you're a very intelligent and knowledgeable guy all around, but that, that anime wannabe intro it's just too much. xD
I might have done this wrong, but to get the imgui_impl_opengl3.h file compiling with no errors, in the cpp file I had to #include as well as define IMGUI_IMPL_OPENGL_LOADER_CUSTOM. I used imgui version 1.89.2.
In Application.cpp where we do e.Handled, where do we get it from? Does anyone get this error : Error LNK1104 cannot open file 'D:\OneDrive - e-uvt.ro\Informatica\Programing\GameEngine\Hazel\bin\Debug-windows-x86_64\Hazel\Hazel.lib' Sandbox Any suggestions on how to fix it?
anyone get this error error LNK2001: unresolved external symbol "private: static class Hazel::Application * Hazel::Application ::s_Instance" (?s_Instance@Application @Hazel@@0PEAV12@EA) in vs 2019?
Thanks for watching guys, hope you enjoyed the video! Code for this video will be up on GitHub in a couple of days, give it a try yourself in the meantime! Next episode is already available for Patrons at www.patreon.com/posts/23947394 ❤️
«ОпенГЛ» - you know Russian?
thanks for letting me know just saw your vid
that not using namespace std is better
for starter im still in college and now on 2ndyear
i want to be a c++ professional like you
and i wanna know what kind of track did you took
and what kind of practices i should do or know
thanks for the knowledge gonna keep watching your vids
@@AndreyUgolnik пройдут годы, а он так и не ответит
@@ne0ck237 Два года спустя он так и не ответил...
@@old_cd_rom9518 Прошло 5 лет, а новостей до сих пор нет, он хочет продать, я думаю, ха-ха-ха.
For the latest ImGui version, the files Cherno copied are located in the backends folder of imgui, also, to use glad with imgui, there will be a #include "imgui_impl_opengl3_loader.h", you need to change the entire block, including the #define and #endif to:
#define IMGUI_IMPL_OPENGL_LOADER_CUSTOM
#include
#endif
There is no need to have the imgui_impl_opengl3_loader.h file as we are already using glad.
still not working for me
I can confirm this works now. Few notes. Don't remove anything from the block above it. Only thing you change is where it starts at #define that changes to the new one from the old and you change it to glad. If you remove the rest of the block it comes up with errors.
Dude, you saved my ass. Thank you!
dude you are a legend :) This sorted the problem for me
Thank you!!!!
if you have complier error like:undeclared identifier error,the 'DC' is undeclared ,then you need to change the 'imgui.cpp' file , find the line 3839 and 3841,change it to "for (int i = 0; i < window->DC.Layouts.Data.Size; i++)" and "ImGuiLayout* layout = (ImGuiLayout*)window->DC.Layouts.Data[i].val_p;"
Thanks. This worked for me
Wo, you are a hero!
Also add window != NULL in the loop conditional. Seems to have been the cause of a headache for me using imgui 1.88 involving crashes when interacting with the demo window
thanks bro@@terrarian3712
Hi, thank you for your comment. Can I ask you a question? I have LNK2019 errors when I generate "Hazel" I try to resolve this problem but I cannot find the solution despite reading the documentation. That said, when I press f5 and force execution the program launches and the window opens without problem. Do you know where this error could come from? thanks in advance
Hey Cherno, I just wanted to tell you that you are an amazing teacher. Your explanations are logical and easy to follow along and you always find just the right balance between theory and practice/demos. I learned almost everything I know about c++ and how a computer works (in a more detailed way) from you. You’ve made my IT lessons in school (11th grade atm) just a tad bit easier and you got me to consider a career in the IT field. I don’t have the money to donate anything so I can just give you this. Always know that your videos are a wonderful resource. Greetings from Germany. (Btw, I love how the quality of your videos just went through the roof compared to the first few videos in the c++ series)
In a more recent version of the Imgui repo (not cherno's) the files he's copying come from imgui/backends instead of imgui/examples as shown in the video.
I did not get it to work by doing the modifications he did to the files. I did get it to work by simply copying the three OpenGL3 backend files and included the precompiled Hazel header to the top of the source file.
I also read the repo's BACKENDS.md and EXAMPLES.md files. They added some more insight to ImGui file architecture. They are easy to digest, I really encourage reading them.
Oh, and there's also another source file to add to the ImGui premake project: imgui_tables.cpp
@@Smartskaft2 Thanks, This was helpful.
Thanks
An alternative to that would be to switch to the master branch for the submodule instead of using backends.
If you're trying to follow this tutorial now and getting build errors, you have to define IMGUI_IMPL_OPENGL_LOADER_CUSTOM so that ImGui knows you're using Glad. Otherwise, ImGui will try to use its own OpenGL loader.
Just a bit of advice if you're attempting to build against the latest version of ImGui instead of the older version from Cherno's repo, you'll need to add imgui_tables.cpp to your premake file, spent a while stumped about a linking error because of this and thought I'd spread the word.
Just saw this post... Good call
Thank you! i was stuck so hard on trying to get the latest version working. almost pulled the old imgui branch the Cherno used 3 years ago.
omg thank you. I was about to give up
Thank you 😭
This.
These small troubleshooting episodes like 11:31 are awesome! Diagnosing build problems is an essential skill, but I've never seen anyone teaching it before.
That's why I love his live coding. I can really learn a lot from even editing. No kidding.
I found that in imgui.cpp "CD" errors and my solution is:
if(window)
for (int i = 0; i < window->DC.Layouts.Data.Size; i++)
{
ImGuiLayout* layout = (ImGuiLayout*)window->DC.Layouts.Data[i].val_p;
IM_DELETE(layout);
}
That Saved me thanks :)
thanks bro
You are my hero!
You are my hero!
you saved a lot my time thanks bro
The blend of pre-coding the mundane, and live coding the more "interesting" bits is definitely welcome. I'm following this series with anticipation. Thank you for your hard work, and keep it up!
I really liked the little "homework" you gave at the end of the episode! It really helped me understand how the event system works better and figuring it out was rewarding! I hope there are more of these in the future videos!
Sudden ОпенГЛ :D
For those struggling to find the imgui cpp and h files, they are within the "backends" folder of the imgui folder.
When using the latest version of ImGui. You must also include `imgui_impl_opengl3_loader.h` when copying the files to the OpenGL folder.
One must also include `imgui_tables.cpp` in the files in the premake file for ImGui.
When adding files to this list, take note of the file extension. (I got linker errors because i added a `.h` file instead of a `.cpp` file.
Thank you!
Thank you!Its useful
Hi GUI I’m dad
Nice one
Are you dead?
Hi i'm Glad your son XD
I am rushing through your c++ series right now. At the same time i am working with a OpenGL book and it works! Ty for those Professional videos
GL
;)
What book are you reading?
What book
For people building on macOS (tested on 12.5.1 (21G83) / M1, with GLAD GL v4.6 Core prof.) and you happen to see the following run-time error when running SandboxApp:
ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile vertex shader!
ERROR: 0:1: '' : version '410' is not supported
ERROR: 0:2: 'layout' : syntax error: syntax error
ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile fragment shader!
ERROR: 0:1: '' : version '410' is not supported
ERROR: 0:5: 'layout' : syntax error: syntax error
ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to link shader program! (with GLSL '#version 410
')
ERROR: One or more attached shaders not successfully compiled
Segmentation fault: 11
Insert the following code in , just before m_Window = glfwCreateWindow(...);
// GL 3.2 + GLSL 150
const char* glsl_version = "#version 150";
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // Required on Mac
(copy/pasted from imgui/examples/example_glfw_opengl3/main.cpp)
At around the 7:21 mark you should probably note that you have the Virtual Assist Plugin which allows you to create the definitions in the .cpp by clicking on the class name in the .h file. Most of us probably don't have that plugin unfortunately. However you can still do it on a per-member-basis by right-clicking on each of the declarations in the .h file, going to Quick Actions and selecting "Create definition of 'XXXMember' in ImGuiLayer.cpp". You have to do this for each one unfortunately which is cumbersome and possibly slower than just copying the members and paste/editing them manually in the .cpp.
If you just highlight all of them within the class and right click, it will do all of them all at once. However, it will append the namespace to it like:
void Hazel::Application::OnUpdate()
BUT!!!!! If you go into the .cpp file and type out the namespace and the brackets before performing the quick actions - create def... like:
namespace Hazel
{
}
... when you perform the quick actions, it will add the function definitions inside the brackets without appending the namespace.
@@SyrusJones12 i love you
@@catinwall4256 lol, I'm glad I could help :)
9:46, ОпенГл ;)
оупэн джиэл оупэн жиэл
аахахаХАах, это просто кирилица или он русский?
@@ne0ck237 Вроде украинец или чтото такое)
For those rolling through this right now. I had to add the line "#include "ImGui_tables.cpp"" to a generic .cpp file (Just create a rando one in the OpenGL folder) in order to remove all the linker errors that popped up. Might be because I'm working with the latest imgui and the folder structure is very different.
If anyone else has the problem of the config flags for docking and viewports not being defined, it is because you did not get the docking branch from the git submodule. I fixed this by cloning the imgui folder from the Hazel repository. Hope this helps :)
Leaving this timestamp here to resume tomorrow! 15:38
For anyone who has a problem with Exception thrown at 0x000... in Sandox.exe: 0xC0000005: Access violation executing location 0x000... its a problem with the initialization of GLW or Glad.
Try to check WindowsWindow.cpp file for int status = gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
or int success = glfwInit(); in Init function in the section about GLWF and overall make sure that Init function is set correctly. Good luck
This is where I have been stuck, thank god you spoke about it. So you mean I must initialize glad in the windowswindow rather than in opengl cotext class?
For 1.89.8 you need to have this in the top of the cpp file:
#include "hzpch.h"
#include
#define IMGUI_IMPL_OPENGL_LOADER_CUSTOM
#include "imgui_widgets.cpp"
#include "imgui_tables.cpp"
#include "imgui.h"
1.89.9 It game me a define MATH_OPERATORS error removed the widget and tables to make it work:
#define IMGL3W_IMPL
#include "hzpch.h"
#include "imgui.h"
#define IMGUI_IMPL_OPENGL_LOADER_CUSTOM
#include
#endif
9:37 @TheCherno Nice easter egg for russian speaking viewers. Отличная пасхалка, ты как всегда топ. 🤩
That hard coupling with that singleton application doesn't smell good. Why not constructor injection or other technique to decouple?
Do you need multiple Applications? Doubtful in this case so why add more steps and overhead just to say we are not using a singleton? Curious if there is a reason to do this other then "Boo Singletons..."
09:45 ОпенГЛ?
ImGui commit used here: 265a91a, 5 Dec 2018
Thank you, it has been very helpful to me
That grass rabbit looks dope! :D Any links to amazon?
It's from a stall at the Tesselaar Tulip Festival in Melbourne
Just a helpful tip, with the new way ImGui is set up, you no longer need the examples folder, he points out a function or two going back to it, but those function are now held in the root folder of ImGui, I say that because I was experiencing some clashing problems when it to building my engine project.
I was trying out the solutions from the comments but I am still unable to solve it. So I copied the files like he did, they were in the backend directory, and after doing everything. I get an error telling me to include the precompiled header but it's coming from the old file that is still in the backend directory instead of the copied files I edited.
EDIT: I do not know how but I solved it somehow. I basically removed all project files and reran premake and that fixed it, it seemed to have some weird connection.
SOLUTION: You can follow everything in the video perfectly and the only difference is the header file. You have to search for
#define IMGL3W_IMPL
#include "imgui_impl_opengl3_loader.h"
and then replace these two lines with
#define IMGUI_IMPL_OPENGL_LOADER_CUSTOM
#include
You don't need the loader because you are using glad. This is the only extra thing I did and it started working and I am using the latest imgui repo from cherno.
Thanks so much it has just helped me!!!@@SownJevan
ОпенГЛ :D
Thank you for this video, without it, I would spend a lot of time figuring this things out!
for those who are stupid like me, make sure you have a "#" before "version 410"
thanks! you are not alone
it happens
I have a weird problem. When I try to build the imgui project it fails because inside it, in the file imgui.cpp I get a undefined symbol error at line 3840 because apparently the variable DC is undefined. Now mind you I have the imgui premake exactly like his and I'm pretty sure that's not the problem as DC is used inside imgui.cpp a lot and the only place where it is undefined is in the declaration of the function SetActiveID. I know this because I've looked up all the refferrences of DC and it only is undefined in to places inside SetActiveID. If you have any idea about what I could do please help me because I really want to move forward and continue this series.
same here
@@hubbacubba I switched to a newer version and I don't have that problem anymore. Plus note that he switches to the docking branch of Imgui a few videos later and you'll have to do that too
@@lucaaaa6382 Hi, I've switched to the latest version and still have the issue, can you explain me a bit more how you did ?
@@julesvannier7979 I was able to fix the DC issue by going into imgui.cpp and replacing "DC" with "window->DC" since DC is a member of window
I had the DC issue until I reverted to the Imgui commit on Dec 4 2018
could u pls link the article u mentioned about the software development, would love to go through it as a beginner. love ur work.
6:19 at least i'm not the only one who that happens to
If you still get an invalid size exception even after following the author's update order, note that you need to use the reference ImGuiIO
For some reason ImGui_ImplOpenGL3_RenderDrawData() throws and access violation when trying to set the vao_handle variable on line 194 (abouts). The exact error says "Access violation executing location 0x0000000000000000. I'm kind of new to C++ so I'm not sure what I screwed up. Once the Hazel repository is updated I'll look to see if I messed anything up.
This is most likely an issue with using an OpenGL loader that hasn't been initialized. OpenGL being a mess all the function pointers need to be dynamically loaded, there are many helper librairies for that. Note that imgui_impl_opengl3.cpp is using the gl3w loader by default, if you use another change the define/include accodingly
I’m already Gui
Mom said it's my turn on the Gui!
What about Window maker?
Cherno said Application will be a Singleton, but I find no Application constructor call. And isn't the Application constructor call should be in the getter and App's contructor should be private, based on Design Patterns by Gang Of 4?
On Windows and went over the code several times to make sure everything matches but still do not see the Demo window even though everything builds fine. Did anybody else run into this issue?
I did too
I have it right now. Have you found the issue yet?
@@wopsieneter did not get a chance to try yet but will probably just try to create a fresh project and integrate everything without all the Hazel stuff
@@anthonypham7518 I fixed it since actually. Maybe you dont have the same problem, however for me the reason it wasnt working for me was because in the Application::Run, I was doing the Window Update before the Layer Update. When I swapped that it was all working as expected.
@@wopsieneter wow thanks. that was it. many hours were wasted on this...
On Mac Put these right after your glfwInit() in platform specific Window class:
// Have to specify these on macOS
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
// to prevent 1200x800 from becoming 2400x1600
glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_FALSE);
Hey @TheChernoProject, do you mind pushing the code to github, such that we can implement the other code as you said in the video?
i think you need to be his patreon
20:29, cuz im going to sleep I leave this here as timestamp
Yo did u watch to the end from the timestamp?
If Application is a singleton then why leave the constructor public?
Hi, this thread is a little old, but I am trying to run this on mac with Xcode11 and got EXC_BAD_ACCESS (code=1, address=0x0) errors on runtime. Looks like I am not compiling or linking with the good settings. Anyone got a similar error or have any idea how to fix it? Thank you
Why do you always have succeeds, but i get unresolved external errors?
Hey cherno, aren't you forgetting to mark overloaded methods like OnAttach in the ImGui as overload?
really enjoying this series btw.
I was wondering this as well; I just assumed it was a c# only thing. Although, it seemed weird.
The overload mark on the function definition is in c++ not needed but good practice
@@florianzimmermann2730 Thanks!
You probably mean override, because he is overriding inherited methods. Overloading is when you make more than one methods with the same name but different method signature (different parameters). The overriding keyword is not required, but when you use it you can make sure that the method you are trying to override is indeed marked as virtual in the base class, else the compiler is going to throw an error.
@@nikoszervo I just noticed he said overload thanks for pointing it out. My brain totally told me override when reading it.
Ahhh So uncomfortable... ImGui is not working fine with gcc again....
If watching now, I had to #include "backends/imgui_impl_opengl3.cpp" to ImGuiLayer.cpp in order to run, this is where ImGui_Impl functions are defined, and maybe it was personal, but VS couldn't find their definitions.
I tried to run this following along and I got an *Exception thrown at 0x000... in Sandox.exe: 0xC0000005: Access violation executing location 0x000...* And visual studio is pointing at "delete app;"
Hey did you find a fix for this?
For anyone else having this error, I had this problem earlier when I was accidentally logging something before the log was initialized. Check your call stack to see what is calling delete app.
Ok, so I've got a solution to this error. I was trying to add the ImGui layer before creating the window. You need to create the window first, otherwise Glad won't be initialized.
hello, how did you fix this error? I am having it.
For those who had problems during the assembly of .dll, which gave LNK2001 errors, but disappeared if the onAttach and onUpdate functions were commented out in the imgui_layer.cpp file. You need to clone the repository from the Cherno/Imgui master branch and do everything exactly as in the video (including adding 2 files to platform/opengl and #include in the imgui_layer.cpp file, not #include example/imgui_impl_opengl3.h ). Then everything will work for you
I *dream* of being as good at c++ as this.
I work on being as good at c++ as this.
Although I might never get there 😅
If you're willing to put the effort in, you can absolutely get there.
Nice!
Hey, I know that this video is already one year old, but could anyone tell me how to stop the window (not the console) from flickering? The flickering stops whenever I resize the Window.
you have to put the glClearColor() function inside the while loop to update all the buffers
If someone's going through this: check you're not running more than one window update in Application::Run() or your equivalent. If you are not, then check all render/update methods that are happening for duplicates, but it's probably coming from Application
at 24:11 why layer->OnAttach() needs to be there? It is an empty function. (As of now in series.)
I tried without it, Window opens and closes automatically.
What it is doing basically? can someone explain?
Oh!! Got it. The Definition is virtual and is overridden by ImGuiLayer::OnAttach().
11:52
yay
Hey @TheChernoProject, what are your views on BFV and Patricks resignation?
Did he introduced event system in Imgui windows..?
Do you speak russian?
yes
@@pooria_garrett3020 Where are the evidences?
Ya naprimer ochen dazhe do speak Russian
Дую дую, но очень плохо
@@vadimsarthannel4565 TheCherno's last name is Chernikov, maybe his parents are Russian?
hi gui im dad
please tell me how to use it with codelite
After game engine series, can you start a making game series using ue4? or hazel
My project compiles out but when I click Local Windows Debugger I get an error window saying my Hazel.dll is not a valid Win32 application. If I go to Sandbox.exe and run that though everything seems to work fine. Anybody have any idea what's wrong and how I can fix it?
I had the same error before. In general it was because of typos and forgetting some lines.
In case anyone else is having this problem, it's due to Hazel being the start up project. Right click on sandbox in VS and "set as start up project". Or add startproject "Sandbox"
to the Hazel workspace in the premake script
xiu~~~
Too small! Make you bigger!
Would you ever consider doing a C++ series using Unreal Engine 4 specifically? A lot of game developers would be very interested in this!
No, UrGui
OurGui
Why don't you leave a direct link to the github dedicated to the video?! there are always errors and things to modify because of that... It's really annoying! You say teaching but it's not teaching, it's more about wanting to sell your Patreon... If anyone has a link to a RUclipsr who has taken up this project I would be delighted.
I feel like listening to this series would be a whole lot more satisfying if you spoke with a mic closer to your mouth, it usually makes a deeper and more pleasant-sounding voice.
First ;)
you mean gay? :D
Ah yes, #include
Hi Gui, I'm dad
I want to ask something offtopic not related to any programming language. I have a facebook jewellery business page and I would like to copy and paste all the albums from my facebook business page to instagram, linked in, twitter and so on. How do I do that. Every album has almost like 500-1000 pictures and there are atleast 60 albums on my fb page. Do you know someone who can do that. I know there must be a code or something which you people in your field might be knowing or if you can ask someone about it who could help me. Because I cant sit for hours and hours and upload 1 picture to all these other social media websites. So please if you can guide me or help me out in anyway then would really be very very grateful to you.
I skipped this whole episode because I was really not enojoying the "explaining while typing" thing, I guess maybe it's the crying babies from the last couple episodes' comment sections made you do this. But I can see this is much streesful to you, and does not provide any more information rather than us just look through the commit history. I don't understand those people's mentality which is "I can't follow it at all if you just show the full plain English paragraph, but if you type it line by line for me I will understand them all."
I'm sorry to say this was one of your most unprepared videos ever. If people want you to code on the fly then I think it would be better if you try everything out first. Every mistake teaches something yeah but it took too long to fix just small stuff.
Cherno man... can you please stop with that intro hand flail stuff? I get that you want it to be something more personal and definitive to your youtube persona but... it's just... it seems too cringey for me man, especially when I can see you're a very intelligent and knowledgeable guy all around, but that, that anime wannabe intro it's just too much. xD
I might have done this wrong, but to get the imgui_impl_opengl3.h file compiling with no errors, in the cpp file I had to #include as well as define IMGUI_IMPL_OPENGL_LOADER_CUSTOM. I used imgui version 1.89.2.
In Application.cpp where we do e.Handled, where do we get it from?
Does anyone get this error :
Error LNK1104 cannot open file 'D:\OneDrive - e-uvt.ro\Informatica\Programing\GameEngine\Hazel\bin\Debug-windows-x86_64\Hazel\Hazel.lib' Sandbox
Any suggestions on how to fix it?
tyry e.m_handled. He first named it that way and probably didn't say. It's the bool variable inside the event class.
anyone get this error error LNK2001: unresolved external symbol "private: static class Hazel::Application * Hazel::Application ::s_Instance" (?s_Instance@Application @Hazel@@0PEAV12@EA) in vs 2019?
remove the initialization at the top of the cpp file and in the header file make the variable "inline".