iDevGames Forums
problem with IMG_Load - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: problem with IMG_Load (/thread-3814.html)

Pages: 1 2


problem with IMG_Load - sohta - Oct 15, 2006 11:09 AM

Obviously, however, I have high doubts that his Texture Matrix is anything else than identity...


problem with IMG_Load - ferum - Oct 15, 2006 11:15 AM

Ok Thanks!
I knew openGL coordinates referenced from the bottom left. I didn't know bmp files referenced from the top left.


problem with IMG_Load - unknown - Oct 15, 2006 11:29 AM

ferum Wrote:I knew openGL coordinates referenced from the bottom left.
They are not referenced from bottom left.


problem with IMG_Load - Skorche - Oct 15, 2006 01:25 PM

The TEXTURE_2D target only accepts textures with a power of two for it's dimensions.

There is also a TEXTURE_RECTANGLE_EXT that will allow you to use any size textures, but requires a GeForce2 or Radeon or better video card. It also doesn't support mip-mapping, and the texture coordinates aren't normalized.

I don't know exactly what they are called, but the new OpenGL 2.0 (or 1.5?) non-power of two textures support mip-mapping, but need a really fancy and expensive video card.

And for those that are arguing, how does OpenGL coordinate system preserve "mathematical coherence"? It certainly confuses new people at first, but it's not like it's mathematically superior. The orientation of the coordinate system is as arbitrary of a decision in math as it is in OpenGL. If anything it's slightly annoying because it's not the same coordinate system used for images and input coordinates.


problem with IMG_Load - sohta - Oct 15, 2006 01:40 PM

Skorche Wrote:how does OpenGL coordinate system preserve "mathematical coherence"?

From my point of view, working in the first quadrant has many advantages, especially when doing signal representation. A layman's way of putting it would be: up is positive, down is negative.

Having the untransformed state that way for vertices and the other way around for texture coordinates would be useful for newbies, but it would be incoherent. Hence my comments about it.


problem with IMG_Load - OneSadCookie - Oct 15, 2006 01:49 PM

Frogblast Wrote:Check again, no iBook supports OpenGL 2.0 today.

Incorrect...

10.4.8 introduces OpenGL 2.0 support. Radeon 9550+ and GeForce 6600+ cards report that they support it (what about 5200s? anyone have one to comment?). The last generation of G4 iBooks have 9550s.

10.4.8 also introduces the extensions that were missing from 10.4.7 but merged into 2.0 -- ARB_draw_buffers and ARB_texture_non_power_of_two. Radeon 9550+ and GeForce 6600+ cards report that they support both.

However, the Radeons are effectively lying. They do *not* support non-power-of-two textures with mipmapping in hardware. If you enable mipmapping for an NPOT texture on a Radeon, you will fall back to software rendering.

On Windows, the Radeon cards report OpenGL 2.0, but *not* ARB_texture_non_power_of_two, meaning that the extension check is a valid check for hardware support. On Mac OS X, Apple has decided to make our lives difficult by forcing us to check whether doing this causes a software fallback.

Code:
#if defined(__APPLE__)
    long hardwareAccelerated;

    CGLGetParameter(
        CGLGetCurrentContext(),
        kCGLCPGPUVertexProcessing,
        &hardwareAccelerated);
    if (!hardwareAccelerated)
    {
        fprintf(stderr,
            "Warning: Vertex processing is NOT being hardware-accelerated\n");
    }
    CGLGetParameter(
        CGLGetCurrentContext(),
        kCGLCPGPUFragmentProcessing,
        &hardwareAccelerated);
    if (!hardwareAccelerated)
    {
        fprintf(stderr,
            "Warning: Fragment processing is NOT being hardware-accelerated\n");
    }
#endif

Please file a bug report to have the Radeons stop reporting support for the ARB_texture_non_power_of_two extension, to make our lives easier, and make OpenGL on the Mac consistent with Windows. The more people file, the more likely it is to change.