Bitmap
Bitmap display. The following code displays an 8x8 chessboard:
Glubyte WB [2] = {0x00, 0xff}; glubyte check [64*8]; for (INT I = 0; I <64; I ++) for (Int J = 0; j <8; j ++) Check [I * 8 + J] = WB [(I/8 + J) % 2]; glbitmap (64, 64, 220.0, 220.0, check );
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/48/10/wKioL1QFg__Bxp0fAACqcedUSYo765.jpg "Title =" qq20140902164614.png "alt =" wkiol1qfg1_bxp0faacqcedusyo765.jpg "/>
Void glbitmap (glsizei width, glsizei height, glfloat x0, glfloat y0, glfloat XI,
Glfloat Yi, glubyte * bits)
// Draw a bitmap with width and height based on the array bits. The offset from the starting position of the bitmap to the current position of the grating is x0 and Y0. After the bitmap is displayed, the current position increases with Xi and Yi as coordinates.
Void glrasterpos * () is used to set the grating position.
Note: after this function is called, the color of the grating will be locked, and glcolor will not work for the color of the bitmap.
Drawing Mode
When a pixel is drawn, if a pixel already exists at the position of the pixel to be drawn, the new value of the target pixel is the result of the source color and the target color following certain rules. You can use the following function settings to perform operations:
Void gllogicop (glenum OP)
// If the logic operation (gl_color_logic_op) is enabled, this function can be used to integrate the source and target pixels in the frame cache into which one of the 16 logical operations is used. The parameter value can be set to gl_copy (default), gl_or, or gl_xor.
You must use the following functions to enable logical operations:
Glable (gl_color_logic_op)
OpenGL Learning (6) discrete elements