Results 1 to 2 of 2

Thread: using glGenTextures with multidimensional array

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2001
    Posts
    3

    using glGenTextures with multidimensional array

    I'd like to use a multidimensional array to store my textures, but I seem to have some trouble getting glGenTextures to work with it. I have a global variable

    GLuint myTextures[8][30];

    and down in my texture loading I call

    glGenTextures( 8 * 30, myTextures );

    however, when I try to compile it I get the error

    cannot convert from 'unsigned int [8][30]' to 'unsigned int'

    It works fine with one dimensional arrays, and since there's only 8 of the first one I made 8 seperate one dimensional arrays and it works fine. It would be a lot easier and cleaner, however, if I could use the multidimensional array. Can anyone give me some ideas on how to do this? Thanks in advance

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: using glGenTextures with multidimensional array

    Try changing this..

    glGenTextures( 8 * 30, myTextures );

    to this

    glGenTextures( 8 * 30, &myTextures[0][0] );

    or this could work too..

    glGenTextures( 8 * 30, *myTextures );

    The error is because myTextures is basically a GLuint**, and glGenTextures takes a GLuint*.
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. glDrawElements and multidimensional array
    By imported_miroslav_karpis in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 03-03-2010, 05:35 AM
  2. profile_GLSL and multidimensional arrays
    By dhoro in forum COLLADA
    Replies: 0
    Last Post: 01-03-2007, 06:01 PM
  3. glGenTextures() gives 0
    By Markkos in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-10-2004, 01:06 AM
  4. using glGenTextures with multidimensional array
    By valtrain in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 02-19-2001, 03:06 PM
  5. Multidimensional Arrays when using MFC?
    By in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 10-10-2000, 11:47 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