GithubHelp home page GithubHelp logo

Comments (9)

HexDecimal avatar HexDecimal commented on July 28, 2024

Do you mean that it isn't using the 'nearest' filter with the OpenGL2 renderer?

from python-tcod.

HexDecimal avatar HexDecimal commented on July 28, 2024

If it's just the filter then you should be able to affect it with an SDL hint:

import tcod
tcod.lib.SDL_SetHint(b"SDL_RENDER_SCALE_QUALITY", b"0")

Calling this before creating the context will enforce the nearest filter no matter which renderer you use.

from python-tcod.

Darky-Lucera avatar Darky-Lucera commented on July 28, 2024

from python-tcod.

Darky-Lucera avatar Darky-Lucera commented on July 28, 2024

from python-tcod.

HexDecimal avatar HexDecimal commented on July 28, 2024

Integer scale only refers to the output resolution, not the upscale filter that's used. Being able to change the filter of the OpenGL 2 renderer is a recent feature. The OpenGL 1 renderer is limited to using the nearest filter only. I'm not sure if the nearest filter is the default for SDL2 in all cases.

The preferred filter depends on the tileset and the desired aesthetic. The SDL hint is something I could document better.

from python-tcod.

Darky-Lucera avatar Darky-Lucera commented on July 28, 2024

from python-tcod.

HexDecimal avatar HexDecimal commented on July 28, 2024

I remember that image scale solved the blurry graphics

Integer scaling, not image scaling. It prevents sub-pixel distortion, which could appear as a blurry smear with a linear filter, or as jagged non-square-pixel artifacts with a nearest filter. Integer scaling ensures that the tileset doesn't get distorted, but doesn't determine if the tileset will be pixelated or smooth when upscaled.

from python-tcod.

Darky-Lucera avatar Darky-Lucera commented on July 28, 2024

from python-tcod.

Darky-Lucera avatar Darky-Lucera commented on July 28, 2024

It worked perfectly. Thanks!

from python-tcod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.