Results 1 to 4 of 4

Thread: Texture Problem

  1. #1
    Guest

    Texture Problem

    I write a VC++ program to load a color BMP file to a rectangle but when i run it all the rectangles are in black and gray color. So what wrong?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Texture Problem

    Do you have lighting turned on?
    If lighting is turned on is also Color matrial?

    example:

    glEnable(GL_LIGHTING);
    glEnable(GL_COLOR_MATERIAL);

    Originally posted by Gilbee:
    I write a VC++ program to load a color BMP file to a rectangle but when i run it all the rectangles are in black and gray color. So what wrong?

  3. #3
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    164

    Re: Texture Problem

    Hello.
    Code :
    glEnable(GL_TEXTURE_2D);
    Maybe you forgot this?
    You could always show us your code, though.
    We might help you better then.
    I may not be good looking but I sure am dumb.

  4. #4
    Guest

    Re: Texture Problem

    hi
    sigh~~
    I made a mistake when using gluBuild2DMipmaps

    eg
    gluBuild2DMipmaps(target, components, width, height,format,type, data )

    I set the components to 1 so it only disply black color...
    now my program can work~
    Thx

Similar Threads

  1. Render to texture problem or problem in approach
    By Taimoorak in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-07-2018, 06:04 AM
  2. Replies: 1
    Last Post: 01-10-2005, 09:50 AM
  3. Replies: 0
    Last Post: 01-09-2005, 06:01 PM
  4. Replies: 0
    Last Post: 01-09-2005, 05:53 PM
  5. Replies: 1
    Last Post: 01-09-2005, 05:50 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