Look at this page:
That looks excellent for textured objects, but what I’m trying to do is straightforward bitmap drawing. I’m following the methods that Blender itself uses for display of images, because I’m concerned about the accuracy of my graphics card if I were to use textures.
This is how I’m drawing my bitmaps:
def drawImage(image, x, y, w, h, zoom):
Draws an image in the current OpenGL context. This method takes care of
the problem of OpenGL clipping the raster position if it is outside of the
viewport. Note that the image is always drawn so that a pixel boundary is
aligned along the left and bottom of the window.
@param image BGL buffer containing the image to draw; this may be NULL,
in which case no image will be drawn.
@param x, y Coordinates of the bottom-left of the image (integers).
@param w, h Width of the original, un-zoomed image.
@param zoom Zoom factor for the image (float).
if image is None:
dx = dy = 0
if x < 0:
dx = -x
x = 0
BGL.glPixelStorei(BGL.GL_UNPACK_SKIP_PIXELS, int(dx / zoom))
x = int(x / zoom) * zoom
if y < 0:
dy = -y
y = 0
BGL.glPixelStorei(BGL.GL_UNPACK_SKIP_ROWS, int(dy / zoom))
y = int(y / zoom) * zoom
BGL.glDrawPixels(int(w-(dx/zoom)), int(h-(dy/zoom)), BGL.GL_RGBA,