example:
If (Key = maid)
If (Key = maid)
Int glugetmodifiers ()
If the key is pressed when a mouse or keyboard event occurs, the function returns the logic and result of the glu_active_shift, glu_active_ctrl, or glu_active_alt operation.
For example, to allow Ctrl + C or C to plant a program, you can write as follows:
If (FIG () = fig (Key = 'C') | (Key = 'C') Exit (0 );
Mouse callback function
Void glumousefunc (void (* f) (INT button, int state
Ubuntu + opengl program design (2) First Program-lihn1987 (reprinted please indicate the source, thank you)
# Include # Include # Include //////////////////////////////////////// ///////////////////// Called to draw sceneVoid RenderScene (void){// Clear the window with current clearing colorGlClear (GL_COLOR_BUFFER_BIT );// Flush drawing commandsGlFlush ();}//////////////////////////////////////// /////////
1, about the pointPointThe sizedefault is 1 pixels, but it can also be changed. Change the command forglpointsizeItsfunction PrototypesAs follows:void Glpointsize (glfloat size);Size must be greater than 0.0f and the default value is 1.0f, in pixels.Note: For specific OpenGL implementations, there is a limit to the size of the point, and if you set a size that exceeds the maximum value, the setting may be problematic.Example:void Mydisplay (void){Glcl
? This is a demo similar to the rotation of the earth around the sunThe original example is to use the keyboard to accept the event, I made a change, using the timer to turn him into a dynamic rotation of the#import #includeStatic intYear=0, day=0;voidinit () {Glclearcolor (0,0,0,0); Glshademodel (Gl_flat);}voiddisplay () {glclear (gl_color_buffer_bit); glcolor3f (1,1,1); Glpushmatrix (); Glutwiresphere
, 0.8f,0.0f);//After all, the original front becomes clockwise, so change the vertex wrapping mode: Clockwise to positive glfrontface (GL_CW);D rawsonganddance (Yrot);// After painting the reflection to change back to the vertex wrapping mode Glfrontface (GL_CCW), Modelviewmatrix.popmatrix ();//Turn on the color mix, so that the reflection and the transparency of the base plate glenable (Gl_blend); Glbindtexture (Gl_texture_2d,uitexture[0]); Glblendfu
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.