arsdever / gamify

Simple OpenGL based game engine
0 stars 0 forks source link

Add texture wrapping and interpolation mode support #32

Closed arsdever closed 2 months ago

arsdever commented 2 months ago

The PR updates the texture class to add the ability to set the sampling mode of the textures and repeat strategy.

For the sampling mode, it specifies 2 (as for now) when magnifying (nearest (default) and linear) and an additional 4 for minimizing (taking into account the mipmap images too).

For the repeat strategy it defines 4 types: repeat, mirrored-repeat, clamp-to-edge, clamp-to-border. It also can specify the strategy for x and y axes separately.

These API is mostly based on the OpenGL functionality, and can vary later.

For testing, the PR also creates a new test application, with 2 windows, each of them visualizes one of the new features.

Here are screenshots of the test application

Description Screenshot
Sampling mode visualization Screenshot 2024-06-02 190949
Repeat mode visualization ezgif com-animated-gif-maker