Skip to content

Commit

Permalink
Discourage the use of alternative renderers.
Browse files Browse the repository at this point in the history
I'll likely address the rare issues with the other renderers by removing them.
  • Loading branch information
HexDecimal committed Sep 23, 2022
1 parent f134872 commit 383eec5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
- Using `libtcod 1.22.3`.
- Bundle `SDL 2.24.0` on Windows and MacOS.

### Deprecated
- Renderers other than `tcod.RENDERER_SDL2` are now discouraged.

### Fixed
- Fixed double present bug in non-context flush functions.
This was affecting performance and also caused a screen flicker whenever the global fade color was active.
Expand Down
11 changes: 9 additions & 2 deletions tcod/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import os
import pickle
import sys
import warnings
from typing import Any, Iterable, List, Optional, Tuple

from typing_extensions import Literal, NoReturn
Expand Down Expand Up @@ -489,8 +490,8 @@ def new(
Providing no size information at all is also acceptable.
`renderer` is the desired libtcod renderer to use.
Typical options are :any:`tcod.context.RENDERER_OPENGL2` for a faster
renderer or :any:`tcod.context.RENDERER_SDL2` for a reliable renderer.
The default is :any:`tcod.context.RENDERER_SDL2` which is a fast renderer that runs reliably on all platforms.
If unsure then don't set this parameter.
`tileset` is the font/tileset for the new context to render with.
The fall-back tileset available from passing None is useful for
Expand Down Expand Up @@ -525,6 +526,12 @@ def new(
"""
if renderer is None:
renderer = RENDERER_SDL2
if renderer != RENDERER_SDL2:
warnings.warn(
"In the future all renderers other than tcod.RENDERER_SDL2 may be removed or ignored.",
PendingDeprecationWarning,
stacklevel=2,
)
if sdl_window_flags is None:
sdl_window_flags = SDL_WINDOW_RESIZABLE
if argv is None:
Expand Down

0 comments on commit 383eec5

Please sign in to comment.