hi guys welcome to the second video in the mgy coding series today we're gonna make a simple introduction we're gonna open the source compile it and create a window and from the next video we will actually start explaining stuff we're gonna start explaining options and how to make all kinds of different cool things we find gui so let's get started with a bit of basics and explaining and i'll get to more complicated stuff later so in our mgi master here we have a folder named examples now in later videos i will show you how to
include mgui in your own project but for now until we learn about it um we're gonna work on an example we have here so we're gonna double click examples you see we have a bunch of them here and we're gonna open the imgui example solution file here double click and it will open in visual studio which you should have installed if you watch the first video if not go watch that first and we're going to wait for it to open now if it shows something with retarget projects this is because you have a 132 platform
installed so you can keep it on 142 and click ok i'm gy uh works fine on 132 as well now we're going to work on one of these directx examples i recommended either directx 9 or directx 11 and we're going to work on directx 11. it's not that big of a difference because we're only working with mgy now not with implementing it anywhere but open win32 directx 11 go to sources and open main cpp by double clicking it now before it's we start doing anything go here where it says debug and choose release and here
where it says win32 and choose x64 will no longer be able to debug your application this way but it's better for performance if you want to debug you're going to switch back to debug all right there is a lot of things there are a lot of things here and i will explain most of them in the tutorial later because they're complicated stuff but for now we just need to go through the main things so here basically we create the windows window here we show an updater window and here imgui set up itself you can see
you have a lot of um comment lines added if you want to read about them but the main thing that happens your windows are inside the wild loop here this happens every tick basically 20 times a second and everything that is here will show in the window so let me actually show you first of all let's start by deleting the demo window because we don't need it for now and we can also delete everything here because i want to explain everything so you don't actually need here you can delete everything from a dash dash 2
and dash 3 so delete these windows and after you implemented a new frame here and before render you can create your windows here so in order to create another window we're gonna use if an if statement and we're gonna use i'm gui begin and after that you're gonna see it asks for a few arguments but only one of them is needed the name the others are optional so i can give it a title if we want and let's say we have test title why not and then we're gonna open brackets now a very important thing
you should do so you don't forget after the last bracket where you end the imgui begin you need to type on gui end so the program knows the window is ended and if you want to have more windows after it they do not interfere with each other so right now we have a test window and in order to build this uh if you go here and click build it will build old projects and that's a messy waste of time because we only work on the directx 11 one so go in your right here right click
on directx 11 and click build that way you only build this one wait for it to build you should not have any errors if you have any please tell me in the comments and i'll help you fix them so click on example win32 directx 11 go to release and here you have example windows 2 directx 11 exe open this and as you can see we have a window here which we can play around with it a bit but let's say we want that window to have a size we said before for that we're going to
use i'm gy double dot double dot set next window size and if you hover it you see it asks for a constant i'm vector to size basically i'm vector 2 which will type here and then parenthesis after because i'm vector 2 also requires some arguments is a structure that has only two values x and y those are sizes or coordinates that depends on what you use them for so here in line vector 2 if we pick up we have an x and a y and let's say the x is the length the y is the
no the x is the width and y is the height so let's say we want our um our window to be a square then we're going to use 500 and then 500 500 for x 500 for y and right now if we build it again don't forget to build it from here we will see that the window is now 500 by 500. we can no longer resize it because every time the window begins this will also execute if you want to still be able to resize it and set it just one time you can delete
the next and only use set windows size but if you want to have a set size we're going to use that window size also the what i want to explain to you is that the imgui window can also have few flags here so we can use the bold p open set that to true here because it asks for a bowl set the ball be open to true and after that oh actually no set it to null i believe yeah set it to no and after that you see you have a optional argument named iron guy
window flags these are some flags that can tell the window some specific characteristics so by example if we run this again right now you see it has a title you see it can collapse and you see it can resize but what if you just don't want to let people resize well you're going to type imgui window flags because we're talking about window flags there are a bunch of flags or other things but we need to refer to window flags then underscore and now you have a bunch of window flags so let's say you don't want
somebody to be able to resize for that you're going to type no resize and that's it if we now build it with the mgy window flags no resize here and open it as you can see the resize button disappeared and you cannot resize it anymore now that you want more flags you're going to type a [Music] vertical line like this and after that you can type another flag so i'm gy window flags let's say no collapse let's build it again and this will make our window not being able to collapse it again wait i'll just
enter it my youtube folders i'm geomaster examples we work on the directx 11 release as you can see we cannot collapse our window anymore the button is not there and so on we can remove the title bar or set some specific characteristics on our window so this was the video thank you a lot for watching i hope you got the basics with creating a window and next video i'll start explaining the option types the balls the checkboxes the buttons floats ins sliders and so on so thank you for watching don't forget to subscribe and leave
a like and join in my discord server if you like what i do and want to support me and i'll see you guys in the next video have a great great day