image content

  • vreal

    vreal - 2012-05-29

    Hi, I try to read a small image I created (64x64) which is completely red:

       ILuint ImageName;
       ilGenImages(1, &ImageName);
       wchar_t* imgFilename = L"..\\..\\resources\\textures\\red.png";
       ILubyte* texture = ilGetData();
       for (int i=0; i<64; i++) cout << (int)texture_ << endl;    // output first row

    Should the output on the last line be 255 0 0 255 0 0 255 0 0 …?
    I ask because this is not the case.
    I have a problem with my textures in OpenGL and I am trying to find the problem. So I started at the beginning - when loading the image._

  • vreal

    vreal - 2012-06-04

    I found the answer. Yes it should be.
    But with this code my program crashes when sending the texture to the graphics card:

    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, _texture);

    But as I have read in tutorials this should be all that is necessary.
    Can anybody help me out with this?


Log in to post a comment.