Use the shared palette in the sample
This commit is contained in:
parent
d89997a277
commit
2ac9cac22d
|
@ -110,6 +110,9 @@ void LoadGLTextures() {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glEnable(GL_SHARED_TEXTURE_PALETTE_EXT);
|
||||||
|
glColorTableEXT(GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGBA8, image1->palette_width, GL_RGBA, GL_UNSIGNED_BYTE, image1->palette);
|
||||||
|
|
||||||
// Create Texture
|
// Create Texture
|
||||||
glGenTextures(1, &texture[0]);
|
glGenTextures(1, &texture[0]);
|
||||||
glBindTexture(GL_TEXTURE_2D, texture[0]); // 2d texture (x and y size)
|
glBindTexture(GL_TEXTURE_2D, texture[0]); // 2d texture (x and y size)
|
||||||
|
@ -117,8 +120,6 @@ void LoadGLTextures() {
|
||||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR); // scale linearly when image bigger than texture
|
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR); // scale linearly when image bigger than texture
|
||||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR); // scale linearly when image smalled than texture
|
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR); // scale linearly when image smalled than texture
|
||||||
|
|
||||||
glColorTableEXT(GL_TEXTURE_2D, GL_RGBA8, image1->palette_width, GL_RGBA, GL_UNSIGNED_BYTE, image1->palette);
|
|
||||||
|
|
||||||
// 2d texture, level of detail 0 (normal), 3 components (red, green, blue), x size from image, y size from image,
|
// 2d texture, level of detail 0 (normal), 3 components (red, green, blue), x size from image, y size from image,
|
||||||
// border 0 (normal), rgb color data, unsigned byte data, and finally the data itself.
|
// border 0 (normal), rgb color data, unsigned byte data, and finally the data itself.
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, image1->width, image1->height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE_TWID_KOS, image1->data);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, image1->width, image1->height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE_TWID_KOS, image1->data);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user