Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: DevIL problems.

  1. #1

    DevIL problems.

    Hello, I have a new problem :S
    I use the DevIL to load my images and then to manually get the ImageData (ilGetData) to create my texture using glGenTextures and glTexImage2D. The image and textures are created ok, but when I try to glBindTexture with the textureID of the class, nothing happens. I use the lesson5 code from Nehe to make a test quad and use glTexCoord2f as described there. I do enable the texture_2d flag with glEnable. The image I am loading a a 128x128 bmp (btw I crash when I run the program, but in Debug in doesnt crash at all, weird??)

    All I see, in the corners of the cube, part of the texture, like small dots in every corner. Any ideas??

  2. #2

    Re: DevIL problems.

    Nm, I just found it!!!

  3. #3

    Re: DevIL problems.

    Bah, I thought I found everything, but there is a bug here. When I load non power of 2 BMP images, my applciation crashes. The thing is that the model (MD2) supplied with the sample at animating an MD2 at GameTutorials.com has a BMP file of non power of 2 and it works! Could it be devIL library? OpenGL has to use only power of 2 textures?

    Thanks

  4. #4
    Junior Member Regular Contributor
    Join Date
    Sep 2001
    Location
    Eastern USA
    Posts
    218

    Re: DevIL problems.

    OpenGL requires texture dimensions to be powers of 2, however I have never heard of a program crashing upon an attempt to use something else.

  5. #5
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,256

    Re: DevIL problems.

    Originally posted by kaysoft:
    Bah, I thought I found everything, but there is a bug here. When I load non power of 2 BMP images, my applciation crashes. The thing is that the model (MD2) supplied with the sample at animating an MD2 at GameTutorials.com has a BMP file of non power of 2 and it works! Could it be devIL library? OpenGL has to use only power of 2 textures?

    Thanks
    I dont know why devil crashes. It can read any image size AFAIK. Too bad it is no longer supported by the author.

    OpenGL can take non power of 2 textures, but only with the nvidia_rectangle extension.

    It's always better to scale iot to power of 2 for standard GL.

    V-man
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  6. #6

    Re: DevIL problems.

    Ok, thanks guys.
    But what if the user doesnt have a nvidia card? is there a way to support non power of 2 texture sizes with ARB extensions?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •