const int A = 500; / * chiều dài của một side của cửa sổ Monitor * / const float B = 500; / * length của một side của các clipping rectangle * / const float C = 200; / * chiều dài của cửa sổ của chương trình Draws * /
glMatrixMode (GL_PROJECTION); / * In World coordinates: * / glLoadIdentity (); / * position the "clipping rectangle" * / gluOrtho2D (-B / 2, B / 2, -B / 2, B / 2); / * at -B / 2, its right edge at + B / 2, its bottom * / glMatrixMode (GL_MODELVIEW); / * edge at -B / 2 and its top edge at + B / 2 * / }
void display (void) {
glClear (GL_COLOR_BUFFER_BIT); / * clear the window * /
glMatrixMode (GL_MODELVIEW); / * Các bản sau sau được sử dụng * / glLoadIdentity (); / * in terms of World coordinates * /
void main (int argc, char ** argv) { glutInit (& argc, argv); glutInitWindowSize (A, A); / * A x A pixel screen window * /
glutInitDisplayMode (GLUT_RGB | GLUT_SINGLE); glutCreateWindow ("My Rectangle"); / * window title * / glutDisplayFunc (display); / * tell OpenGL main loop what * / myinit (); / * set attributes * /
glutMainLoop (); / * pass control to main loop * / }
g. Now, click in the Dev-cpp editing window and then click Edit> Paste in its menu. The program will appear in the edit window.
hour. Click File> Save . The file in your project directory will now contain the OpenGL program.
i. Let Dev-cpp know which library to link to. Click Project> Project Options .
j. Now click "Parameters". Click the " Add Library or Object " button and navigate to the libraries that will be added. They are found in C: Dev-cpplib
./lib/libopengl32.a
./lib/libglu32.a
./lib/libglut32.a
Add them in that order. Note that the slash will appear in the Unix style "/" and not the "DOS type".
When you have finished adding these 3 libraries, you will see:
The exact template has the form "././ ." you see depends on the complexity of the directory structure in which your source file resides.
Click OK.
k. Click Execute> Compile and Run . The program will be compiled, linked and run:
If everything doesn't work (very popular), click the " Compile Log " tab to find some confusing error messages. If you see an error like this, it means you made the wrong order when adding libraries to the project:
instructions for installing flash player for browsers on computers. flash player is a commonly used browser to run flash content like videos or web games. if your computer does not have flash player installed then of course we cannot view the video
how to install and configure git on windows 10 the most standard. link download git for the latest windows operating system, basic configuration for git on windows.
you have researched and bought a new computer. now, when he brought it home and must be very eager to start using it to send email, share photos, surf the web, listen to music and watch movies.
scratch allows you to program creative interactive programs and share them with the community. if you want to use it without an internet connection, see the instructions for installing scratch offline on your computer below.
instructions for installing and using google drive on phones and computers. google drive cloud storage service is one of the most used services today. using google drive, you get free 15gb of storage and pay for the software
instructions for downloading and installing wintohdd - software that supports windows installation without using a cd or usb boot. download and install wintohdd to your computer to install windows 11, 10, 8.1,... more quickly and easily in case you don't have a usb or win installation cd.
if you often access the internet to download and download many types of files to your computer, you will often see the phrase ultraiso. so do you know what ultraiso is? how does it work? and what advantages for the user. in this article, software tips will help you learn what ultraiso is?