Results 1 to 2 of 2

Thread: Multiple textures

  1. #1
    Guest

    Multiple textures

    How can I load and use multiple textures? For example cube that has six different textures.

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2000
    Location
    Ottersberg,Niedersachsen,Germany
    Posts
    3

    Re: Multiple textures

    That is really simple:

    1.) Set up six storages for your textures:
    GLuint texture[6];

    2.) Load images in to them(hope you know how!)

    3.)Enable GL_Texture in your init sequence:
    glEnable(GL_TEXTURE_2D);

    4.) Draw your cube:

    glBindTexture(GL_TEXTURE_2D, texture[0]);
    draw quad 1

    glBindTexture(GL_TEXTURE_2D, texture[1]);
    draw quad 2

    glBindTexture(GL_TEXTURE_2D, texture[2]);
    draw quad 3

    glBindTexture(GL_TEXTURE_2D, texture[3]);
    draw quad 4

    glBindTexture(GL_TEXTURE_2D, texture[4]);
    draw quad 5

    glBindTexture(GL_TEXTURE_2D, texture[5]);
    draw quad 6

    That's all, hope it helps!



    [This message has been edited by Simon (edited 07-09-2000).]

Similar Threads

  1. Replies: 9
    Last Post: 11-02-2018, 08:16 AM
  2. multiple textures
    By tnt1674 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 06-18-2016, 08:29 AM
  3. Multiple Viewports, Multiple Textures - 3D
    By Cyndy in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 04-08-2010, 04:47 PM
  4. multiple lights and multiple textures
    By jide in forum OpenGL: GLSL
    Replies: 4
    Last Post: 10-26-2005, 06:47 AM
  5. multiple textures
    By Thr33d in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-27-2000, 04:07 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