GLUT is an acronym for OpenGL Utility Toolkit, which is a toolkit that can be used to write OpenGL programs. GLUT is great for learning OpenGL, but it’s not good for developing relatively complex user interfaces. Today I’ll talk about how GLUT is used in Codeblocks.
This topic has been are discussed in both English and Chinese, English version see http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/glut/, Chinese see “using glut in CodeBlocks (opengl) for Windows”.
Here, paraphrase it again.
Let’s first look at the output of an example program called GLUT.
First, you need to prepare three files, glut32.dll, glut32.lib, Glut.h.
These three files can be downloaded from the Internet. GLUT32 is a dynamically linked library,.h is required at compile time,.lib records the basic information of the library function, and.dll is the implementation of the specific function, which needs to be dynamically loaded when the program runs.
Copy glut32.dll to c:\ Windows /system.
Copy glut32.lib to C :\ Program Files (x86)\codeblocks\mingw\lib.
Copy Glut. h to C :\program files\codeblocks\mingw\include\GL.
Now open Codeblocks, create a new project, and select GLUT Project.
Give the project a name, and then the next step is to specify the location of the GLUT toolkit.
Now that the project is set up, click Compile and run it. It turns out that there are a lot of errors.
To make it work, add the header #include “Windows.h” to the automatically generated main.cpp file, and then compile and run it, and the resulting window will appear. The graphical device interface function is included in Windows.h.
Reproduced in: https://blog.51cto.com/11190017/1762229
Read More:
- Configuring OpenGL in Code:: blocks
- CodeBlocks configuring OpenGL
- Configuring OpenGL with win 10 + CodeBlocks
- CodeBlocks configuring OpenGL environment
- |-OpenGL – | some small problems about the glut Library
- CodeBlocks OpenGL configuration process
- Configure OpenGL in CodeBlocks
- Configuring OpenGL environment with code blocks16.0 in Windows 10
- Vs compiling OpenGL project, the solution of unable to open the source file “GL / glaux. H” appears
- The solution of using OpenGL’s Glu Library in qt5.2 under win7
- Vc2010 configuring OpenGL environment
- Error: unable to open include file: ‘GL / glut. H’
- OpenGL program running prompt glut32.dll missing problem
- A series of problems in configuring OpenGL development environment in vs2015
- 0028opengl program running prompt glut32.dll missing one of the solutions
- The solution of configuring OpenGL in vs2017
- Configuring OpenGL in VS
- The first time I write OpenGL program, what should I do when I encounter “can’t open include file:” GL / glaux. H “: no such file or directory”?
- Installation and use of OpenGL based on CodeBlocks
- Configuring OpenGL in Chinese version of VS2010 and problem solving