The way to render a portion of a texture with out affecting the border with SDL2?

The way to render a portion of a texture with out affecting the border with SDL2?

[ad_1]

I seen that render a portion of the feel, it impacts is border values with the proximity of the surface remaining components of the feel.

This can be a drawback when these 2 parts are 2 totally different frames: mainly it’s interpolating the border with the surface of the feel when want rescaling.

This causes body/sprite artifacts.

Think about a texture atlas with a number of frames subsequent to one another. Copying one body is ensuing having the border interpolated with one other body and this almost certainly is creating an artifact.

Is there any method to strictly render a portion of texture making SDL Renderer ignoring no matter else is exterior the rect?

Merely copy and rescale solely the rect given?

e.g:
The two frames:
enter image description here

1st body on the underside is altered by the values of the 2nd body
enter image description here

2nd body on the highest is altered by the values of the first body
enter image description here

This subject would not occur if including 1 pixel pad among the many 2 frames or utilizing 1 texture per body. I’m questioning is there any SDL2 settings to keep away from this undesirable (subpixels?) interpolation?

Please additionally word that every one the operations are carried out with actual integers, so do not perceive actually from the place that “noise” might come from.
May it’s from some Video drivers settings?

[ad_2]

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply