windowCreating.md - z22756392z/wp109b GitHub Wiki

Creating windows is always really platform specific.

So in other word, the way that we create a window on Windows is we use the Win32 api. We actually use the Windows API.

Because

the way that we create a window is going to be specific to operating system. Because that's like an operating system level thing.

And that's what others normally do if they was writing a game engine or something.

They would take the time to actually set up a window using the actual operating systems API for each platform that they want to support.

Why use glfw

this is specifically about OpenGL and how OpenGL work and how to write OpenGl code.

So we don't really care about how to set up a window and all That.

So we use a library that will basically do that for us and all this library going to do is provide us with appropriate platform layer

So in other word, it is going to provide us with a implementation of that windowing creation code and management code as well for Windows Mac and Linux.

There are several library that allow us to do this. And one we're going to use called glfw.

GLFW( Graphics Library Framework)

This is a lightweight library all it's going to do for us is create a window create an OpenGl context and give us access to some basic thing like input.

That's all that's going to do.

Unlike SDL which is full kind of thing like a Renderer there we can draw squares or triangles or whatever we want to the screen.

That'll be implemented either in DirectX or OpenGL and that's all kind of framework.

All glfw is that it create a window and it is multi-platform.