hello in this SDL video we are going to
be implementing a hello world
application at the moment we've
initialize and what we set up STL on
maybe Xcode with Mac which is what I'm
running now
maybe visual studio or code blocks on
Windows whatever platform and whatever
development environment you have a long
as you've got it set up and running
that's fine the code from here on out
pretty much I don't think there'll be
any video that isn't cross-platform with
a k' you won't have to worry about the
actual development environment long as
you know how to you know use your
development environment ok or I click
run you know how to run it in your
particular environment you should be all
good to go but it will be on a Mac for
me but again the code will be exactly
the same for you
so let's create our window and first of
all I'm going to create a Const int and
if we're going to be the width and the
height the width height 600 make 4
equals what about that and we're pretty
much pouring them add the width and the
height in integers or even you have to
find some sort of data type like that
the reason we doing in like this is so
anywhere that we need to use the width
and height we can easily use it without
having to you know hard-coded in than
having to go and change it every single
time so we're happy with this that we
are initializing everything if you just
wanted to say initialize the video for
them or maybe event now find you me but
for now we'll just initialize everything
and what we want to do in that create a
window so we're gonna do STL in the
scroll window a straight window equals
STL on the school create window first
parameter going through the toy top I'm
going to say hello STL world the int
value will put STR on a split window
pause and this is gonna be undefined and
gonna put STL just
or window pause undefined so this is
just the initial position of the window
so undefined we're not particularly
setting in any particular position I
think by default for me you'll just
start in the bottom left but there is a
particular definition which on let you
research that allows you to put in the
center it won't be too hard to find out
and for the width and the height we're
just going to put well width and height
height like so and for the flags you can
put STL in the scroll window underscore
11 HiDPI this just means on displays
that have high density it runs okay this
is simply put I would always enable this
Cleavon on low density display
it just won't or enable this feature in
the back end so I would always recommend
using it so now we're gonna check if the
window was created successfully so then
do this you know you poured the window
so if the window is no then he hasn't
been created successfully and we're
going to STD speed out could not create
window and we wanna know why so we want
to try and get around us STL on the
scope get era like so STD and line and
then we're just going to do you turn
exit underscore failure so we can just
stop running that program now we're
gonna do STL underscore event and I'm
gonna call it window event and this will
just handle well any event that occurs
in our application I'm going to do while
true for this loop is just gonna
constantly be running until we exit out
of it for example we will put the
condition when the actual event is
triggered for clicking the close button
and we'll break out of it if we do if
SDL on the school pole event and we need
to pull on the window events or passive
reference to it the window event like so
so if this window event if something's
happening we are going to check what is
happening and for now we're just
checking FTL on the school quit equals
window event type so if the event taught
that occurred is the quit event then we
just want to break down to this and
therefore we will end the application so
couple of things left its SDL underscore
destroy window and we just need to pass
in the window that we're destroying just
some basic cleanup and then we're gonna
put out of SDL like so so that is it for
a basic ok looking wrong method just
yell quit like this so yeah now that we
have done all of the hello world code we
are ready to run it and see our awesome
window in all its glory
first let it load up so we have a
working window for our awesome game so
that's it for the hello world
application
we'll have other videos covering stuff
like events and sprites and all of that
good stuff to be AK to actually create a
game if you have any questions feel free
to post them on our educational platform
so non learning coda UK there will be a
link in the description to that along
with a github link which will show you
the source code from this video and the
source code from every other video in
this series if you liked the video
please give it a thumbs up it does a
subscribe button and leave us a comment
and as usual thank you for watching and
I hope you have a great day