02-06-2001, 05:57 AM
hi,
I have an image as a matrix of gray scale tones.
Img = array[0..TEXSIZE, 0..TEXSIZE] of byte =
10 5 8 25 40 45 30 23 ......
40 45 28 35 70 43 55 54 ......
10 35 48 55 90 45 50 65 ......
60 55 58 28 38 42 60 34 ......
..............................
..............................
And I want to use this gray scale map as texture. I have tried this
glTexImage2D(GL_TEXTURE_2D, 0, 1, TEXSIZE, TEXSIZE, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, pointer(Img));
byte I get an Access violation error.
How can I make this texture.
I have an image as a matrix of gray scale tones.
Img = array[0..TEXSIZE, 0..TEXSIZE] of byte =
10 5 8 25 40 45 30 23 ......
40 45 28 35 70 43 55 54 ......
10 35 48 55 90 45 50 65 ......
60 55 58 28 38 42 60 34 ......
..............................
..............................
And I want to use this gray scale map as texture. I have tried this
glTexImage2D(GL_TEXTURE_2D, 0, 1, TEXSIZE, TEXSIZE, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, pointer(Img));
byte I get an Access violation error.
How can I make this texture.