1GLBITMAP(3G) OpenGL Manual GLBITMAP(3G)
2
3
4
6 glBitmap - draw a bitmap
7
9 void glBitmap(GLsizei width, GLsizei height, GLfloat xorig,
10 GLfloat yorig, GLfloat xmove, GLfloat ymove,
11 const GLubyte * bitmap);
12
14 width, height
15 Specify the pixel width and height of the bitmap image.
16
17 xorig, yorig
18 Specify the location of the origin in the bitmap image. The origin
19 is measured from the lower left corner of the bitmap, with right
20 and up being the positive axes.
21
22 xmove, ymove
23 Specify the x and y offsets to be added to the current raster
24 position after the bitmap is drawn.
25
26 bitmap
27 Specifies the address of the bitmap image.
28
30 A bitmap is a binary image. When drawn, the bitmap is positioned
31 relative to the current raster position, and frame buffer pixels
32 corresponding to 1's in the bitmap are written using the current raster
33 color or index. Frame buffer pixels corresponding to 0's in the bitmap
34 are not modified.
35
36 glBitmap takes seven arguments. The first pair specifies the width and
37 height of the bitmap image. The second pair specifies the location of
38 the bitmap origin relative to the lower left corner of the bitmap
39 image. The third pair of arguments specifies x and y offsets to be
40 added to the current raster position after the bitmap has been drawn.
41 The final argument is a pointer to the bitmap image itself.
42
43 If a non-zero named buffer object is bound to the
44 GL_PIXEL_UNPACK_BUFFER target (see glBindBuffer()) while a bitmap image
45 is specified, bitmap is treated as a byte offset into the buffer
46 object's data store.
47
48 The bitmap image is interpreted like image data for the glDrawPixels()
49 command, with width and height corresponding to the width and height
50 arguments of that command, and with type set to GL_BITMAP and format
51 set to GL_COLOR_INDEX. Modes specified using glPixelStore() affect the
52 interpretation of bitmap image data; modes specified using
53 glPixelTransfer() do not.
54
55 If the current raster position is invalid, glBitmap is ignored.
56 Otherwise, the lower left corner of the bitmap image is positioned at
57 the window coordinates
58
59 x w = x r - x o
60
61 y w = y r - y o
62
63 where x r y r is the raster position and x o y o is the bitmap origin.
64 Fragments are then generated for each pixel corresponding to a 1 (one)
65 in the bitmap image. These fragments are generated using the current
66 raster z coordinate, color or color index, and current raster texture
67 coordinates. They are then treated just as if they had been generated
68 by a point, line, or polygon, including texture mapping, fogging, and
69 all per-fragment operations such as alpha and depth testing.
70
71 After the bitmap has been drawn, the x and y coordinates of the current
72 raster position are offset by xmove and ymove. No change is made to the
73 z coordinate of the current raster position, or to the current raster
74 color, texture coordinates, or index.
75
77 To set a valid raster position outside the viewport, first set a valid
78 raster position inside the viewport, then call glBitmap with NULL as
79 the bitmap parameter and with xmove and ymove set to the offsets of the
80 new raster position. This technique is useful when panning an image
81 around the viewport.
82
84 GL_INVALID_VALUE is generated if width or height is negative.
85
86 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
87 bound to the GL_PIXEL_UNPACK_BUFFER target and the buffer object's data
88 store is currently mapped.
89
90 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
91 bound to the GL_PIXEL_UNPACK_BUFFER target and the data would be
92 unpacked from the buffer object such that the memory reads required
93 would exceed the data store size.
94
95 GL_INVALID_OPERATION is generated if glBitmap is executed between the
96 execution of glBegin() and the corresponding execution of glEnd().
97
99 glGet() with argument GL_CURRENT_RASTER_POSITION
100
101 glGet() with argument GL_CURRENT_RASTER_COLOR
102
103 glGet() with argument GL_CURRENT_RASTER_SECONDARY_COLOR
104
105 glGet() with argument GL_CURRENT_RASTER_DISTANCE
106
107 glGet() with argument GL_CURRENT_RASTER_INDEX
108
109 glGet() with argument GL_CURRENT_RASTER_TEXTURE_COORDS
110
111 glGet() with argument GL_CURRENT_RASTER_POSITION_VALID
112
113 glGet() with argument GL_PIXEL_UNPACK_BUFFER_BINDING
114
116 glBindBuffer(), glDrawPixels(), glPixelStore(), glPixelTransfer(),
117 glRasterPos(), glWindowPos()
118
120 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
121 under the SGI Free Software B License. For details, see
122 http://oss.sgi.com/projects/FreeB/.
123
125 opengl.org
126
127
128
129opengl.org 07/13/2018 GLBITMAP(3G)