Opengl rotation using gldrawpixels

Currently, my team is limited to drawing images on the opengl 1.4 platform, which means that we cannot use any beautiful texture mapping to paint the image (yes, we are limited to using the integrated Intel graphics platform, this is very annoying). So far we can draw, scale and flip the image, but the guy making the graphics claims that rotation through glRotate cannot be done using glDrawPixels, that we will need to switch to textures, etc. which do not work on the Intel platform.

I promised him lunch that there is a rotation function, such as glRotate, that will work for direct bitmaps. Is there such a function? Will glRotate work? I'm a little new to this graphic game, but it seems ridiculous that the library would not allow bitmap rotation except through texture rotation.

Thanks.

+4
source share
1 answer

You cannot use glRotate with glDrawPixels.

glDrawPixels is the worst and least efficient way to get pixels on the screen. You will even get better performance by placing pixels on the screen using poorly written rasterizer software.

In short, glDRawPixels will copy the pixel data from the process memory to the graphic memory and perform some very trivial conversions, such as flipping and scaling. More and more advanced (for example, rotating) requires the use of graphics chipset functions. For instance. You must use textures.

And the textures really work. They also work well with GL 1.4 and Intel graphics chipsets. I have been working on such a chipset for quite some time. You will not get the performance of modern ATI or NVIDIA chipsets, but they are not that bad.

It is best that someone try to create two-size non-energy textures, cannot do this, and decide that the textures do not work on the chipset at all.

This is not true. They work. You just need to know that OpenGL requires you to create textures with the power of two dimensions and you had to either use a subelement of a larger texture or put several images in one very large texture (later called a texture atlas).

You can compensate for the smaller image in a larger texture by adjusting the coordinates of the texture.

+7
source

All Articles