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 2 of 2

Thread: Trying to texture a quadric sphere..

  1. #1
    Intern Newbie
    Join Date
    Jul 2002
    Location
    NY, US
    Posts
    41

    Trying to texture a quadric sphere..

    Alright I have figured out a lot of mistakes but now I have a problem getting the
    glTexImage2D function to work.. I load a bitmap using LoadImage and then get the data using
    GetObject(pbitmap, sizeof(BITMAP), (LPSTR)&bmp);
    I don't know how to set the internal format, type, and format of the glTexImage2D call to get it to work. I am getting no errors but it just puts a black screen up. If I comment out the call I get my quadric sphere, untextured of course.

    I am calling it as follows:
    glTexImage2D(
    GL_TEXTURE_2D,
    0,
    GL_RGBA8,//internalformat
    bmp.bmWidth ,//width
    bmp.bmHeight ,//height
    0,//border
    GL_RGBA,//format
    GL_UNSIGNED_BYTE,//type
    bmp.bmBits );



    [This message has been edited by delic (edited 10-06-2002).]

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: Trying to texture a quadric sphere..

    All I can think of is that you image does not have height and width as a power of two (1, 2, 4, 8, 16 ...) and/or you don't change the default minification filtering to a non-mipmap filter (GL_LINEAR or GL_NEAREST), since default minification filter requires a complete mipmap chain.

    I also suggest you remove the '8' in the internal format. That way you let the driver choose the internal format, and I'm sure it will do a better job finding the proper format for the texture.

Posting Permissions

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