Skip to content

Commit

Permalink
Sync SDL3 header -> wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
SDLWikiBot committed Sep 14, 2024
1 parent 6ad22e4 commit 0cb511c
Show file tree
Hide file tree
Showing 14 changed files with 523 additions and 6 deletions.
6 changes: 3 additions & 3 deletions SDL3/README/vita.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Notes
-----
* gles1/gles2 support and renderers are disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PVR=ON`
These renderers support 720p and 1080i resolutions. These can be specified with:
`SDL_setenv("VITA_RESOLUTION", "720", 1);` and `SDL_setenv("VITA_RESOLUTION", "1080", 1);`
`SDL_SetHint(SDL_HINT_VITA_RESOLUTION, "720");` and `SDL_SetHint(SDL_HINT_VITA_RESOLUTION, "1080");`
* Desktop GL 1.X and 2.X support and renderers are also disabled by default and also can be enabled with `-DVIDEO_VITA_PVR=ON` as long as gl4es4vita is present in your SDK.
They support the same resolutions as the gles1/gles2 backends and require specifying `SDL_setenv("VITA_PVR_OGL", "1", 1);`
They support the same resolutions as the gles1/gles2 backends and require specifying `SDL_SetHint(SDL_HINT_VITA_PVR_OPENGL, "1");`
anytime before video subsystem initialization.
* gles2 support via PIB is disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PIB=ON`
* By default SDL emits mouse events for touch events on every touchscreen.
Vita has two touchscreens, so it's recommended to use `SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");` and handle touch events instead.
Individual touchscreens can be disabled with:
`SDL_setenv("VITA_DISABLE_TOUCH_FRONT", "1", 1);` and `SDL_setenv("VITA_DISABLE_TOUCH_BACK", "1", 1);`
`SDL_SetHint(SDL_HINT_VITA_ENABLE_FRONT_TOUCH, "0");` and `SDL_SetHint(SDL_HINT_VITA_ENABLE_BACK_TOUCH, "0");`
* Support for L2/R2/R3/R3 buttons, haptic feedback and gamepad led only available on PSTV, or when using external ds4 gamepad on vita.
37 changes: 37 additions & 0 deletions SDL3/SDL_CleanupEnvironment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!)
# SDL_CleanupEnvironment

Cleanup the process environment.

## Header File

Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h)

## Syntax

```c
void SDL_CleanupEnvironment(void);
```
## Remarks
This is called during [SDL_Quit](SDL_Quit)() to free the process
environment. If [SDL_GetEnvironment](SDL_GetEnvironment)() is called
afterwards, it will automatically create a new environment copied from the
C runtime environment.
## Thread Safety
This function is not thread-safe.
## Version
This function is available since SDL 3.0.0.
## See Also
- [SDL_GetEnvironment](SDL_GetEnvironment)
----
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc)
48 changes: 48 additions & 0 deletions SDL3/SDL_CreateEnvironment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!)
# SDL_CreateEnvironment

Create a set of environment variables

## Header File

Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h)

## Syntax

```c
SDL_Environment * SDL_CreateEnvironment(SDL_bool empty);
```
## Function Parameters
| | | |
| -------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [SDL_bool](SDL_bool) | **empty** | [SDL_TRUE](SDL_TRUE) to create an empty environment, [SDL_FALSE](SDL_FALSE) to initialize it from the C runtime environment. |
## Return Value
([SDL_Environment](SDL_Environment) *) Returns a pointer to the new
environment or NULL on failure; call [SDL_GetError](SDL_GetError)() for
more information.
## Thread Safety
If `empty` is [SDL_TRUE](SDL_TRUE), it is safe to call this function from
any thread, otherwise it is safe if no other threads are calling setenv()
or unsetenv()
## Version
This function is available since SDL 3.0.0.
## See Also
- [SDL_GetEnvironmentVariable](SDL_GetEnvironmentVariable)
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables)
- [SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable)
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable)
- [SDL_DestroyEnvironment](SDL_DestroyEnvironment)
----
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc)
37 changes: 37 additions & 0 deletions SDL3/SDL_DestroyEnvironment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!)
# SDL_DestroyEnvironment

Destroy a set of environment variables.

## Header File

Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h)

## Syntax

```c
void SDL_DestroyEnvironment(SDL_Environment *env);
```
## Function Parameters
| | | |
| ------------------------------------ | ------- | --------------------------- |
| [SDL_Environment](SDL_Environment) * | **env** | the environment to destroy. |
## Thread Safety
It is safe to call this function from any thread, as long as the
environment is no longer in use.
## Version
This function is available since SDL 3.0.0.
## See Also
- [SDL_CreateEnvironment](SDL_CreateEnvironment)
----
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc)
33 changes: 33 additions & 0 deletions SDL3/SDL_Environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!)
# SDL_Environment

A thread-safe set of environment variables

## Header File

Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h)

## Syntax

```c
typedef struct SDL_Environment SDL_Environment;
```

## Version

This struct is available since SDL 3.0.0.

