Skip to content

Commit 383eec5

Browse files
committed
Discourage the use of alternative renderers.
I'll likely address the rare issues with the other renderers by removing them.
1 parent f134872 commit 383eec5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
1212
- Using `libtcod 1.22.3`.
1313
- Bundle `SDL 2.24.0` on Windows and MacOS.
1414

15+
### Deprecated
16+
- Renderers other than `tcod.RENDERER_SDL2` are now discouraged.
17+
1518
### Fixed
1619
- Fixed double present bug in non-context flush functions.
1720
This was affecting performance and also caused a screen flicker whenever the global fade color was active.

tcod/context.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import os
5353
import pickle
5454
import sys
55+
import warnings
5556
from typing import Any, Iterable, List, Optional, Tuple
5657

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

0 commit comments

Comments
 (0)