Get the App
SLTechnology News&Howtos  ›  Servers  › 

Opengl configuration

Shulou Source: shulou.com Published: 2022-06-03 05:18:43 11月15日 Update

Opengl configuration instructions:

This configuration document configures the vs2008 project project for the windows 64-bit operating system

1. Download OpenGL's glut class library: http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip

2. Steps to install GLUT in Windows environment:

1. Unpack the downloaded package and you will get 5 files.

2. Put the extracted glut.h into the folder D:\ Program Files (x86)\ Microsoft Visual Studio 9.0\ VC\ include\ GL, and create one without the GL folder. (depending on the installation path)

3. Put the extracted glut.lib and glut32.lib in the folder where the static function library is located (mine is D:\ Program Files (x86)\ Microsoft Visual Studio 9.0\ VC\ lib, depending on the installation path)

4. Put the extracted glut.dll and glut32.dll into C:\ Windows\ SysWOW64 under the operating system directory.

3. Configure the project environment

The following steps need to be performed in each project that requires openGL:

(1) Project-Project Properties-configuration Properties-Cpicurizer-preprocessor definition, add

GLUT_BUILDING_LIB

(2) Project-Project Properties-configuration Properties-Linker-input-additional dependencies, add

Glut32.lib Opengl32.lib Glu32.lib

Test the code:

/ / opengl_test.cpp: defines the entry point for the console application.

/ /

# include "stdafx.h"

# include

Void myDisplay (void)

{

GlClear (GL_COLOR_BUFFER_BIT)

GlRectf (- 0.5f,-0.5f, 0.5f, 0.5f)

GlFlush ()

}

Int main (int argc, char * argv [])

{

GlutInit (& argc, argv)

GlutInitDisplayMode (GLUT_RGB | GLUT_SINGLE)

GlutInitWindowPosition (100,100)

GlutInitWindowSize (400,400)

GlutCreateWindow ("the first OpenGL program")

GlutDisplayFunc & myDisplay)

GlutMainLoop ()

Return 0

}

Tags: Project configuration different properties file folder operating system step environment program system path preprocessing code entry function project application location console Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB macOS OPPO Reno Redmi Microsoft