opengl rotation using gldrawpixels

▼魔方 西西 提交于 2019-12-05 12:14:44

You can't use glRotate with glDrawPixels.

glDrawPixels is the worst and least performant way to get pixels onto the screen by far. You will even get better performance by putting the pixels onto the screen using a bad written software-rasterizer.

In short glDRawPixels will copy pixel data from the process-memory to the graphics memory and will do some very trivial transformations like flipping and scaling. Everything more advanced (like rotating) requires you to actually use the features of the graphic-chipset. E.g. You have to use textures.

And textures do work. They also work well with GL 1.4 and the Intel graphic chipsets. I've worked on such a chipset myself for quite a while. You won't get the performance of modern ATI or NVIDIA chipsets, but they aren't that bad either.

My best bet is that someone tried to create textures of a non power of two size, failed to do so and decided that textures in general don't work on the chipset.

That's not true. They do work. You just have to know that OpenGL requires you to create textures at power of two dimensions and that you have to either use a subrectangle of the larger texture or put multiple images into one very large texture (the later is called a texture atlas).

You can compensate for the smaller image within a larger texture by adjusting the texture-coordinates.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!