Results 1 to 2 of 2

Thread: glCompressedTexSubImage2DARB - non power of two?

  1. #1
    Member Newbie
    Join Date
    May 2002
    Location
    na
    Posts
    38

    glCompressedTexSubImage2DARB - non power of two?

    Moderators, I yanked the me previous thread on the same subject because the system wouldn't let me reply. Kept saying my account was unregistered.

    Can anyone point me to an example of how to load a non power of two compressed texture (DDS in my case) using glCompressedTexImage2DARB and glCompressedTexSubImage2DARB?

    My code is as follows:
    Code :
    glCompressedTexImage2DARB(GL_TEXTURE_2D,
                              0,
                              format,
                              pow2width,
                              pow2height,
                              0,
                              0,
                              NULL);
     
    glCompressedTexSubImage2DARB(GL_TEXTURE_2D, 
                                 0,
                                 0,
                                 0, 
                                 width, 
                                 height,
                                 format, 
                                 size,
                                 pixels);
    I'm trying to mimic a method I use to load uncompressed non-power of two textures like so:

    </font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size-small; font-family: monospace;">void loadTexture( void )
    {
    //lena.bmp is a 257x255 image
    TextureObject *pObject = loadtexture( "C:\\lena.bmp" );

    if(!pObject)
    return;

    glGenTextures( 1, &g_textureID );

    glBindTexture( GL_TEXTURE_2D, g_textureID );

    glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR );
    glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR );

    if(!IsPowerOfTwo(pObject->width)

  2. #2
    Member Newbie
    Join Date
    May 2002
    Location
    na
    Posts
    38

    Re: glCompressedTexSubImage2DARB - non power of two?

    mods, please delete this thread

    For some reason when I post it is saying my account is 'unregistered' and is also mangling the code section of my post.

    I'll try to post the topic again later.

Similar Threads

  1. Texture map (non power of two)
    By jsmith in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 08-05-2009, 03:52 AM
  2. non-power of two performance?
    By canuckle in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 07-21-2005, 08:25 PM
  3. "non power of two" render_target and ATI
    By Gorgull in forum OpenGL: Windows
    Replies: 14
    Last Post: 05-03-2005, 08:55 AM
  4. glCompressedTexSubImage2DARB ...
    By ToF_Fou in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-11-2002, 03:50 AM
  5. glCompressedTexSubImage2DARB ...
    By ToF_Fou in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 03-11-2002, 03:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean