Results 1 to 2 of 2

Thread: about 16bit texture

  1. #1

    about 16bit texture

    I am working with a 16bit texture stored in a specified file format. The pixels are stored one by one, not compressed. The bit assign is 5-5-5-1. but when I use glTexImage2D(), there is always an error.
    Here is my source:
    glTexImage2D(GL_TEXTURE_2D, 0 GL_RGB5_A1, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
    An illegal operaion error occur when this function runs.
    I am not sure about the format and type parameter, should I set the type to GL_UNSIGNED_SHORT? I have tried, but the error remains.
    Mycode works when operating 24b and 32bit texture with component set to 3 or 4.
    I am using VC6.0, and the opengl library with this version of VC.
    Can anyone help me?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Fargo, ND

    Re: about 16bit texture

    The first thing you should look at is how you are allocating the memory for your data. One of the biggest causes of exception errors stems from trying to read/write memory that has not been properly allocated.
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. 16bit Short Texture / Bitwise Ops in Shader
    By SirSmackalot in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 07-06-2011, 06:44 PM
  2. 16bit depth + FBO
    By zed in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 04-08-2006, 11:01 AM
  3. How big exactly is 16bit depth???
    By nomad007 in forum OpenGL: Basic Coding
    Replies: 13
    Last Post: 04-23-2002, 09:34 PM
  4. HELP - 16bit(565) Texture Mapping...
    By bmcclint in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 08-15-2001, 07:44 AM
  5. about 16bit texture
    By Nil_z in forum OpenGL: Advanced Coding
    Replies: 11
    Last Post: 01-17-2001, 08:26 PM

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