Skip to content

Commit

Permalink
[pxd] format
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Apr 6, 2024
1 parent 81f13e9 commit 06f63e7
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions pxd/src/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ def __init__(self, cpu: CPU, debug: bool = False, headless: bool = False) -> Non
sdl2.SDL_RenderSetLogicalSize(self.hw_renderer, size[0], size[1])
self.hw_buffer = sdl2.SDL_CreateTexture(
self.hw_renderer,
sdl2.SDL_PixelFormatEnum.SDL_PIXELFORMAT_ABGR8888
if cython.compiled
else sdl2.SDL_PIXELFORMAT_ABGR8888,
(
sdl2.SDL_PixelFormatEnum.SDL_PIXELFORMAT_ABGR8888
if cython.compiled
else sdl2.SDL_PIXELFORMAT_ABGR8888
),
sdl2.SDL_TEXTUREACCESS_STREAMING,
size[0],
size[1],
Expand Down Expand Up @@ -234,12 +236,16 @@ def tick(self) -> None:
sdl2.SDL_UpdateTexture(
self.hw_buffer,
cython.NULL if cython.compiled else None,
self.buffer.pixels
if cython.compiled
else self.buffer.contents.pixels,
self.buffer.pitch
if cython.compiled
else self.buffer.contents.pitch,
(
self.buffer.pixels
if cython.compiled
else self.buffer.contents.pixels
),
(
self.buffer.pitch
if cython.compiled
else self.buffer.contents.pitch
),
)
sdl2.SDL_RenderCopy(
self.hw_renderer,
Expand Down

0 comments on commit 06f63e7

Please sign in to comment.