KelvinShadewing / brux-gdk

Free runtime and development kit using SDL and Squirrel
GNU Affero General Public License v3.0
39 stars 20 forks source link

setTextureFilter causes segfault #65

Open KelvinShadewing opened 8 months ago

KelvinShadewing commented 8 months ago

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.