Skip to content

fix(sdl2): add missing stubs#928

Draft
lessp wants to merge 1 commit intomasterfrom
fix/sdl2/js-stubs
Draft

fix(sdl2): add missing stubs#928
lessp wants to merge 1 commit intomasterfrom
fix/sdl2/js-stubs

Conversation

@lessp
Copy link
Member

@lessp lessp commented Jun 30, 2020

No description provided.


// Provides: resdl_SDL_GetNumVideoDisplays
function resdl_SDL_GetNumVideoDisplays() {
return 1;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we can get the the number of displays via the web api. Are we OK with simply returning 1 here?


// Provides: resdl_SDL_GetWindowPixelFormat
function resdl_SDL_GetWindowPixelFormat(_win) {
return "SDL_PIXELFORMAT_ARGB8888";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what we'd like to return here? Some sort of Unknown tag perhaps?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't worry too much about getting this exactly right as I think the dummy stubs approach is fundamentally broken. There ought to be separate platform APIs for desktop, JS and mobile. More on that soon, but for now I'd suggest just going with whatever works short-term.


// Provides: resdl_SDL_GetPixelFormatName
function resdl_SDL_GetPixelFormatName(value) {
return "resdl_SDL_GetPixelFormatName: Not implemented";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.


// Provides: resdl_SDL_GetLinkedVersion
function resdl_SDL_GetLinkedVersion() {
return 1;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.


// Provides: resdl_SDL_GetScancodeFromName
function resdl_SDL_GetScancodeFromName() {
return "scancodeFromName";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both this and GetKeyFromName could probably be retrieved from the web api, I'd think!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


// Provides: resdl_SDL_GetCompiledVersion
function resdl_SDL_GetCompiledVersion() {
return "resdl_SDL_GetCompiledVersion: Not implemented";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷


// Provides: resdl_SDL_GetKeyFromName
function resdl_SDL_GetKeyFromName() {
return "keyFromname";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@lessp lessp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some API-links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments