GLFW already has pre-compiled binaries and header files for Visual Studio 2012 up to 2019, but for completeness' sake we will compile GLFW ourselves from the source code. GLFW can be obtained from their webpage's download page. If you're not using Visual Studio (or an older version) don't worry, the process will be similar on most other IDEs. We'll use Microsoft Visual Studio 2019 IDE as of this writing (note that the process is the same on the more recent visual studio versions). This chapter takes a step-by-step approach in retrieving, building and linking the GLFW library. The focus of this and the next chapter is to get GLFW up and running, making sure it properly creates an OpenGL context and that it displays a simple window for us to mess around in. It allows us to create an OpenGL context, define window parameters, and handle user input, which is plenty enough for our purposes. GLFW gives us the bare necessities required for rendering goodies to the screen. GLFW is a library, written in C, specifically targeted at OpenGL. Feel free to use any of the other libraries, the setup for most is similar to GLFW's setup. Some of the more popular libraries are GLUT, SDL, SFML and GLFW. Those libraries save us all the operation-system specific work and give us a window and an OpenGL context to render in. Luckily, there are quite a few libraries out there that provide the functionality we seek, some specifically aimed at OpenGL. This means we have to create a window, define a context, and handle user input all by ourselves. However, those operations are specific per operating system and OpenGL purposefully tries to abstract itself from these operations. The first thing we need to do before we start creating stunning graphics is to create an OpenGL context and an application window to draw in. Creating a window Getting-started/Creating-a-window
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |