Tag Archives: buffer

In VS2010, the compiler cannot open the file “GL / glaux. H”: no such file or directory

 
We recently tested an example OpenGL program:
#include < GL/gl.h>
#include < GL/glaux.h>
#include “glos.h”
 
void main(void)
{
auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
,0,500,500 auxInitPosition (0);
auxInitWindow(“simple”);
 
GlClearColor (0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
GlColor3f (1.0, 0.0, 0.0);
GlRectf (0.5, 0.5, 0.5, 0.5);
 
glFlush();
_sleep(1000);
}
 
It runs normally under VC6.0, but under VS2010 there is a compilation error as follows:
1> D :\elec\mymfctest\vs2010p\openglapps\opengltest\opengltest.cpp(4): fatal error C1083: Could not open included file: “GL/glaux.h” : No such file or directory
It seems that this error can be found in versions VS2008 and above.
Only two Files can be seen in the path C:\Program Files\Microsoft SDKS \Windows\ V7.0 A\Include\gl after VS2010 installation
Gl. h and glu. H instead of glaux. H,
C:\Program Files\Microsoft Visual Studio\VC98\Include\GL
The next one has three files
H, glu. H, and glaux. H, so the relevant header files are not found in VS2010.
The glaux.lib library file is not found in the VC6.0 installation path C:\Program Files\Microsoft SDKS \Windows\ V7.0 A\ lib, but in the VS2010 installation path C:\Program Files\Microsoft SDKS \Windows\ V7.0 A\ lib.
The solution is to copy the glaux. H and glaux. Lib files from their respective folders to the path referenced by default in VS2010 if you have VC6.0 installed. It is possible that the application will also need glaux. DLL support at runtime, which can also be downloaded.

Vc2010 configuring OpenGL environment

Glut32.Lib Glut32.dll and Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h
2, the glut. H in the C:/Program Files/Microsoft SDKs/Windows/AA/Include/gl v7.0 directory; GLUT32. lib: C:/Program Files /Microsoft SDKS /Windows/ V7.0a/lib Glut32.dll is placed in the C:/WINDOWS/system32 directory
3. Create a new empty project in VS2010 and select Win32 Console Project
 
4. Add a.cpp file to the project with the following contents:
# include “stdafx. H”
#include< gl/glut.h>
 
Void myDisplay (void)
{
GlClear (GL_COLOR_BUFFER_BIT);
GlRectf (0.5-0.5 f to 0.5 f, f, 0.5 f);
GlFlush ();
}
Int _tmain(int argc, _TCHAR* argv[])
{
GlutInitDisplayMode (GLUT_RGB | GLUT_SINGLE);
GlutInitWindowPosition (100, 100);
GlutInitWindowSize (400, 400);
GlutCreateWindow (” the first OpenGL program “);
GlutDisplayFunc (& amp; myDisplay);
GlutMainLoop ();
Return 0;
}
5. Set the IDE environment: project->; new Property-> Configuration propertites-> linker-> Input-> Additional dependencies
OpenGL32. lib GLUT32. lib, apply, confirm.
 
 
6. F5, Start Debugging, you should see a window with a white square in the middle.

Configure glut in Ubuntu and implement basic OpenGL experiment on CodeBlocks platform

1. First, install GLUT. I selected “Download FreeGLUT” to install the command procedure:
http://freeglut.sourceforge.net/docs/install.php
$sudo apt-get install libxi-dev: error: X11/extensions/ xinput. h: No such file or directory
//after the installation, my computer inside the/usr/local/include/lib folder and set up some reference libraries and header files, etc

2. Configure Codeblocks:
Open Codeblocks, select the GLUT project, select New, enter the project name, and you will be prompted to specify the installation path for GLUT. You can specify it directly to /usr/ (I specified /usr/local/). If both of the above files are present, you should be able to set up the project without any problems.
in the end, one more thing, is to compile time there will be a mistake about Xxf86vm. Right-click on the project to open the project properties window and see the “Project Settings” TAB. Click on the “project ‘s build
Options “, then click on the “Linker Settings” TAB and delete the reference to xxf86VM to compile correctly.
3. Another easy way (just use Vim directly)
1). Install build-essential sudo apt-get Install build-essential // Install autotool
2). Install OpenGL sudo apt-get Install FreeGLUT 3-dev //
3). Use the command: : GCC simple.c-lGlut-o Simple at compile time
Where simple.c can use:

/*
 * GLUT Shapes Demo
 *
 * Written by Nigel Stewart November 2003
 *
 * This program is test harness for the sphere, cone
 * and torus shapes in GLUT.
 *
 * Spinning wireframe and smooth shaded shapes are
 * displayed until the ESC or q key is pressed.  The
 * number of geometry stacks and slices can be adjusted
 * using the + and - keys.
 */

#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif

#include <stdlib.h>

static int slices = 16;
static int stacks = 16;

/* GLUT callback Handlers */

static void resize(int width, int height)
{
    const float ar = (float) width/(float) height;

    glViewport(0, 0, width, height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity() ;
}

static void display(void)
{
    const double t = glutGet(GLUT_ELAPSED_TIME)/1000.0;
    const double a = t*90.0;

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glColor3d(1,0,0);

    glPushMatrix();
        glTranslated(-2.4,1.2,-6);
        glRotated(60,1,0,0);
        glRotated(a,0,0,1);
        glutSolidSphere(1,slices,stacks);
    glPopMatrix();

    glPushMatrix();
        glTranslated(0,1.2,-6);
        glRotated(60,1,0,0);
        glRotated(a,0,0,1);
        glutSolidCone(1,1,slices,stacks);
    glPopMatrix();

    glPushMatrix();
        glTranslated(2.4,1.2,-6);
        glRotated(60,1,0,0);
        glRotated(a,0,0,1);
        glutSolidTorus(0.2,0.8,slices,stacks);
    glPopMatrix();

    glPushMatrix();
        glTranslated(-2.4,-1.2,-6);
        glRotated(60,1,0,0);
        glRotated(a,0,0,1);
        glutWireSphere(1,slices,stacks);
    glPopMatrix();

    glPushMatrix();
        glTranslated(0,-1.2,-6);
        glRotated(60,1,0,0);
        glRotated(a,0,0,1);
        glutWireCone(1,1,slices,stacks);
    glPopMatrix();

    glPushMatrix();
        glTranslated(2.4,-1.2,-6);
        glRotated(60,1,0,0);
        glRotated(a,0,0,1);
        glutWireTorus(0.2,0.8,slices,stacks);
    glPopMatrix();

    glutSwapBuffers();
}


static void key(unsigned char key, int x, int y)
{
    switch (key)
    {
        case 27 :
        case 'q':
            exit(0);
            break;

        case '+':
            slices++;
            stacks++;
            break;

        case '-':
            if (slices>3 && stacks>3)
            {
                slices--;
                stacks--;
            }
            break;
    }

    glutPostRedisplay();
}

static void idle(void)
{
    glutPostRedisplay();
}

const GLfloat light_ambient[]  = { 0.0f, 0.0f, 0.0f, 1.0f };
const GLfloat light_diffuse[]  = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat light_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat light_position[] = { 2.0f, 5.0f, 5.0f, 0.0f };

const GLfloat mat_ambient[]    = { 0.7f, 0.7f, 0.7f, 1.0f };
const GLfloat mat_diffuse[]    = { 0.8f, 0.8f, 0.8f, 1.0f };
const GLfloat mat_specular[]   = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat high_shininess[] = { 100.0f };

/* Program entry point */

int main(int argc, char *argv[])
{
    glutInit(&argc, argv);
    glutInitWindowSize(640,480);
    glutInitWindowPosition(10,10);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);

    glutCreateWindow("GLUT Shapes");

    glutReshapeFunc(resize);
    glutDisplayFunc(display);
    glutKeyboardFunc(key);
    glutIdleFunc(idle);

    glClearColor(1,1,1,1);
    glEnable(GL_CULL_FACE);
    glCullFace(GL_BACK);

    glEnable(GL_DEPTH_TEST);
    glDepthFunc(GL_LESS);

    glEnable(GL_LIGHT0);
    glEnable(GL_NORMALIZE);
    glEnable(GL_COLOR_MATERIAL);
    glEnable(GL_LIGHTING);

    glLightfv(GL_LIGHT0, GL_AMBIENT,  light_ambient);
    glLightfv(GL_LIGHT0, GL_DIFFUSE,  light_diffuse);
    glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
    glLightfv(GL_LIGHT0, GL_POSITION, light_position);

    glMaterialfv(GL_FRONT, GL_AMBIENT,   mat_ambient);
    glMaterialfv(GL_FRONT, GL_DIFFUSE,   mat_diffuse);
    glMaterialfv(GL_FRONT, GL_SPECULAR,  mat_specular);
    glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess);

    glutMainLoop();

    return EXIT_SUCCESS;
}

To complete.

Learning notes — opengl01

 
The first lesson
1.1 Simple OpenGL program contains:
First, you need to include the header file #include <; GL/glut.h> So this is the header file for GLUT. OpenGL programs typically include <; GL/gl.h> And & lt; GL/glu.h> , but both files are automatically included in the GLUT header file and do not need to be included again.   The functions that begin with GLUT are all functions provided by the GLUT toolkit. Here are some of the functions used: Glutinit initializes GLUT. This function must be called once before another GLUT is used. Glutinit (& Arg C, Arg V. 2, GLUTINITDISPLAYMODE, set the display mode, where GLUT_RGB means to use the RGB color, and GLUT_INDEX (means to use the index color). GLUT_single means to use a single buffer, as does GLUT_DOUBLE (to use a double buffer). GlutinitWindowPosition, which is simple, sets the position of the window on the screen. 4, GlutinitWindowSize, this is also easy, set the window size. 5, GlutCreateWindow, create a window based on the information set above. Parameters will be used as the title of the window. Note: The window is not immediately displayed on the screen after it is created. You need to call glutMainLoop to see the window. 6. GlutdisplayFunc, which sets a function that will be called when a drawing is needed. (This statement is not accurate, but the accurate statement may not be easy for beginners to understand, so say for the time being). 7. GlutMainLoop, which runs a message loop. (This may not be obvious to beginners, but for now it is enough to know that this function displays a window and waits for the window to close before returning.)   All the functions that start with GL are standard OpenGL functions, and the ones that are used are described below. 1, Glclear. GL_Color_BUFFER_BIT clears the color, and glClear clears other things, but I won't cover them here. 2, Glrectf, draw a rectangle. The four parameters represent the horizontal and vertical coordinates of the two points located on the diagonal. Glflush ensures that previous OpenGL commands are executed immediately (rather than having them wait in the buffer). It works similarly to fflush(stdout).   The second lesson 2.1 Draw simple geometric shapes Dots: Dots in OpenGL will be drawn as individual pixels Straight lines: OpenGL's concept of a "line" is close to the mathematical concept of a "line segment," which can be defined by two endpoints. Polygon: A polygon must be a "convex polygon" (defined as: any two points in a polygon are within the polygon, from which it can also be deduced that a convex polygon cannot be hollow), usually triangular By using points, lines and polygons, you can combine various geometric figures   2.2 Specify vertices OpenGL provides a number of functions. They all start with glVertex, followed by a number and one or two letters. Such as: GLVERTEX2D GLVERTEX2F GLVERTEX3F GLVERTEX3FV and so on. The number means the number of arguments, 2 means there are two arguments, 3 means three, and 4 means four. Letters parameter type, s 16-bit integers (due to the type defined as GLshort OpenGL), I said a 32-bit integer (OpenGL in this type is defined as the GLint and GLsizei), f is a 32-bit floating point Numbers (due to the type defined as GLfloat OpenGL and GLclampf), d said 64 floating point Numbers (due to the type defined as GLdouble OpenGL and GLclampd). V indicates that several parameters will be passed using Pointers   2.3 Start drawing OpenGL requires that the command specifying the vertex be included after glBegin and before glEnd (otherwise the specified vertex will be ignored). GlBegin is left to indicate how to use these points. Such as: glBegin(GL_POINTS); GlVertex2f (0.0 0.0 f, f); GlVertex2f (0.0 0.5 f, f); glEnd(); Then these two points will be drawn separately. If you replace GL_POINTS with GL_LINES, then the two points will be considered to be the two endpoints of the line, and OpenGL will draw a line. You can also specify more vertices and then draw more complex shapes. GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, etc. (See Figure 1) The third class 3.1 about the point Point size: Default value is 1.0F, function prototype void glpointSize (GLFloat Size); Example: void myDisplay(void) { glClear(GL_COLOR_BUFFER_BIT); GlPointSize (5.0 f); GlBegin (GL_POINTS); ... GlEnd (); glFlush(); } 3.2 About Straight Lines 3.2.1 Line width Function prototype void gllineWidth (glFloat Width); The usage is similar to glpointSize. 3.2.2 dotted line First, use glEnable(GL_LINE_STIPPLE); To start the dotted line mode (use glDisable(GL_LINE_STIPPLE) to turn it off). Then, use glLineStipple to set the style of the dotted line. void glLineStipple(GLint factor, GLushort pattern); Pattern is a sequence of length 16 composed of 1 and 0. Viewed from the lowest position, if it is 1, then factor points that should be drawn next on the line will be drawn as solid. If 0, then factor points that should be drawn next on the line will be drawn as virtual. 3.3 About polygons 3.3.1 Both sides of polygons and their drawing methods Although we haven't really used 3D coordinates to draw a picture yet, it is necessary to establish some 3D concepts. In three dimensions, a polygon has two faces. Each face can be drawn in a different way: fill, draw only edges, and draw only vertices, with fill being the default. You can set the two faces in different ways. glPolygonMode(GL_FRONT, GL_FILL); // Set front to fill mode glPolygonMode(GL_BACK, GL_LINE); GlPolygonMode (GL_FRONT_AND_BACK, GL_POINT); glPolygonMode(gl_front, GL_POINT); // Set both sides to vertices 3.3.2 rainfall distribution on 10-12 inversion The convention is that the face whose vertices appear counterclockwise on the screen is "heads" and the other face is "tails". Common surfaces in life can usually be represented with such "heads" and "tails" as "reasonable". But there are some surfaces that are special. For example, a "Maibius strip" can be represented with either all "heads" or all "tails". You can exchange the concepts of "heads" and "tails" through the glFrontFace function. glFrontFace(GL_CCW); // Set the CCW direction to "Front", CCW is Counterclockwise Glfrontface (GL_CW); // Set the CW direction to "Front", CW is ClockWise * There is routine openGL4 3.3.3 Remove polygonal surfaces In three dimensional space, a polygon has two faces, but we can't see the polygons on the back, and some of the polygons are on the front, but are obscured by other polygons. Treating invisible polygons the same as visible polygons will definitely reduce the efficiency of our graphics processing. At times like this, you can cut out unnecessary surfaces. First, use glEnable(GL_CULL_FACE); To enable culling (disable using glDisable(GL_CULL_FACE)), then use glCullFace to cull. The parameter of glCullFace can be GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK, which are polygons that remove the front, back, and back sides, respectively. Note: the cull function only affects polygons, not points and lines. For example, with glCullFace(GL_FRONT_AND_BACK), all polygons are removed so that only points and lines are visible. 3.3.4 Hollow out polygon Straight lines can be drawn as dotted lines, while polygons can be hollowed out. First, use glEnable(GL_POLYGON_STIPPLE); To start the hollowout mode (which can be turned off with glDisable(GL_POLYGON_STIPPLE)). Then, use glPolygonStipple to set the hollow out style. void glPolygonStipple(const GLubyte *mask); The mask parameter points to a space of 128 bytes, which indicates how a 32 by 32 rectangle should be hollow out. Where: The first byte indicates whether the 8 pixels at the bottom left are hollow (1 means no hollow, showing the pixel; 0 indicates hollowout, showing the color behind it), and the last byte indicates whether the top right eight pixels are hollowout or not. If such data is saved as a picture and edited with a special tool, it is obviously much more convenient. Here's how to do it. First, create a new image using the Windows Brush program and name it mask.bmp. Make sure to save it with "Monochrome Bitmap" selected. In "Image" -> In the Properties dialog box, set the height and width of the image to 32. Look at the picture with a magnifying glass and edit it. Black corresponds to binary zero (hollow out), white corresponds to binary one (no hollow out), after editing saved. You can then use the following code to get the Mask array.
static GLubyte Mask[128];
FILE *fp; fp = fopen(“mask.bmp”, “rb”);
if( ! fp ) exit(0);
// Move the file pointer to this position so that reading sizeof(Mask) will encounter the end of the file
// Note that -(int)sizeof(Mask) is not a good way to write it, but it does work here, right
If (fseek(fp, -(int)sizeof(Mask), SEEK_END) exit(0); if(fseek(fp, -(int)sizeof(Mask), SEEK_END) exit(0);
// Read the sizeof(Mask) bytes into the Mask
if( ! fread(Mask, sizeof(Mask), 1, fp) )
exit(0);
fclose(fp);
 
Edit an image as a mask, and use the above method to get the array of masks. After running, observe the effect. Note: The factor factor can be set when drawing a dashed line, but the factor factor cannot be set when drawing a hollow polygon. Please use the mouse to change the size of the window, observe the change of the hollowout effect.
* There is routine openGL5

Configuring OpenGL in VS

 
VS2010
GLUT Download Address:
http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip
Glut. H – & gt; C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0 A/Include/gl
glut.dll,glut32.dll —> C:/Windows/ SYSWOW64 (Windows 7 64-bit operating system)
– & gt; C:/Windows/System32 (Windows 7 32-bit operating system)
glut.lib,glut32.lib —> C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/lib
!!!!! No!!!!! With # define macros GLUT_DISABLE_ATEXIT_HACK
So a lot of people Glut. h didn’t know where to put it, and they created a new folder, and a lot of people Glut. h said,
To search the GL folder, place Glut. h in the GL folder that contains the two files Glut. h and Glut. h.
Direct copy of the following routine compilation can be passed
Routine as follows
#include < gl/glut.h>
Void myDisplay (void)
{
glClear (GL_COLOR_BUFFER_BIT);
glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
glFlush ();

} int main (int arg c, char * argv [])
{
glutInit (& amp; argc, argv);
glutInitDisplayMode (GLUT_RGB | GLUT_SINGLE);
glutInitWindowPosition (100, 100);
glutInitWindowSize (400, 400);
GlutCreateWindow (” First OpenGL program “);
glutDisplayFunc (& amp; myDisplay);
glutMainLoop ();
return 0;
}
VS2008
The first step is to choose a compilation environment
now the mainstream of Windows compiled environment have Visual Studio, Broland c + + Builder, Dev – c + +, etc., they are all support OpenGL.

I chose Visual Studio 2008 and VC6++ as the environments to learn OpenGL.

Second, install the GLUT toolkit

Glutters
Glutters
Glutters
Glutters
Glutters
Glutters
Glutters
Glutters

Windows GLUT download address :(size about 150K)

http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip

cannot be downloaded from the above address, please use the links below:

http://upload.programfan.com/upfile/200607311626279.zip

install GLUT for Windows:

2, Search for “gl.h” in “My Computer” and find the folder in which it is located

If it is VC++6, then Glut.h should be copied in “D:/Program Files/
MicrosoftVisualStudio/VC98/Include/GL folder “). If it’s VisualStudio2008, copy Glut.h to
X :/Program Files/Microsoft/Visual Studio 9.0/VC/include/GL X is the disk symbol that you use to install VS. If you install VC++, there is a GL file in it. Visual Studio 2008 needs to go to it yourself
Create a new one)

3, let the glut of decompression. Lib and glut32 lib on static libraries in the folder (that is, with the include side by side under the lib folder).

4, let the glut of decompression. DLL and glut32 DLL in the operating system directory under the system32 folder. (Typical location: C:/Windows/System32)

Step 3: Set up an OpenGL project

VisualStudio2008 or VC++6:

choose File – & gt; New-> The Project, and then
Select Win32 Console Application, (not Win32 Application). Select a name and press OK. Click Application Settings on the left side of the resulting dialog box, locate the Empty Project, check it, and select Finish. Then add a code file to the project, called “opengl.c”, and note that you end the file with.c.

is done, just like any other project.


include <

#include < GL/glut.h>

#pragma comment(lib, “opengl32.lib”)

#pragma comment(lib, “glu32.lib”)

#pragma comment(lib, “glut32.lib”)


rst OpenGL program

A simple OpenGL program is as follows:
(Note that if you need to compile and run, GLUT needs to be installed correctly, as described above.)

# include & lt; GL/glut.h>

void myDisplay (void)

{

glClear (GL_COLOR_BUFFER_BIT);

glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
glRectf(-0.5f, -0.5f, 0.5f, 0.5f);

glFlush ();

}

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

{

glutInit (& amp; Arg c, argv);

glutInitDisplayMode (GLUT_RGB | GLUT_SINGLE);

glutInitWindowPosition (100, 100);

glutInitWindowSize (400, 400);

GlutCreateWindow (” First OpenGL program “);

glutDisplayFunc (& amp; myDisplay);

glutMainLoop ();

return 0;

}

This program draws a white rectangle in the center of a black window. Each of the statements is explained below.

First, you need to include the header file #include
; GL/glut.h> So this is the header file for GLUT.

GL/gl.h> And & lt; GL/glu.h> , but both files are automatically included in the GLUT header file and do not need to be included again.

then look at the main function.

int main(int argc, char *argv[])
int main(int argc, char *argv[]) Comrades who have not seen it, please read the book more, and then look down when you understand.

Notice that all statements in main begin with GLUT, except for the return at the end.
The functions that begin with GLUT are all functions provided by the GLUT toolkit, and the functions used are described below.

1, glutInit (GLUT) — This function must be called once before another GLUT is used. Glutinit (& Arg C, Arg V.

2, glutInitDisplayMode, set the display mode, including GLUT_RGB said using RGB color, and the matching and GLUT_INDEX (using the index color). GLUT_single means to use a single buffer, as does GLUT_DOUBLE (to use a double buffer). For more information, please Google yourself. Of course, there will be some explanations in future tutorials.

>
>
>
>
>
>
>
>

>
>
>
>

5, GlutCreateWindow, create the window based on the information set above. Parameters will be used as the title of the window. Note: The window is not immediately displayed on the screen after it is created. You need to call glutMainLoop to see the window.

6, glutDisplayFunc, set up a function, when the need for drawing, this function will be invoked. (This statement is not accurate, but the accurate statement may not be easy for beginners to understand, so say for the time being).

(This may not be obvious to beginners, but for now it is enough to know that this function displays a window and waits for the window to close before returning.)

in glutDisplayFunc function, we set up “when need drawing, please call myDisplay function”. So myDisplay function is going to be used to draw the graph. When you look at the three function calls in MyDisplay, you see that they all start with GL.
Functions that start with GL are standard OpenGL functions, and the ones we use are described below.

GL_Color_BUFFER_BIT clears the color, and glClear clears other things, but I won’t cover them here.

2, Glrectf, draw a rectangle. The four parameters represent the horizontal and vertical coordinates of the two points located on the diagonal.

3, Glflush, which ensures that previous OpenGL commands are executed immediately (rather than having them wait in the buffer). It works similarly to fflush(stdout).

 

Error: requesting member ‘*’ of ‘*’, which is a non-class type ‘*’

Code:
if (-1 == munmap (buffers. Start, buffers. Length))

error:
error: request for member ‘start’ in ‘buffers *’, which is of non-class type ‘buffer ‘, which is of non-class type ‘buffers’, which is of non-class type ‘buffers’
error: request for member ‘length’ in ‘buffers’, which is of non-class type ‘buffers’

reason:
Primarily, it is a pointer, but the use of “.” when referring to its members is used as a general variable, which would result in this compilation error.
Of course there are other reasons for this compilation error,
For example, variables are defined but not defined before they are used, and so on

modified:
if (-1 == munmap (buffers)
-> start, buffers-> length))