Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Texture map isn't created?

  1. #1
    Intern Newbie
    Join Date
    Jul 2013

    Texture map isn't created?

    Code :
    glGenTextures(1, &textures[8]);
    glBindTexture(GL_TEXTURE_2D, textures[8]);
    glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer);
    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textures[8], 0);
    glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer_2);
    glBindTexture(GL_TEXTURE_2D, textures[8]);
    glUniform1i(glGetUniformLocation(_program, "Decal"), 8);

    The texture doesn't load. The surface it's supposed to be mapped to appears transparent. What am I doing wrong?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    You only reserve a name for a texture object (glGenTextures), but this name would only become a texture object when you specify/reserve storage for it (glTexStorage*() or glTexImage*() calls), which is missing from the code you posted.

Posting Permissions

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