## See Also

- [SDL_GetEnvironment](SDL_GetEnvironment)
- [SDL_CleanupEnvironment](SDL_CleanupEnvironment)
- [SDL_CreateEnvironment](SDL_CreateEnvironment)
- [SDL_GetEnvironmentVariable](SDL_GetEnvironmentVariable)
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables)
- [SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable)
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable)
- [SDL_DestroyEnvironment](SDL_DestroyEnvironment)

----
[CategoryAPI](CategoryAPI), [CategoryAPIDatatype](CategoryAPIDatatype), [CategoryStdinc](CategoryStdinc)

48 changes: 48 additions & 0 deletions SDL3/SDL_GetEnvironment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!)
# SDL_GetEnvironment

Get the process environment.

## Header File

Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h)

## Syntax

```c
SDL_Environment * SDL_GetEnvironment(void);
```
## Return Value
([SDL_Environment](SDL_Environment) *) Returns a pointer to the environment
for the process or NULL on failure; call [SDL_GetError](SDL_GetError)() for
more information.
## Remarks
This is initialized at application start and is not affected by setenv()
and unsetenv() calls after that point. Use
[SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable)() and
[SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable)() if you want
to modify this environment.
## Thread Safety
It is safe to call this function from any thread.
## Version
This function is available since SDL 3.0.0.
## See Also
- [SDL_CleanupEnvironment](SDL_CleanupEnvironment)
- [SDL_GetEnvironmentVariable](SDL_GetEnvironmentVariable)
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables)
- [SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable)
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable)
----
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc)
46 changes: 46 additions & 0 deletions SDL3/SDL_GetEnvironmentVariable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!)
# SDL_GetEnvironmentVariable

Get the value of a variable in the environment.

## Header File

Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h)

## Syntax

```c
const char * SDL_GetEnvironmentVariable(SDL_Environment *env, const char *name);
```
## Function Parameters
| | | |
| ------------------------------------ | -------- | -------------------------------- |
| [SDL_Environment](SDL_Environment) * | **env** | the environment to query. |
| const char * | **name** | the name of the variable to get. |
## Return Value
(const char *) Returns a pointer to the value of the variable or NULL if it
can't be found.
## Thread Safety
It is safe to call this function from any thread.
## Version
This function is available since SDL 3.0.0.
## See Also
- [SDL_GetEnvironment](SDL_GetEnvironment)
- [SDL_CreateEnvironment](SDL_CreateEnvironment)
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables)
- [SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable)
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable)
----
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc)
48 changes: 48 additions & 0 deletions SDL3/SDL_GetEnvironmentVariables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!)
# SDL_GetEnvironmentVariables

Get all variables in the environment.

## Header File

Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h)

## Syntax

```c
char ** SDL_GetEnvironmentVariables(SDL_Environment *env);
```
## Function Parameters
| | | |
| ------------------------------------ | ------- | ------------------------- |
| [SDL_Environment](SDL_Environment) * | **env** | the environment to query. |
## Return Value
(char **) Returns a NULL terminated array of pointers to environment
variables in the form "variable=value" or NULL on failure; call
[SDL_GetError](SDL_GetError)() for more information. This is a single
allocation that should be freed with [SDL_free](SDL_free)() when it is no
longer needed.
## Thread Safety
It is safe to call this function from any thread.
## Version
This function is available since SDL 3.0.0.
## See Also
- [SDL_GetEnvironment](SDL_GetEnvironment)
- [SDL_CreateEnvironment](SDL_CreateEnvironment)
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables)
- [SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable)
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable)
----
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc)
49 changes: 49 additions & 0 deletions SDL3/SDL_SetEnvironmentVariable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!)
# SDL_SetEnvironmentVariable

Set the value of a variable in the environment.

## Header File

Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h)

## Syntax

```c
SDL_bool SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, SDL_bool overwrite);
```
## Function Parameters
| | | |
| ------------------------------------ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SDL_Environment](SDL_Environment) * | **env** | the environment to modify. |
| const char * | **name** | the name of the variable to set. |
| const char * | **value** | the value of the variable to set. |
| [SDL_bool](SDL_bool) | **overwrite** | [SDL_TRUE](SDL_TRUE) to overwrite the variable if it exists, [SDL_FALSE](SDL_FALSE) to return success without setting the variable if it already exists. |
## Return Value
([SDL_bool](SDL_bool)) Returns [SDL_TRUE](SDL_TRUE) on success or
[SDL_FALSE](SDL_FALSE) on failure; call [SDL_GetError](SDL_GetError)() for
more information.
## Thread Safety
It is safe to call this function from any thread.
## Version
This function is available since SDL 3.0.0.
## See Also
- [SDL_GetEnvironment](SDL_GetEnvironment)
- [SDL_CreateEnvironment](SDL_CreateEnvironment)
- [SDL_GetEnvironmentVariable](SDL_GetEnvironmentVariable)
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables)
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable)
----
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc)
Loading

0 comments on commit 0cb511c

Please sign in to comment.