I need to display 2d images in opengl using textures.
The image dimensions are not necessarily powers of 2.
I thought of creating a larger texture and restricting the display to the part I was using but the image data will be shared with openCV so I don’t want to copy data a pixel at a time into a larger texture.
EDIT – it turns out that even the simplest Intel on board graphics under Windows supports none-power-of-2 textures.
EDIT2 – and even if you don’t have arb texture size, then making your image smaller and rescaling to the window size it is very fast even on low end hardware
A couple of GL extensions come to mind. Have a look at GL_ARB_texture_rectangle (if you don’t need mipmapping), or GL_ARB_texture_non_power_of_two (if you do).