more render improve :D

This commit is contained in:
Lukas Nöllemeyer 2024-08-19 20:04:08 +02:00
parent af941dc848
commit 200a0a4996
4 changed files with 18 additions and 10 deletions

10
main.py
View file

@ -24,18 +24,14 @@ def main() -> None:
g.screens = [MainMenu()]
g.background = tcod.console.Console(80, 35)
g.foreground = tcod.console.Console(80, 35)
win = tcod.sdl.video.new_window(
g.background.width * g.tileset.tile_width,
g.background.height * g.tileset.tile_height,
flags=tcod.lib.SDL_WINDOW_RESIZABLE,
)
w, h = g.background.width * g.tileset.tile_width, g.background.height * g.tileset.tile_height
win = tcod.sdl.video.new_window(w,h, flags=tcod.lib.SDL_WINDOW_RESIZABLE)
g.sdl_window = win
g.sdl_renderer = tcod.sdl.render.new_renderer(g.sdl_window, target_textures=True)
g.target_texture = g.sdl_renderer.new_texture(w, h, access=tcod.sdl.render.TextureAccess.TARGET)
g.atlas = tcod.render.SDLTilesetAtlas(g.sdl_renderer, g.tileset)
g.console_render1 = tcod.render.SDLConsoleRender(atlas=g.atlas)