Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sdl2): add missing stubs #928

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

fix(sdl2): add missing stubs #928

wants to merge 1 commit into from

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