Allow configuring automatic texture twiddling in glKosInitEx

Defaults to enabled.
This commit is contained in:
Luke Benstead 2023-09-01 20:22:38 +01:00
parent 246cb997da
commit 36de063756
2 changed files with 13 additions and 0 deletions

View File

@ -47,6 +47,8 @@ void APIENTRY glKosInitConfig(GLdcConfig* config) {
config->initial_tr_capacity = 1024 * 3; config->initial_tr_capacity = 1024 * 3;
config->initial_immediate_capacity = 1024 * 3; config->initial_immediate_capacity = 1024 * 3;
config->internal_palette_format = GL_RGBA8; config->internal_palette_format = GL_RGBA8;
config->texture_twiddle = GL_TRUE;
} }
static bool _initialized = false; static bool _initialized = false;
@ -78,6 +80,10 @@ void APIENTRY glKosInitEx(GLdcConfig* config) {
_glInitTextures(); _glInitTextures();
if(config->texture_twiddle) {
glEnable(GL_TEXTURE_TWIDDLE_KOS);
}
OP_LIST.list_type = GPU_LIST_OP_POLY; OP_LIST.list_type = GPU_LIST_OP_POLY;
PT_LIST.list_type = GPU_LIST_PT_POLY; PT_LIST.list_type = GPU_LIST_PT_POLY;
TR_LIST.list_type = GPU_LIST_TR_POLY; TR_LIST.list_type = GPU_LIST_TR_POLY;

View File

@ -57,6 +57,13 @@ typedef struct {
GLuint initial_pt_capacity; GLuint initial_pt_capacity;
GLuint initial_immediate_capacity; GLuint initial_immediate_capacity;
/* Default: True
*
* Whether glTexImage should automatically twiddle textures
* if the internal format is a generic format (e.g. GL_RGB).
* this is the same as calling glEnable(GL_TEXTURE_TWIDDLE_KOS)
* on boot */
GLboolean texture_twiddle;
} GLdcConfig; } GLdcConfig;