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:
- Configure glut in Ubuntu and implement basic OpenGL experiment on CodeBlocks platform
- On the problem that CodeBlocks can’t compile glut
- Glut could not find glut32.dll
- Vs2019 OpenGL glut: error: unable to open include file: ‘GL / glut. H’: no such file or directory
- Configure OpenGL in CodeBlocks
- OpenGL configuration under CodeBlocks in Ubuntu
- codeblocks ERROR: You need to specify a debugger program in the debuggers’s settings.
- |-OpenGL – | some small problems about the glut Library
- Error in header file when calling OpenGL to open obj file in vs2013: unable to open include file: “GL / glut. H”: no such file or directories
- CodeBlocks configuring OpenGL
- Configuring OpenGL with win 10 + CodeBlocks
- CodeBlocks configuring OpenGL environment
- Error: unable to open include file: ‘GL / glut. H’
- OpenGL program running prompt glut32.dll missing problem
- 0028opengl program running prompt glut32.dll missing one of the solutions
- How to configure OpenGL with CodeBlocks in Ubuntu
- Visual studio 2017, OpenGL program running prompt glut32.dll missing solution
- CodeBlocks OpenGL configuration process
- Solve the problem of VC6.0 open crash and OpenGL glut32.lib library
- Installation and use of OpenGL based on CodeBlocks