Simple DirectMedia Layer https://libsdl.org
Find a file
Sam Lantinga 6f199eabb8 Removed SDL_RenderGeometryRawFloat()
After discussion with @ocornut, SDL_RenderGeometryRaw() will take floating point colors and conversion from 8-bit color can happen on the application side.  We can always add an 8-bit color fast path in the future if we need it on handheld platforms.

If you need code to do this in your application, you can use the following:

int SDL_RenderGeometryRaw8BitColor(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices)
{
    int i, retval, isstack;
    const Uint8 *color2 = (const Uint8 *)color;
    SDL_FColor *color3;

    if (num_vertices <= 0) {
        return SDL_InvalidParamError("num_vertices");
    }
    if (!color) {
        return SDL_InvalidParamError("color");
    }

    color3 = (SDL_FColor *)SDL_small_alloc(SDL_FColor, num_vertices, &isstack);
    if (!color3) {
        return -1;
    }

    for (i = 0; i < num_vertices; ++i) {
        color3[i].r = color->r / 255.0f;
        color3[i].g = color->g / 255.0f;
        color3[i].b = color->b / 255.0f;
        color3[i].a = color->a / 255.0f;
        color2 += color_stride;
        color = (const SDL_Color *)color2;
    }

    retval = SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, color3, sizeof(*color3), uv, uv_stride, num_vertices, indices, num_indices, size_indices);

    SDL_small_free(color3, isstack);

    return retval;
}

Fixes https://github.com/libsdl-org/SDL/issues/9009
2024-06-29 00:10:08 -07:00
.github ci: assume all .dmp files in build directy are minidump files 2024-06-28 18:28:31 +02:00
android-project android: add an option to manually pass the context when loading a native library 2024-06-20 10:38:59 -07:00
build-scripts Updated SDL3 scancode list 2024-06-21 22:06:08 -07:00
cmake cmake: check for valid isinf/isinff/isnan/isnanf macros 2024-06-24 22:00:53 +02:00
docs Renamed SDL_HINT_IME_NATIVE_UI to SDL_HINT_IME_IMPLEMENTED_UI 2024-06-28 19:41:37 -07:00
include Removed SDL_RenderGeometryRawFloat() 2024-06-29 00:10:08 -07:00
mingw/pkg-support mingw: add pkg-support files (INSTALL.txt and Makefile) 2024-03-23 21:41:20 +01:00
src Removed SDL_RenderGeometryRawFloat() 2024-06-29 00:10:08 -07:00
test Removed SDL_RenderGeometryRawFloat() 2024-06-29 00:10:08 -07:00
VisualC Replaced test framework random code with SDL random functions 2024-06-24 11:49:15 -07:00
VisualC-GDK Replaced test framework random code with SDL random functions 2024-06-24 11:49:15 -07:00
VisualC-WinRT Replaced test framework random code with SDL random functions 2024-06-24 11:49:15 -07:00
wayland-protocols video: Expose HDR metadata per-window 2024-06-20 15:55:07 -04:00
Xcode Replaced test framework random code with SDL random functions 2024-06-24 11:49:15 -07:00
.clang-format Add 'wl_list_for_each_safe' to the clang-format macro list 2024-03-14 10:22:23 -04:00
.clang-tidy
.editorconfig .editorconfig: Remove excess apostrophe at *.cocci 2024-06-16 09:18:17 -07:00
.gitignore audio: Refer to audio devices to "playback" and "recording". 2024-06-15 01:08:12 -04:00
.wikiheaders-options wikiheaders: bridge wiki Category docs to the headers! 2024-05-16 11:48:23 -04:00
Android.mk Create a functional CMake project using androidbuild.sh 2024-06-18 00:11:44 +02:00
BUGS.txt
CMakeLists.txt cmake: check for valid isinf/isinff/isnan/isnanf macros 2024-06-24 22:00:53 +02:00
CREDITS.md docs: Moved CREDITS and INSTALL to markdown format. 2023-11-29 12:31:27 -05:00
INSTALL.md Updated INSTALL.md 2024-04-10 09:18:42 -04:00
LICENSE.txt Updated copyright for 2024 2024-01-01 13:15:26 -08:00
README-SDL.txt
README.md Tweaking documentation for the SDL 3.0 preview release 2024-03-24 06:16:02 -07:00
WhatsNew.txt audio: Refer to audio devices to "playback" and "recording". 2024-06-15 01:08:12 -04:00

Simple DirectMedia Layer (SDL) Version 3.0

https://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting with README.md. If you are migrating to SDL 3.0 from SDL 2.0, the changes are extensively documented in README-migration.md.

Enjoy!

Sam Lantinga (slouken@libsdl.org)