Original Post
🔒 Locked
procedural texture?
Advertisement
easy instead of storing the image as a char
ie
char colour[TEXTURESIZE][TEXTURESIZE];
use a RGB struct(or someit)
RGB colour[TEXTURESIZE][TEXTURESIZE];
RGB is
typedef unsigned char RGB[3]
btw there might be problems with the heap with such a large array
http://members.xoom.com/myBollux
ie
char colour[TEXTURESIZE][TEXTURESIZE];
use a RGB struct(or someit)
RGB colour[TEXTURESIZE][TEXTURESIZE];
RGB is
typedef unsigned char RGB[3]
btw there might be problems with the heap with such a large array
http://members.xoom.com/myBollux
ok ,thanks. I also found another way:
float ptexture[128][128][3];
void creatatest()
{
for(int y=0;y<128;y++)
for(int x=0;x<128;x++)
{
//rgbp temp={0,0,1};
ptexture[y][x][0]=0;
ptexture[y][x][1]=0;
ptexture[y][x][2]=1;
}
}
...
glTexImage2D(GL_TEXTURE_2D, 0, 3, 128, 128, 0, GL_RGB, GL_FLOAT, ptexture);
This as you could guess creates a blue texture.
Thanks for the help....
www.laeuchli.com/jesse
float ptexture[128][128][3];
void creatatest()
{
for(int y=0;y<128;y++)
for(int x=0;x<128;x++)
{
//rgbp temp={0,0,1};
ptexture[y][x][0]=0;
ptexture[y][x][1]=0;
ptexture[y][x][2]=1;
}
}
...
glTexImage2D(GL_TEXTURE_2D, 0, 3, 128, 128, 0, GL_RGB, GL_FLOAT, ptexture);
This as you could guess creates a blue texture.
Thanks for the help....
www.laeuchli.com/jesse
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement