I'm fine in OGL as long as I don't try to UV map a texture or use a texture for that matter.
First I realized I had made the texture a non integral value of 64 128 256 etc.
No biggie!
Then I generate the map from the data I have setting anything black level to transparent <not a problem>
Code used to create a texture
Code I use to apply a texture
Lots of code is missing but it's mostly creating the bitmap that becomes the texture.
The result is less than satisfying.. essentially the textured surface glows closest to the last colored vertex information sent. Anyone got a clue? Textures aren't my forte' <who would have guessed>.
Cyb
First I realized I had made the texture a non integral value of 64 128 256 etc.
No biggie!
Then I generate the map from the data I have setting anything black level to transparent <not a problem>
Code used to create a texture
Code:
X = BM->Width;
if (X < BM->Height) X = BM->Height;
if (X < 64)
{ X = 64;
}
else
{ if (X < 128)
{ X = 128;
}
else
{ X = 256;
}
}
BM->Width = X;
BM->Height = X;
Textures[0].Width = X;
Textures[0].Height = X;
Textures[0].bpp = 32;
Bytes = X*X*4;
Textures[0].ImageData = new GLubyte[Bytes];
if (Textures[0].ImageData != NULL)
{
memset(Textures[0].ImageData, 0, Bytes);
// select palette and convert
BCB2OGL(Textures[0].ImageData, BM);
glGenTextures(1, &Textures[0].texID);
glBindTexture(
GL_TEXTURE_2D,
Textures[0].texID
);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
gluBuild2DMipmaps(
GL_TEXTURE_2D,
3,
Textures[0].Width,
Textures[0].Height,
GL_RGBA,
GL_UNSIGNED_BYTE,
Textures[0].ImageData
);
}
Code:
glBindTexture(
GL_TEXTURE_2D,
Textures[0].texID
);
glBegin(GL_TRIANGLES);
glTexCoord2f(
TTriangles[Index].U0/TexW,
TTriangles[Index].V0/TexH
);
FF7_Vert_2_OGL(&Verts[TTriangles[Index].Vertexs.A>>3]);
glTexCoord2f(
TTriangles[Index].U1/TexW,
TTriangles[Index].V1/TexH
);
FF7_Vert_2_OGL(&Verts[TTriangles[Index].Vertexs.B>>3]);
glTexCoord2f(
TTriangles[Index].U2/TexW,
TTriangles[Index].V2/TexH
);
FF7_Vert_2_OGL(&Verts[TTriangles[Index].Vertexs.C>>3]);
glEnd();
Lots of code is missing but it's mostly creating the bitmap that becomes the texture.
The result is less than satisfying.. essentially the textured surface glows closest to the last colored vertex information sent. Anyone got a clue? Textures aren't my forte' <who would have guessed>.
Cyb
Last edited: