Commit Graph

42 Commits

Author SHA1 Message Date
Sam Lantinga 2ba76dbe80 Simplified SDL_Surface
SDL_Surface has been simplified and internal details are no longer in the public structure.

The `format` member of SDL_Surface is now an enumerated pixel format value. You can get the full details of the pixel format by calling `SDL_GetPixelFormatDetails(surface->format)`. You can get the palette associated with the surface by calling SDL_GetSurfacePalette(). You can get the clip rectangle by calling SDL_GetSurfaceClipRect().

SDL_PixelFormat has been renamed SDL_PixelFormatDetails and just describes the pixel format, it does not include a palette for indexed pixel types.

SDL_PixelFormatEnum has been renamed SDL_PixelFormat and is used instead of Uint32 for API functions that refer to pixel format by enumerated value.

SDL_MapRGB(), SDL_MapRGBA(), SDL_GetRGB(), and SDL_GetRGBA() take an optional palette parameter for indexed color lookups.
2024-07-10 00:48:18 -07:00
Sam Lantinga 0dd579d40d Removed SDL_Keysym 2024-06-21 22:06:08 -07:00
Sam Lantinga 17520c2e6e Removed SDL_RendererFlags
The flags parameter has been removed from SDL_CreateRenderer() and SDL_RENDERER_PRESENTVSYNC has been replaced with SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER during window creation and SDL_PROP_RENDERER_VSYNC_NUMBER after renderer creation.

SDL_SetRenderVSync() now takes additional values besides 0 and 1.

The maximum texture size has been removed from SDL_RendererInfo, replaced with SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER.
2024-05-13 15:06:11 -07:00
Ozkan Sezer 205c417f74 testgles2.c, testgles2_sdf.c: adjust for new SDL_PLATFORM_WINDOWS meaning. 2024-01-24 21:20:50 +03:00
Anonymous Maarten 31d133db40
Define SDL_PLATFORM_* macros instead of underscored ones (#8875) 2024-01-24 01:40:51 +00:00
Sam Lantinga 5b3ee51c6c Updated copyright for 2024 2024-01-01 13:15:26 -08:00
Sylvain d8600f717e Pointer as bool (libsdl-org#7214) 2023-11-09 14:18:36 -08:00
Anonymous Maarten b4291412a4 tests: build tests with C90 standard
C90 mode is disabled for:
- testautomation: use of isnan/isfinite
- testlock: use of kill
- testvulkan: use of c++ style strings in vulkan.h
2023-05-27 01:49:07 +02:00
Ozkan Sezer 5c019bc97e style fixes for SDL_PROC macros. 2023-05-19 14:10:02 +03:00
Sylvain c101e719fd testprogram: let main() return normally, don't exit for platform (eg Android) where there is some cleanup afterward. 2023-04-12 11:37:26 +02:00
Anonymous Maarten b6ae281e97 Use #ifdef/#ifndef instead of #if defined/#if \!defined 2023-03-30 21:35:01 +00:00
Anonymous Maarten 3472dc11d6
Fix uses of undefined macro identifiers (-Wundef)
* Fix -Wundef warnings due to use of unguarded SDL_LOADSO_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WINDOWS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_ANDROID

* Fix -Wundef warnings due to use of unguarded SDL_LOADSO_DUMMY

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_COCOA

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_UIKIT

* Fix -Wundef warnings due to use of unguarded SDL_TIMERS_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_EVENTS_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_TIMER_DUMMY

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_SENSOR_DISABLED

* Fix -Wundef warnings due to use of unguarded __ANDROID__

* Fix -Wundef warnings due to use of unguarded __IOS__

* Fix -Wundef warnings due to use of unguarded EMULATE_CAS

* Fix -Wundef warnings due to use of unguarded SDL_ATOMIC_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_THREADS_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_SNDIO

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_NETBSD

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_WASAPI

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DSOUND

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_HAIKU

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_COREAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_AAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_OPENSLES

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_ANDROID

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PS2

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_VITA

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_N3DS

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_NEON_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_ALTIVEC_BLITTERS

* Fix -Wundef warnings due to use of unguarded __VITA__

* Fix -Wundef warnings due to use of unguarded __3DS__

* Fix -Wundef warnings due to use of unguarded SDL_DYNAPI_PROC_NO_VARARGS

* Fix -Wundef warnings due to use of unguarded __APPLE__

* Fix -Wundef warnings due to use of unguarded __WINRT__

* Fix -Wundef warnings due to use of unguarded SDL_HIDAPI_DISABLED

* Fix -Wundef warnings due to use of unguarded __TVOS__

* Fix -Wundef warnings due to use of unguarded HAVE_DRIVER_BACKEND

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_XINPUT

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_WGI

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_DINPUT

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_MFI

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_PS2

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_PSP

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_VITA

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_N3DS

* Fix -Wundef warnings due to use of unguarded __MACOS__

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WINRT

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RPI

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PVR_OGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VIVANTE

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D11

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D12

* Fix -Wundef warnings due to use of unguarded SDL_RENDER_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_METAL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_PS2

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_VITA_GXM

* Fix -Wundef warnings due to use of unguarded SDL_ARM_SIMD_BLITTERS

* Fix -Wundef warnings due to use of unguarded SDL_ARM_NEON_BLITTERS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_HAIKU

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_PS2

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VITA

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_N3DS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_KMSDRM

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RISCOS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_NGAGE

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_METAL

* Fix -Wundef warnings due to use of unguarded SDL_LSX_INTRINSICS

* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_NP_H

* Fix -Wundef warnings due to use of unguarded __RISCOS__

* Fix -Wundef warnings due to use of unguarded FAKE_RECURSIVE_MUTEX

* Fix -Wundef warnings due to use of unguarded USE_POSIX_SPAWN

* textureData is only needed when SDL is built with YUV support

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_ALSA

* Fix -Wundef warnings due to use of unguarded SDL_SSE3_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE4_2_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE4_1_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_AVX512F_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE2_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_AVX_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_AVX2_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_MMX_INTRINSICS

* Fix -Wundef warnings due to use of unguarded HAVE_CLOCK_GETTIME

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DISK

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DUMMY

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_DUMMY

* Fix -Wundef warnings due to use of unguarded HAVE_GCC_ATOMICS

* Fix -Wundef warnings due to use of unguarded HAVE_GCC_SYNC_LOCK_TEST_AND_SET

* Fix -Wundef warnings due to use of unguarded SDL_USE_LIBDBUS

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_JACK

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_VIRTUAL

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_LINUX

* Fix -Wundef warnings due to use of unguarded HAVE_LIBC

* Fix -Wundef warnings due to disabling SDL_LIBC

* Fix -Wundef warnings due to use of unguarded HAVE_PLATFORM_BACKEND

* Fix -Wundef warnings due to use of unguarded DEBUG

* Fix -Wundef warnings due to use of unguarded HAVE_LINUX_INPUT_H

* Fix -Werror=unused-variable when building with SDL_LIBC=OFF

* Fix -Wundef warnings due to use of unguqrded SDL_USE_LIBUDEV

* Use SDL alloc functions in libusb/hid.c

* Fix -Wundef warnings due to use of unguarded HAVE_LIBUDEV_H

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VULKAN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_OFFSCREEN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_OGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_GLX

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES2

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_OGL_ES2

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_OSS

* Remove SDL_AUDIO_DRIVER_SUNAUDIO reference since it is never set

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PIPEWIRE

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PULSEAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XCURSOR

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XDBE

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XFIXES

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XINPUT2

* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH

* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XRANDR

* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XSCRNSAVER

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XSHAPE

* Don't call XShape functions when XShape is diabled

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WAYLAND

* Fix -Wundef warnings due to use of unuarded SDL_VIDEO_DRIVER_X11

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RISCOS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_EGL

* Disable array when compiled with SDL_EVENTS=OFF

* Fix -Wundef warnings due to use of unguarded SDL_INPUT_LINUXEV

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_WINDOWS

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PS2

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PSP

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_VITA

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_N3DS

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_STDCPP

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_NGAGE

* Fix -Wundef warnings due to use of unguarded __WINDOWS__

* Fix -Wundef warnings due to use of unguarded __WINGDK__

* Fix -Wundef warnings due to use of unguarded __ANDROID__

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_GENERIC_COND_SUFFIX

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PIB

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PVR

* Fix -Wundef warnings due to use of unguarded SDL_FILE_DISABLED

* Fix -Wundef warnings due to use of unguarded __XBOXONE__

* Fix -Wundef warnings due to use of unguarded __XBOXSERIES__

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_WGL

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_QNX

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DISK

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_QNX

* Fix -Wundef warnings due to use of unguarded DEBUG_RAZOR

* Fix -Wundef warnings due to use of unguarded WINAPI_FAMILY_PHONE_APP

* Fix -Wundef warnings due to use of unguarded SDL_MAC_NO_SANDBOX

* Fix -Wundef warnings due to use of unguarded __(IPHONE|APPLETV|MAC)_OS_VERSION_MAX_ALLOWED

* Fix C4090 warning ('function': different 'const' qualifiers)

* ci: use -isystem for include dirs of pspdev toolchain

* cmake: add -Wundef option

* Fix remaining -Wundef warnings due to use of unguarded SDL_VIDEO_VULKAN and SDL_VIDEO_METAL

* Fix -Wundef warnings due to use of unguarded __MACOS__

* DEBUG_CONVERT is guaranteed to be defined in src/audio/SDL_audiocvt.c

* Fix -Wundef warnings due to use of unguarded HAVE_NANOSLEEP

* Fix -Wundef warnings due to use of unguarded HAVE_DXGI_H

* Fix -Wundef warnings due to use of unguarded HAVE_LINUX_INPUT_H

* fix SDL_VIDEO_DRIVER_WAYLAND

* fix SDL_VIDEO_DRIVER_X11

* Fix -Wundef warnings due to use of unguarded HAVE_MMDEVICEAPI_H

* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_SETNAME_NP

* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_SET_NAME_NP

* Fix -Wundef warnings due to use of unguarded HAVE_SETJMP

* Fix -Wundef warnings due to use of unguarded HAVE_SIGNAL_H

* Fix -Wundef warnings due to use of unguarded HAVE_TPCSHRD_H

* Fix -Wundef warnings due to use of unguarded MACOSX_COREAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_DINPUT

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_IOKIT

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_XINPUT

* Fix -Wundef warnings due to use of unguarded SDL_IPHONE_KEYBOARD

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_RAWINPUT

* Fix -Wundef warnings due to use of unguarded SDL_POWER_ANDROID

* Fix -Wundef warnings due to use of unguarded SDL_POWER_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_POWER_HAIKU

* Fix -Wundef warnings due to use of unguarded SDL_POWER_LINUX

* Fix -Wundef warnings due to use of unguarded SDL_POWER_MACOSX

* Fix -Wundef warnings due to use of unguarded SDL_POWER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_POWER_UIKIT

* Fix -Wundef warnings due to use of unguarded SDL_POWER_VITA

* Fix -Wundef warnings due to use of unguarded SDL_POWER_WINDOWS

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD_RECURSIVE_MUTEX

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VIVANTE_VDK

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WAYLAND

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_CGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_EGL

* Fix -Wundef warnings due to use of unguarded __MACOS__

* Fix -Wundef warnings due to use of unguarded __OpenBSD__

* Fix -Wundef warnings due to use of unguarded __FreeBSD__

* Fix -Wundef warnings due to use of unguarded __MWERKS__

* Fix -Wundef warnings due to use of unguarded __WIN32__

* Fix -Wundef warnings due to use of unguarded SDL_IPHONE_LAUNCHSCREEN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES2

* Remove unused HAVE_CONST, HAVE_INLINE and HAVE_VOLATILE

* Revert "Use SDL alloc functions in libusb/hid.c"

This reverts commit 847c64b00d.

* Handle FAKE_RECURSIVE_MUTEX in similar way as SDL2

* Don't use defined in macro
2023-03-29 21:49:01 +00:00
capehill b8c88cc584 testgles2_sdf: Call correct function to get shader info log 2023-03-26 22:29:49 +02:00
Anonymous Maarten 4a6528e3f0 testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00
Sylvain 16bb6a0b3d Fix warnings about static function and prototype 2023-03-08 11:41:18 +01:00
Anonymous Maarten 08bcee8570 test: don't use wiki urls for documentation comments
Also make consistent use of \ as documentation escape character.
2023-02-02 00:49:09 +01:00
Sam Lantinga 6b137579ea Windows default to fullscreen desktop mode if they don't pick an explicit video mode
Rather than iterating over display modes using an index, there is a new function SDL_GetFullscreenDisplayModes() to get the list of available fullscreen modes on a display.
{
    SDL_DisplayID display = SDL_GetPrimaryDisplay();
    int num_modes = 0;
    SDL_DisplayMode **modes = SDL_GetFullscreenDisplayModes(display, &num_modes);
    if (modes) {
        for (i = 0; i < num_modes; ++i) {
            SDL_DisplayMode *mode = modes[i];
            SDL_Log("Display %" SDL_PRIu32 " mode %d:  %dx%d@%gHz, %d%% scale\n",
                    display, i, mode->pixel_w, mode->pixel_h, mode->refresh_rate, (int)(mode->display_scale * 100.0f));
        }
        SDL_free(modes);
    }
}

SDL_GetDesktopDisplayMode() and SDL_GetCurrentDisplayMode() return pointers to display modes rather than filling in application memory.

Windows now have an explicit fullscreen mode that is set, using SDL_SetWindowFullscreenMode(). The fullscreen mode for a window can be queried with SDL_GetWindowFullscreenMode(), which returns a pointer to the mode, or NULL if the window will be fullscreen desktop. SDL_SetWindowFullscreen() just takes a boolean value, setting the correct fullscreen state based on the selected mode.
2023-02-01 12:05:25 -08:00
Sam Lantinga 22c69bccdf Displays are now referenced by instance ID instead of index 2023-01-29 19:25:15 -08:00
Sasha Szpakowski 90795291e4 Remove SDL_GL/Metal/Vulkan_GetDrawableSize().
SDL_GetWindowSizeInPixels supersedes those functions.
2023-01-29 11:20:33 -08:00
Sam Lantinga 7b50bae524 Renamed SDL events for clarity
Fixes https://github.com/libsdl-org/SDL/issues/6877
2023-01-24 07:26:48 -08:00
Sam Lantinga e9b86eebf3 Functions which return function pointers now return SDL_FunctionPointer instead of void*
This fixes the clang warning "Cast between pointer-to-function and pointer-to-object is an extension"

You can define SDL_FUNCTION_POINTER_IS_VOID_POINTER in your project to restore the previous behavior.

Fixes https://github.com/libsdl-org/SDL/issues/2866
2023-01-09 15:46:21 -08:00
Sam Lantinga fde78d12f2 Updated copyright for 2023 2023-01-09 09:41:41 -08:00
Sam Lantinga 63724c113b Removed the vi format comments from the source
Vim users can use the [editorconfig plugin](https://github.com/editorconfig/editorconfig-vim) to automatically set tab spacing for the SDL coding style.

Fixes https://github.com/libsdl-org/SDL/issues/6903
2022-12-26 11:17:23 -08:00
Sam Lantinga 909b513c33 Made SDL_WINDOWEVENT_* and SDL_DISPLAYEVENT_* first class event types
Fixes https://github.com/libsdl-org/SDL/issues/6772
2022-12-22 07:38:13 -08:00
Daniel Gibson 22e22ba196 Add SDL_main.h includes to tests
.. including cmake/test/*.c, whatever that does

(this is needed now because SDL.h doesn't include SDL_main.h anymore)
2022-12-15 08:01:01 -08:00
Sam Lantinga 8121bbd083 Convert ticks to 64-bit, added nanosecond precision to the API
Fixes https://github.com/libsdl-org/SDL/issues/5512
Fixes https://github.com/libsdl-org/SDL/issues/6731
2022-12-02 12:37:41 -08:00
Sam Lantinga 5750bcb174
Update for SDL3 coding style (#6717)
I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base.

In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted.

The script I ran for the src directory is added as build-scripts/clang-format-src.sh

This fixes:
#6592
#6593
#6594
2022-11-30 12:51:59 -08:00
Anonymous Maarten e26e893daf
test: build + fix test/testgles2_sdf.c 2022-11-29 22:43:46 +01:00
Sylvain Becker fc4fc5295f
Remove depth field from SDL_CreateRGBSurfaceWithFormat and SDL_Create… (#6685)
* Remove depth field from SDL_CreateRGBSurfaceWithFormat and SDL_CreateRGBSurfaceWithFormatFrom
* Removed unused 'flags' parameter from SDL_CreateRGBSurface and SDL_CreateRGBSurfaceWithFormat
* Removed unused 'flags' parameter from SDL_ConvertSurface and SDL_ConvertSurfaceFormat
2022-11-29 09:40:09 -08:00
Sylvain Becker 6a2200823c
Cleanup add brace (#6545)
* Add braces after if conditions

* More add braces after if conditions

* Add braces after while() conditions

* Fix compilation because of macro being modified

* Add braces to for loop

* Add braces after if/goto

* Move comments up

* Remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements after merge

* Fix inconsistent patterns are xxx == NULL vs !xxx

* More "{}" for "if() break;"  and "if() continue;"

* More "{}" after if() short statement

* More "{}" after "if () return;" statement

* More fix inconsistent patterns are xxx == NULL vs !xxx

* Revert some modificaion on SDL_RLEaccel.c

* SDL_RLEaccel: no short statement

* Cleanup 'if' where the bracket is in a new line

* Cleanup 'while' where the bracket is in a new line

* Cleanup 'for' where the bracket is in a new line

* Cleanup 'else' where the bracket is in a new line
2022-11-27 08:38:43 -08:00
Sam Lantinga 0a48abc860 Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>`
I ran this script in the include directory:
```sh
sed -i '' -e 's,#include "\(SDL.*\)",#include <SDL3/\1>,' *.h
```

I ran this script in the src directory:
```sh
for i in ../include/SDL3/SDL*.h
do hdr=$(basename $i)
   if [ x"$(echo $hdr | egrep 'SDL_main|SDL_name|SDL_test|SDL_syswm|SDL_opengl|SDL_egl|SDL_vulkan')" != x ]; then
        find . -type f -exec sed -i '' -e 's,#include "\('$hdr'\)",#include <SDL3/\1>,' {} \;
    else
        find . -type f -exec sed -i '' -e '/#include "'$hdr'"/d' {} \;
    fi
done
```

Fixes https://github.com/libsdl-org/SDL/issues/6575
2022-11-26 22:15:18 -08:00
Sam Lantinga 63f307fe1f Remove SDL_config.h from the public headers
The SDL headers are no longer dependent on the build configuration.

Fixes https://github.com/libsdl-org/SDL/issues/6643 and https://github.com/libsdl-org/SDL/issues/6641
2022-11-26 04:48:36 -08:00
Sam Lantinga cc1f9eb983 Use Apple's nomenclature for macOS and iOS
Fixes https://github.com/libsdl-org/SDL/issues/6621
2022-11-25 16:00:06 -08:00
Ozkan Sezer e89a1f9157 removed NaCL support. 2022-11-22 20:10:47 +03:00
Ozkan Sezer 63243eb3a5 removed pandora support 2022-11-22 18:50:00 +03:00
Sylvain 71f2864b3a
Fix usage of sizeof() in test/testgles*.c files 2022-11-17 14:55:49 +01:00
Simon McVittie 76a7b629bf test: Add some common code to load test resources
As well as reducing duplication, this lets the tests load their resources
from the SDL_GetBasePath() on platforms that support it, which is useful
if the tests are compiled along with the rest of SDL and installed below
/usr as manual tests, similar to GNOME's installed-tests convention.

Thanks to Ozkan Sezer for the OS/2 build glue.

Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 18:17:55 -07:00
Sam Lantinga 120c76c84b Updated copyright for 2022 2022-01-03 09:40:21 -08:00
Sylvain f1582f549b Fix comment 2021-11-22 08:38:46 -08:00
Sylvain d31251b014 use SDL's functions version inplace of libc version 2021-11-22 08:38:46 -08:00
Sylvain Becker 4fbb9f31ab Fix declarations after statement 2021-01-24 00:51:24 -05:00
Sylvain Becker 0e7d435f13 Add basic testgles2_sdf program to demonstrate sign distance field with opengles2 2021-01-24 00:51:24 -05:00