Skip to content

Commit 152a6ab

Browse files
authored
Implement SDL_DisplayFormat (#24299)
This converts surfaces to the format used by the screen. Since the screen in Emscripten has an alpha component, this behaves the same as `SDL_DisplayFormatAlpha`.
1 parent 595bbe6 commit 152a6ab

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/lib/libsdl.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,6 +1897,9 @@ var LibrarySDL = {
18971897
return ret;
18981898
},
18991899

1900+
SDL_DisplayFormat__deps: ['SDL_ConvertSurface'],
1901+
SDL_DisplayFormat: (surf) => _SDL_ConvertSurface(surf, 0, 0),
1902+
19001903
SDL_DisplayFormatAlpha__deps: ['SDL_ConvertSurface'],
19011904
SDL_DisplayFormatAlpha: (surf) => _SDL_ConvertSurface(surf, 0, 0),
19021905

src/lib/libsigs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ sigs = {
6666
SDL_DestroyMutex__sig: 'vp',
6767
SDL_DestroyRenderer__sig: 'vp',
6868
SDL_DestroyWindow__sig: 'vp',
69+
SDL_DisplayFormat__sig: 'pp',
6970
SDL_DisplayFormatAlpha__sig: 'pp',
7071
SDL_EnableKeyRepeat__sig: 'iii',
7172
SDL_EnableUNICODE__sig: 'ii',

0 commit comments

Comments
 (0)