Menu

Texture Problem "rock.tga"

starcreek
2008-02-02
2012-09-26
  • starcreek

    starcreek - 2008-02-02

    i was successful on the magnification and minification for the 1D square movements.

    although the "rock.tga" texture does not show; the code still works. So i thougth the problem might be in the loading of the rock.tga

    at first my code was:

    if (!m_textureOne->Load("rock.tga"))
    return false;

    it produces no error, but i am puzzled as to why my 2 squares are without texture

    i thought changing the code to

    image.Load("rock.tga");
    glGenTextures(1, &m_rockTexture);
    glBindTexture(GL_TEXTURE_2D, m_rockTexture);
    gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, image.GetWidth(), image.GetHeight(), GL_RGB, GL_UNSIGNED_BYTE, image.GetImage());
    image.Release();

    would work, but i still see no texture!

    im not having any errors, but i would like to achieve the point to my current chapter before i move on.

     
    • BiT

      BiT - 2008-02-04

      I would take a look at the NEHE tutorial.

      http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=33

       
    • starcreek

      starcreek - 2008-02-04

      i tried placing the file rock.tga in C:\myprojectfiles but it still doesnt work

      i guess that im not telling c++ how to properly load and find the file if i could get some help with that it would be greatly appreciated.

      i've tried debugging it, and the blue line tells me that the code steps into the if (!pFile) statement, now i have no clue on how to change that so that it can load rock.tga

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.