views:

411

answers:

2

I'm making an image viewer using openGL and I've run into a situation where I need to load very large (>50MB) images to be viewed. I'm loading the images as textures and displaying them to a GL_QUAD which has been working great for smaller images, but on the large images the loading fails and I get a blank rectangle. So far I've implemented a very ugly hack that uses another program to convert the images to smaller, lower resolution versions which can be loaded, but I'm looking for a more elegant solution. I've found that openGL has a texture compression feature but I can't get it to work. When I call

glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_ARB, t.width(), t.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, t.bits());

I get the compiler error "*GL_COMPRESSED_RGBA_ARB* undeclared". What am I doing wrong? Is there a library I'm missing? And more generally, is this a viable solution to my problem?

I'm using Qt Creator on a Windows Vista machine, with a NVIDIA Quadro FX 1700 graphics card.

+1  A: 

First, I'd have to ask what resolution are these large images? Secondly, to use a define such as GL_COMPRESSED_RGBA_ARB, you would need to download and use something like GLEW which is more modernized in the GL api than the standard MS-Dev install.

Jim Buck
The images are anywhere between 10,000 and 30,000 pixels per side.
Graphics Noob
Yeah, your card's drivers most likely can't handle that resolution, so you are best to split them up into smaller images.
Jim Buck
+2  A: 

On my own GFX card the maximum resolution for an opengl texture is 8192x8192, if your image is bigger then 50MB, it is propably a very very high resolution... Check http://www.opengl.org/resources/faq/technical/texture.htm , it describes how you can find the maximum texture size.

AnalyticaL