Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setTextureFilter causes segfault #65

Open
KelvinShadewing opened this issue Oct 27, 2023 · 0 comments
Open

setTextureFilter causes segfault #65

KelvinShadewing opened this issue Oct 27, 2023 · 0 comments

Comments

@KelvinShadewing
Copy link
Owner

Here's the code for the function:

void setTextureFilter(int tex, int filter) {
	SDL_ScaleMode sm = (SDL_ScaleMode)min(max(filter, 0), 2);

	if(tex > 0 && tex < vcTextures.size() && vcTextures[tex] != 0)
		SDL_SetTextureScaleMode(vcTextures[tex], sm);
	else
		xyPrint("WARNING: Texture not found!");
}

From what few examples I can find, I'm using the function SDL_SetTextureScaleMode correctly, but it causes a crash every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant