Skip to content

Commit

Permalink
drivers/glrend/v1model: handle map width/height wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
vs49688 committed Sep 30, 2024
1 parent 7a71af2 commit 2c8442b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions drivers/glrend/v1model.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,39 @@ static void apply_stored_properties(HVIDEO hVideo, state_stack *state, uint32_t
if(GLAD_GL_ARB_texture_filter_anisotropic)
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY, maxAnisotropy);

/*
* Apply wrapping.
*/
switch(state->prim.map_width_limit) {
case BRT_WRAP:
default:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
break;

case BRT_CLAMP:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
break;

case BRT_MIRROR:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
break;
}

switch(state->prim.map_height_limit) {
case BRT_WRAP:
default:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
break;

case BRT_CLAMP:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
break;

case BRT_MIRROR:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);
break;
}

// if(state->prim.colour_map)
//{
// if(state->prim.colour_map->source)
Expand Down

0 comments on commit 2c8442b

Please sign in to comment.