libsdl-org / sdlwiki Goto Github PK
View Code? Open in Web Editor NEWThis is the raw contents of SDL's wiki. You can edit this through GitHub or at https://wiki.libsdl.org/ now!
Home Page: https://wiki.libsdl.org/
This is the raw contents of SDL's wiki. You can edit this through GitHub or at https://wiki.libsdl.org/ now!
Home Page: https://wiki.libsdl.org/
Query the display mode to use when a window is visible at fullscreen.
Does this mean:
a. call the function when the window is fullscreen
or
b. the function returns the display mode you get when you set the window to fullscreen
Bad formatting. It seems like markdown but it is really hard to understand. Some command are even wrong.
Here is part of it:
tar xf SDL2-2.0.5.tar.gz tar xf SDL2_image-2.0.1.tar.gz tar xf SDL2_mixer-2.0.1.tar.gz tar xf SDL2_net-2.0.1.tar.gz tar xf SDL2_ttf-2.0.14.tar.gz
ln -s SDL2-2.0.5 SDL2 ln -s SDL2_image-2.0.1 SDL2_image ln -s SDL2_mixer-2.0.1 SDL2_mixer ln -s SDL2_net-2.0.1 SDL2_net ln -s SDL2_ttf-2.0.14 SDL2_ttf ```
<rowstyle="color: #808080;">SDL_LOG_CATEGORY_RESERVED#
appears. Perhaps someone forgot to close the tag? I don't know the syntax of this wiki.
So https://wiki.libsdl.org/Tutorials-TextInput used to have images in its table, like in the Wayback copy:
https://web.archive.org/web/20210119211834/https://wiki.libsdl.org/Tutorials/TextInput
We can link to images from any URL, but we should figure out how to make static images serve from the wiki server itself, so we don't have to rely on other services staying up, and more importantly, so we can have them land in the offline HTML archive, so they're available if someone downloads the HTML to view later without internet access.
This is likely going to need at least small enhancements to ghwikipp, but we can probably mostly cheat on storage by just committing image files to the sdlwiki repository in some way that works for both serving live pages and generating offline mode. We aren't likely to need a lot of images across the entire wiki, and probably all of them will be small.
Tutorial on using audio stream is a broken link
below is the link in the article https://wiki.libsdl.org/Tutorials/AudioStream
SDL_EventFilter and SDL_ThreadFunction pages are missing. There are code examples of how to use these function pointers on the SDL_SetEventFilter
and SDL_CreateThread
pages. The pages link to the pages for the two function pointers but the pages for the function pointers themselves don't exist. I can easily find the typedef
s for these function pointers through grepping the SDL2 headers but it would be nice to have some documentation of them on the wiki.
White and transparent are documented as requiring the same values, but transparency is actually achieved by setting mask to 0 instead.
data=0, mask=1: white
data=0, mask=1: transparent
^
Should be 0
Low priority:
The section of the page with the CategoryAPI, CategoryRender links does not have a header. It seems like if this is a standard part of a page describing a function, it could be given the header "Categories" on every page. Otherwise, without a header, editors can only guess as to what is supposed to be in that section by looking a what's already there.
SDL_assert_data
is deprecated, and thus its wiki page should likely be renamed to the updated SDL_AssertData
. This looks to have already been done for the corresponding structure SDL_AssertState
.
I would have edited the page, but am unsure how to go about moving/renaming the page itself from https://wiki.libsdl.org/SDL_assert_data. What is the best way to go about this? Is there any way to do this through the web UI, or is it only allowed through more traditional git methods?
It would be useful to have the actual number associated with each type listed on the page.
Use case: I am capturing events with SDL_PollEvent, and in the case of an event type that I don't have specific handling for, I am printing the event type. It turns out I am getting a few different types of events that I am not handling, but I have no idea what kinds of events they are.
How do you setup an SDL_EventFilter? Whats void *userdata? What on earth do I do here? This page makes no sense. Is this an unfinished part of SDL2?
I tried looking at the old wiki, which technically did have an additional part, but it was somehow even more confusing.
I even tried looking through the headers and cannot find where SDL_EventFilter is defined, just where it was used.
Maybe I'm still just new to programming, but man this makes so much less sense than anything else I've found on the wiki.
Is this code sample correct? It's getting buttons into local variable buttons
, but then not actually using in the button check — instead just invoking the SDL_BUTTON macro as if it's a function (which it does not appear to be).
(Transferred from libsdl-org/ghwikipp#28 ...)
There's no keycode and scancode in the SDL_KEYCODE and SDLSCANCODE section . Please fix it as soon as possible .
https://github.com/libsdl-org/SDL/wiki/Books
Would appreciate editing the title for Learn C++ By Making Games
book to hide the target="blank"
Would appreciate editing the title for Game Programming in C++: Start to Finish
to also hide the target="blank"
For clarity / helpfulness to anyone seeing these entries, can they be tagged somehow as SDL 1.2
material?
Hi,
I've been working with high-DPI display support in a program which uses the Surfaces drawing subsystem. I found that it's not really specified what occurs in this case, in contrast with the Renderer subsystem.
The first time, in typical program flow, where DPI becomes relevant is SDL_CreateWindow, with its SDL_WINDOW_ALLOW_HIGHDPI flag. The documentation helpfully hints that the size of the window in pixels may be different from its size in screen coordinates - however the only functions for getting pixel size are GL or renderer related, neither of which apply to surfaces. https://wiki.libsdl.org/SDL_CreateWindow
There is no other explicit mention of high-DPI in surface-related documentation. The only hint as to what the behaviour will be is in the docs for SDL_Surface, which say that the .w and .h attributes are measured in pixels. It is then quite natural to infer that the surface returned by SDL_GetWindowSurface maps to physical pixels, not "logical pixels" / screen coordinates.
Unfortunately however, on macOS the behaviour is the opposite: pixels on the window surface actually map to screen coordinates. (Apple calls "points," which are 2x2 blocks of pixels 1. And I've set both the window flag and the Info.plist option.)
I wondered what you thought was best to document this more clearly? I think some notes in SDL_GetWindowSurface and maybe SDL_UpdateWindowSurface which clarify that the window surface maps to screen coordinates, not pixels, would be great. Happy to have a go at this myself.
Thanks
Is it legal to pass NULL for any of the params?
(Transferred from libsdl-org/ghwikipp#27 ...)
On the wiki page for SDL_Keycode, this text is present:
I assume this text was meant to be replaced/filled in via an automated script.
Hello,
Unsure if this is OCD, but I will like to be able to click on the SDL wiki tile on top and go to the homepage. Can you add this?
(Transferring from libsdl-org/ghwikipp#33 ...)
The page doesn't list examples of its usage, yet it is incredibly hard to find useful information in other places. Simply using SDL_SetWindowMinimumSize(window, 800, 600); does not work on an X11 Linux Mint 20.1 Ulyssa.
Worth adding an extensions page for providing links to AT LEAST the SDL maintained extensions.
The "Include"s in this page don't work.
Also the included sections aren't marked in the "source" page.
Do I #include <SDL.h> or <SDL/SDL.h>?
item seems to be broken, as the code example is not rendered (commented out in the source)
There is nothing about SDL_GetVideoSurface in the migration guid. why?
I'm new to SDL. I saw a neat function called SDL_Log, which seemed to do exactly what I wanted.
Until one one fine day I tried SDL_Log("%g", 1.0")
and got a blank line, and was very confused.
After some time spent trying to see whether anyone on the internet had the same issue, I eventually gave up and asked this question on stack overflow, which was answered surprisingly quickly:
https://stackoverflow.com/questions/69216803/sdl-log-doesnt-seem-to-support-g-and-e-specifiers
As a result of this mini-(mis)adventure, I think I can offer several suggestions that would have made using SDL easier.
The suggestions are in two categories, code and docs. Let's start with code, because I have fewer things to say there:
First, perhaps it's worth defining HAVE_VSNPRINTF for sufficiently recent versions of VC++ (maybe 2015 or so?)
Second, perhaps it's worth improving SDL's homegrown vsnprintf so it vaguely conforms to the ISO standard, or at least supports the most common flags. (E.g., it supports %f, but not the uppercase variant %F, and it supports neither %e nor %g, which must be pretty common.)
Okay, that's it for code suggestions. I also have some docs suggestions. I give some specific wording here, but my wording is mostly a strawman proposal; the info is mostly right I think (or hope).
First, for SDL_Log, the wiki page should mention something like
This function delegates to SDL_vsnprintf in order to interpret the format string. See the documentation for that function for more info.
Actually it looks like the SDL wiki doesn't yet document its stdio "wrappers" so that should be fixed too I guess. Once that's done, the documentation for SDL_vsnprintf should probably mostly be a stub that delegates to SDL_snprintf, since the "v" variant is mostly for advanced users. Alternatively, you could do it the other way around, and have the docs for SDL_snprintf delegate to those of SDL_vsnprintf, which is more faithful to how the code itself is structured. Or you could have both functions documented independently; duplication is annoying but probably in this case mostly harmless.
For the sake of concreteness, let's suppose we're documenting SDL_vsnprintf. Then its wiki page should mention something like this:
This function either delegates to the
vsnprintf
provided by your standard library (if SDL thinks your standard library has one that SDL wants to use) , or else uses a version of vsnprintf provided by SDL itself. To determine if your platform has a vsnprintf that SDL knows about and likes/trusts, simply check whether the macro HAVE_VSNPRINTF is defined, eg, by using#ifdef
or by seeing whether your IDE auto-completes the name for you. There is usually no need to care about how SDL_vsnprintf is implemented, but here are some reasons why you might care after all:
- Performance (SDL's version might be faster or slower than other implementations of vsnprintf)
- Reproducible output for floating point numbers. E.g., should
printf (“%.1f\n”,0.25)
be 0.2 or 0.3? Different implementations of printf don't always agree on such corner cases.- Feature support: some standard libraries support non-standard extensions for snprintf (e.g., extra % specifiers), or support features that only became standardized in relatively recent versions of C. (See the documentation for your standard library to see what yours supports.) On the other hand, the one provided by SDL is pretty bare bones. In fact, up until version ABC, it only supported the type specifiers %i and %c; below is a table of all the specifiers as of version CURRENT; the second column is the version of SDL that first supported the given specifier.
https://wiki.libsdl.org/Tutorials/TextInput seems to be missing from the new site.
SDL_HINT_APP_NAME was introduced in SDL 2.0.18 but it doesn't appear in the wiki.
I suspect something is wrong since this version's release notes say:
The SDL wiki documentation and development headers are automatically kept in sync
Just wanted to suggest adding a link to my SDL2 tutorials, which many have found helpful over the years. Sorry for the shameless plug, but perhaps some people might find this useful. Thanks.
(Transferred from libsdl-org/ghwikipp#34 ...)
Hello, the values of SDL_Keycode don't appear on the wiki => https://wiki.libsdl.org/SDL_Keycode.
Have a nice day.
I prefer dark to bright but this is uncomfortably dark.
This depends a lot on people's display capabilities, such as the capacity for contrast and, of course, personal preference.
Options would be very welcome but you could go for a dim compromise rather than what would look to some, myself sadly included, as pitch-black void.
Nevermind. It is what it is. Thank you for making SDL2.
There is no link to the SDL_Window
structure and there is no reason why the page for that structure does not yet exist on the wiki
The article doesn't mention that the destination surface can't be empty, and requires the surface to be filled prior. That took me hours to figure out... so maybe adding it to the Remarks section maybe a good idea.
Anyways Thanks.
it's hard to navigate without side bar and search bar.
would it be possible to add documentation about the new virtual joystick API?
I think it might be helpful (not sure) to implement mobile games with virtual joystick UI, but don't know how to use the API., or which API functions to use.
Several hints are missing, for example all that are opengl-related (except for SDL_HINT_RENDER_OPENGL_SHADERS)
Hi,
“via OpenGL and Direct3D” is only mentioned, so I skipped sdl at first it thinking it doesnt support modern osx. I was wrong.
please mention Apple Metal and Vulkan and possibly other graphics technology. Also Ipad os?
https://wiki.libsdl.org/SDL_Scancode
Links to:
https://wiki.libsdl.org/SDLScancodeLookup
https://wiki.libsdl.org/SDLKeycodeLookup
But those pages appear to not exist yet / didn't make the move?
(edit: just realize this might not be strictly wiki related : although.. if this isn't getting fixed, a note on the wiki page would be useful.)
Using WSL (linux on win10), Debian. when i call SDL_ShowSimpleMessageBox() it locks up.
might be that it locks up cause its buggy. might be locks up cause WSL has some type of stub for this function that fakes displaying it then sits there waiting for my input (which i can't give as there is no graphical output).
How do i detect this dependancy on this function working correctly BEFORE i call it?
and/or can that be added to SDL, so the function can fail successfully.
While SDL_GLContext
is "opaque" it might be a good idea to populate this page with information about how to set it up and use it. For instance, reference SDL_GL_SetAttribute
and the relevent Create
and Delete
functions. I often forget the exact name of functions like SDL_GL_SetAttribute
, so it'd be nice to have them referenced from somewhere like here. It could also be good to have code example using these functions. I wouldn't mind contributing some documentation here if this is a good place for it.
Where is the search box?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.