Giter VIP home page Giter VIP logo

sdlwiki's People

Contributors

100backslash001 avatar blaisemccourtney avatar ccawley2011 avatar cheese3660 avatar danielgibson avatar dgameboy101b avatar dustdfg avatar e-l-i-j-a-h avatar erquint avatar ftzpetruska avatar hazeycode avatar icculus avatar karlosrovira avatar madebr avatar maruhiro-ver0 avatar mistericy avatar nhurde avatar nicholaus04 avatar nicolasperdu avatar paralogismos avatar pedro-w avatar pennrobotics avatar rohlem avatar sdlwikibot avatar sechshelme avatar slouken avatar sulix avatar susko3 avatar systembuilding avatar weslord avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdlwiki's Issues

Feedback on page SDL_GetWindowDisplayMode

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

Feedback on page Android

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 ```

Feedback on page SDL_LOG_CATEGORY

<rowstyle="color: #808080;">SDL_LOG_CATEGORY_RESERVED# appears. Perhaps someone forgot to close the tag? I don't know the syntax of this wiki.

Lost images...

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.

Feedback on page CategoryVulkan

On Firefox Beta, 88.0b9, could be someone on my end, an addon or something, but doesn't seem immediately apparent what if so.
Text goes off screen, no word wrap.

image

Document SDL_EventFilter and SDL_ThreadFunction

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 typedefs for these function pointers through grepping the SDL2 headers but it would be nice to have some documentation of them on the wiki.

Feedback on page SDL_CreateCursor

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

Feedback on page SDL_GetRenderDrawColor

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.

Feedback on page SDL_assert_data

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?

Feedback on page SDL_EventType

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.

Feedback on page SDL_SetEventFilter

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.

Feedback on page SDL_GetMouseState

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).

request to tweak book urls in wiki

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?

Documenting behaviour of surfaces on high-DPI displays

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

Musings and whining about SDL_Log floating point support

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:

  1. Performance (SDL's version might be faster or slower than other implementations of vsnprintf)
  2. 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.
  3. 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.

Feedback on page Tutorials

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.

Background may be too dark

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.

Feedback on page SDL_CreateWindow

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

Feedback on page SDL_BlitSurface

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.

Feedback on page CategoryJoystick

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.

SDL_ShowSimpleMessageBox on WSL

(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.

Feedback on page SDL_GLContext

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.