MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
Loading...
Searching...
No Matches
mx_sdl.h File Reference

SDL2 module C API — function declarations for SDL2 bindings exported to MXVM programs. More...

#include <stdint.h>
Include dependency graph for mx_sdl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Core SDL functions
int64_t init (void)
 Initialize SDL2 subsystems.
void quit (void)
 Shut down SDL2 and release all resources.
Window management
int64_t create_window (const char *title, int64_t x, int64_t y, int64_t w, int64_t h, int64_t flags)
 Create an SDL window.
void destroy_window (int64_t window_id)
 Destroy a window by ID.
void set_window_title (int64_t window_id, const char *title)
 Set the title of a window.
void set_window_position (int64_t window_id, int64_t x, int64_t y)
 Set the position of a window.
void get_window_size (int64_t window_id, int64_t *w, int64_t *h)
 Get the size of a window.
void set_window_fullscreen (int64_t window_id, int64_t fullscreen)
 Set or clear fullscreen mode for a window.
void set_window_icon (uint64_t window_id, const char *path)
 Set the window icon from an image file.
Renderer management
int64_t create_renderer (int64_t window_id, int64_t index, int64_t flags)
 Create a hardware-accelerated renderer for a window.
void destroy_renderer (int64_t renderer_id)
 Destroy a renderer by ID.
void set_draw_color (int64_t renderer_id, int64_t r, int64_t g, int64_t b, int64_t a)
 Set the current draw color (RGBA).
void clear (int64_t renderer_id)
 Clear the renderer with the current draw color.
void present (int64_t renderer_id)
 Present the renderer's back buffer to the screen.
void get_renderer_output_size (int64_t renderer_id, int64_t *w, int64_t *h)
 Get the renderer output size.
Drawing functions
void draw_point (int64_t renderer_id, int64_t x, int64_t y)
 Draw a single pixel.
void draw_line (int64_t renderer_id, int64_t x1, int64_t y1, int64_t x2, int64_t y2)
 Draw a line between two points.
void draw_rect (int64_t renderer_id, int64_t x, int64_t y, int64_t w, int64_t h)
 Draw a rectangle outline.
void fill_rect (int64_t renderer_id, int64_t x, int64_t y, int64_t w, int64_t h)
 Draw a filled rectangle.
Event handling
int64_t poll_event (void)
 Poll for a pending SDL event.
int64_t get_event_type (void)
 Get the type of the last polled event.
int64_t get_key_code (void)
 Get the key code from the last keyboard event.
int64_t get_mouse_x (void)
 Get the mouse x coordinate from the last mouse event.
int64_t get_mouse_y (void)
 Get the mouse y coordinate from the last mouse event.
int64_t get_mouse_button (void)
 Get the mouse button from the last mouse event.
Surface functions
int64_t create_rgb_surface (int64_t width, int64_t height, int64_t depth)
 Create an RGB surface.
void free_surface (int64_t surf_ptr)
 Free a surface.
int64_t blit_surface (int64_t src_ptr, int64_t dst_ptr, int64_t x, int64_t y)
 Blit a source surface onto a destination surface at (x, y).
Mouse state functions
int64_t get_mouse_state (int64_t *x, int64_t *y)
 Get the current mouse state with pointer coordinates.
int64_t get_relative_mouse_state (int64_t *x, int64_t *y)
 Get the relative mouse state.
int64_t get_mouse_buttons (void)
 Get the current mouse button bitmask (pointerless variant).
int64_t get_relative_mouse_x (void)
 Get the relative mouse x delta (pointerless variant).
int64_t get_relative_mouse_y (void)
 Get the relative mouse y delta (pointerless variant).
int64_t get_relative_mouse_buttons (void)
 Get the relative mouse button bitmask (pointerless variant).
Keyboard state functions
int64_t get_keyboard_state (int64_t *numkeys)
 Get the keyboard state array.
int64_t is_key_pressed (int64_t scancode)
 Check whether a specific key is currently pressed.
int64_t get_num_keys (void)
 Get the total number of keyboard keys.
Clipboard functions
void set_clipboard_text (const char *text)
 Set the system clipboard text.
const char * get_clipboard_text (void)
 Get the system clipboard text.
Cursor functions
void show_cursor (int64_t show)
 Show or hide the mouse cursor.
Texture functions
int64_t create_texture (int64_t renderer_id, int64_t format, int64_t access, int64_t w, int64_t h)
 Create a blank texture.
void destroy_texture (int64_t texture_id)
 Destroy a texture.
int64_t load_texture (int64_t renderer_id, const char *file_path)
 Load a texture from an image file.
int64_t load_texture_color_key (int64_t renderer_id, const char *file_path)
 Load a BMP file as a texture with black color-key transparency.
int64_t load_texture_color_key_rgb (int64_t renderer_id, const char *file_path, int64_t r, int64_t g, int64_t b)
 Load a BMP file as a texture with a custom RGB color-key transparency.
void render_texture (int64_t renderer_id, int64_t texture_id, int64_t src_x, int64_t src_y, int64_t src_w, int64_t src_h, int64_t dst_x, int64_t dst_y, int64_t dst_w, int64_t dst_h)
 Render a portion of a texture to a destination rectangle.
Timing functions
int64_t get_ticks (void)
 Get the number of milliseconds since SDL initialization.
void delay (int64_t ms)
 Pause execution for the given number of milliseconds.
Audio functions
int64_t open_audio (int64_t freq, int64_t format, int64_t channels, int64_t samples)
 Open the audio device.
void close_audio (void)
 Close the audio device.
void pause_audio (int64_t pause_on)
 Pause or unpause audio playback.
int64_t load_wav (const char *file_path, int64_t *audio_buf, int64_t *audio_len, int64_t *audio_spec)
 Load a WAV file.
void free_wav (int64_t audio_buf)
 Free a loaded WAV buffer.
int64_t queue_audio (const void *data, int64_t len)
 Queue audio data for playback.
int64_t get_queued_audio_size (void)
 Get the number of bytes of queued audio.
void clear_queued_audio (void)
 Clear all queued audio data.
Texture pixel access
int64_t update_texture (int64_t texture_id, const void *pixels, int64_t pitch)
 Update a texture with new pixel data.
int64_t lock_texture (int64_t texture_id, void **pixels, int64_t *pitch)
 Lock a texture for direct pixel access.
void unlock_texture (int64_t texture_id)
 Unlock a previously locked texture.
Text rendering (SDL_ttf)
int64_t init_text (void)
 Initialize the SDL_ttf text rendering subsystem.
void quit_text (void)
 Shut down the SDL_ttf subsystem.
int64_t load_font (const char *file, int64_t ptsize)
 Load a TrueType font.
void draw_text (int64_t renderer_id, int64_t font_id, const char *text, int64_t x, int64_t y, int64_t r, int64_t g, int64_t b, int64_t a)
 Draw text with a font at the given position and color.
Render targets
int64_t create_render_target (int64_t renderer_id, int64_t width, int64_t height)
 Create an off-screen render target texture.
void set_render_target (int64_t renderer_id, int64_t target_id)
 Set the current render target (0 to render to the window).
void destroy_render_target (int64_t target_id)
 Destroy a render target texture.
void present_scaled (int64_t renderer_id, int64_t target_id, int64_t scale_width, int64_t scale_height)
 Present a render target scaled to the given dimensions.
void present_stretched (int64_t renderer_id, int64_t target_id, int64_t dst_width, int64_t dst_height)
 Present a render target stretched to the given dimensions.

Detailed Description

SDL2 module C API — function declarations for SDL2 bindings exported to MXVM programs.

Author
Jared Bruni

Definition in file mx_sdl.h.

Function Documentation

◆ blit_surface()

int64_t blit_surface ( int64_t src_ptr,
int64_t dst_ptr,
int64_t x,
int64_t y )

Blit a source surface onto a destination surface at (x, y).

Definition at line 684 of file sdl.c.

Referenced by mxvm_sdl_blit_surface().

◆ clear()

void clear ( int64_t renderer_id)

Clear the renderer with the current draw color.

Definition at line 212 of file sdl.c.

References g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_clear().

◆ clear_queued_audio()

void clear_queued_audio ( void )

Clear all queued audio data.

Definition at line 510 of file sdl.c.

Referenced by mxvm_sdl_clear_queued_audio().

◆ close_audio()

void close_audio ( void )

Close the audio device.

Definition at line 470 of file sdl.c.

Referenced by mxvm_sdl_close_audio().

◆ create_render_target()

int64_t create_render_target ( int64_t renderer_id,
int64_t width,
int64_t height )

Create an off-screen render target texture.

Definition at line 146 of file sdl.c.

References g_render_target_count, g_renderer_count, g_renderers, g_target_heights, and g_target_widths.

Referenced by mxvm_sdl_create_render_target().

◆ create_renderer()

int64_t create_renderer ( int64_t window_id,
int64_t index,
int64_t flags )

Create a hardware-accelerated renderer for a window.

Parameters
window_idTarget window
indexRendering driver index (-1 for first available)
flagsSDL renderer flags
Returns
Renderer ID handle

Definition at line 121 of file sdl.c.

References g_renderer_count, g_renderers, g_window_count, and g_windows.

Referenced by mxvm_sdl_create_renderer().

◆ create_rgb_surface()

int64_t create_rgb_surface ( int64_t width,
int64_t height,
int64_t depth )

Create an RGB surface.

Returns
Surface pointer cast to int64_t

Definition at line 663 of file sdl.c.

Referenced by mxvm_sdl_create_rgb_surface().

◆ create_texture()

int64_t create_texture ( int64_t renderer_id,
int64_t format,
int64_t access,
int64_t w,
int64_t h )

Create a blank texture.

Parameters
renderer_idRenderer handle
formatPixel format
accessTexture access pattern (static, streaming, target)
wWidth
hHeight
Returns
Texture ID handle

Definition at line 268 of file sdl.c.

References g_renderer_count, g_renderers, g_texture_count, and g_textures.

Referenced by mxvm_sdl_create_texture().

◆ create_window()

int64_t create_window ( const char * title,
int64_t x,
int64_t y,
int64_t w,
int64_t h,
int64_t flags )

Create an SDL window.

Parameters
titleWindow title
xInitial x position
yInitial y position
wWidth in pixels
hHeight in pixels
flagsSDL window flags
Returns
Window ID handle

Definition at line 86 of file sdl.c.

References g_window_count, and g_windows.

Referenced by mxvm_sdl_create_window().

◆ delay()

void delay ( int64_t ms)

Pause execution for the given number of milliseconds.

Definition at line 454 of file sdl.c.

Referenced by mxvm_sdl_delay().

◆ destroy_render_target()

void destroy_render_target ( int64_t target_id)

Destroy a render target texture.

Definition at line 178 of file sdl.c.

Referenced by mxvm_sdl_destroy_render_target().

◆ destroy_renderer()

void destroy_renderer ( int64_t renderer_id)

Destroy a renderer by ID.

Definition at line 139 of file sdl.c.

References g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_destroy_renderer().

◆ destroy_texture()

void destroy_texture ( int64_t texture_id)

Destroy a texture.

Definition at line 286 of file sdl.c.

References g_texture_count, and g_textures.

Referenced by mxvm_sdl_destroy_texture().

◆ destroy_window()

void destroy_window ( int64_t window_id)

Destroy a window by ID.

Definition at line 106 of file sdl.c.

References g_window_count, and g_windows.

Referenced by mxvm_sdl_destroy_window().

◆ draw_line()

void draw_line ( int64_t renderer_id,
int64_t x1,
int64_t y1,
int64_t x2,
int64_t y2 )

Draw a line between two points.

Definition at line 248 of file sdl.c.

References g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_draw_line().

◆ draw_point()

void draw_point ( int64_t renderer_id,
int64_t x,
int64_t y )

Draw a single pixel.

Definition at line 242 of file sdl.c.

References g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_draw_point().

◆ draw_rect()

void draw_rect ( int64_t renderer_id,
int64_t x,
int64_t y,
int64_t w,
int64_t h )

Draw a rectangle outline.

Definition at line 254 of file sdl.c.

References g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_draw_rect().

◆ draw_text()

void draw_text ( int64_t renderer_id,
int64_t font_id,
const char * text,
int64_t x,
int64_t y,
int64_t r,
int64_t g,
int64_t b,
int64_t a )

Draw text with a font at the given position and color.

Definition at line 640 of file sdl.c.

References g_font_count, g_fonts, g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_draw_text().

◆ fill_rect()

void fill_rect ( int64_t renderer_id,
int64_t x,
int64_t y,
int64_t w,
int64_t h )

Draw a filled rectangle.

Definition at line 261 of file sdl.c.

References g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_fill_rect().

◆ free_surface()

void free_surface ( int64_t surf_ptr)

Free a surface.

Definition at line 679 of file sdl.c.

Referenced by mxvm_sdl_free_surface().

◆ free_wav()

void free_wav ( int64_t audio_buf)

Free a loaded WAV buffer.

Definition at line 496 of file sdl.c.

Referenced by mxvm_sdl_free_wav().

◆ get_clipboard_text()

const char * get_clipboard_text ( void )

Get the system clipboard text.

Definition at line 561 of file sdl.c.

Referenced by mxvm_sdl_get_clipboard_text().

◆ get_event_type()

int64_t get_event_type ( void )

Get the type of the last polled event.

Definition at line 186 of file sdl.c.

References g_event.

Referenced by mxvm_sdl_get_event_type().

◆ get_key_code()

int64_t get_key_code ( void )

Get the key code from the last keyboard event.

Definition at line 190 of file sdl.c.

References g_event.

Referenced by mxvm_sdl_get_key_code().

◆ get_keyboard_state()

int64_t get_keyboard_state ( int64_t * numkeys)

Get the keyboard state array.

Parameters
[out]numkeysReceives number of keys
Returns
Pointer to key state array cast to int64_t

Definition at line 536 of file sdl.c.

Referenced by mxvm_sdl_get_keyboard_state().

◆ get_mouse_button()

int64_t get_mouse_button ( void )

Get the mouse button from the last mouse event.

Definition at line 202 of file sdl.c.

References g_event.

Referenced by mxvm_sdl_get_mouse_button().

◆ get_mouse_buttons()

int64_t get_mouse_buttons ( void )

Get the current mouse button bitmask (pointerless variant).

Definition at line 514 of file sdl.c.

Referenced by mxvm_sdl_get_mouse_buttons().

◆ get_mouse_state()

int64_t get_mouse_state ( int64_t * x,
int64_t * y )

Get the current mouse state with pointer coordinates.

Parameters
[out]xReceives mouse x position
[out]yReceives mouse y position
Returns
Button bitmask

Definition at line 693 of file sdl.c.

Referenced by mxvm_sdl_get_mouse_state().

◆ get_mouse_x()

int64_t get_mouse_x ( void )

Get the mouse x coordinate from the last mouse event.

Definition at line 194 of file sdl.c.

References g_event.

Referenced by mxvm_sdl_get_mouse_x().

◆ get_mouse_y()

int64_t get_mouse_y ( void )

Get the mouse y coordinate from the last mouse event.

Definition at line 198 of file sdl.c.

References g_event.

Referenced by mxvm_sdl_get_mouse_y().

◆ get_num_keys()

int64_t get_num_keys ( void )

Get the total number of keyboard keys.

Definition at line 551 of file sdl.c.

Referenced by mxvm_sdl_get_num_keys().

◆ get_queued_audio_size()

int64_t get_queued_audio_size ( void )

Get the number of bytes of queued audio.

Definition at line 506 of file sdl.c.

Referenced by mxvm_sdl_get_queued_audio_size().

◆ get_relative_mouse_buttons()

int64_t get_relative_mouse_buttons ( void )

Get the relative mouse button bitmask (pointerless variant).

Definition at line 531 of file sdl.c.

Referenced by mxvm_sdl_get_relative_mouse_buttons().

◆ get_relative_mouse_state()

int64_t get_relative_mouse_state ( int64_t * x,
int64_t * y )

Get the relative mouse state.

Parameters
[out]xReceives relative x delta
[out]yReceives relative y delta
Returns
Button bitmask

Definition at line 703 of file sdl.c.

Referenced by mxvm_sdl_get_relative_mouse_state().

◆ get_relative_mouse_x()

int64_t get_relative_mouse_x ( void )

Get the relative mouse x delta (pointerless variant).

Definition at line 519 of file sdl.c.

Referenced by mxvm_sdl_get_relative_mouse_x().

◆ get_relative_mouse_y()

int64_t get_relative_mouse_y ( void )

Get the relative mouse y delta (pointerless variant).

Definition at line 525 of file sdl.c.

Referenced by mxvm_sdl_get_relative_mouse_y().

◆ get_renderer_output_size()

void get_renderer_output_size ( int64_t renderer_id,
int64_t * w,
int64_t * h )

Get the renderer output size.

Parameters
[out]wReceives width
[out]hReceives height

Definition at line 596 of file sdl.c.

References g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_get_renderer_output_size().

◆ get_ticks()

int64_t get_ticks ( void )

Get the number of milliseconds since SDL initialization.

Definition at line 450 of file sdl.c.

Referenced by mxvm_sdl_get_ticks().

◆ get_window_size()

void get_window_size ( int64_t window_id,
int64_t * w,
int64_t * h )

Get the size of a window.

Parameters
[out]wReceives width
[out]hReceives height

Definition at line 581 of file sdl.c.

References g_window_count, and g_windows.

Referenced by mxvm_sdl_get_window_size().

◆ init()

int64_t init ( void )

Initialize SDL2 subsystems.

Returns
0 on success, negative on failure

Definition at line 26 of file sdl.c.

Referenced by action_interpret(), and mxvm_sdl_init().

◆ init_text()

int64_t init_text ( void )

Initialize the SDL_ttf text rendering subsystem.

Definition at line 609 of file sdl.c.

Referenced by mxvm_sdl_init_text().

◆ is_key_pressed()

int64_t is_key_pressed ( int64_t scancode)

Check whether a specific key is currently pressed.

Parameters
scancodeSDL scancode
Returns
Non-zero if pressed

Definition at line 543 of file sdl.c.

Referenced by mxvm_sdl_is_key_pressed().

◆ load_font()

int64_t load_font ( const char * file,
int64_t ptsize )

Load a TrueType font.

Parameters
fileFont file path
ptsizeFont point size
Returns
Font ID handle

Definition at line 626 of file sdl.c.

References g_font_count, and g_fonts.

Referenced by mxvm_sdl_load_font().

◆ load_texture()

int64_t load_texture ( int64_t renderer_id,
const char * file_path )

Load a texture from an image file.

Parameters
renderer_idRenderer handle
file_pathPath to the image file
Returns
Texture ID handle

Load a texture from an image file.

Loads the bitmap via SDL_LoadBMP, sets pure black (0,0,0) as the transparent color key with SDL_SetColorKey, then creates an accelerated texture from the surface. The surface is freed after texture creation.

Parameters
renderer_idIndex into the renderer array.
file_pathPath to the .bmp file.
Returns
Texture index on success, -1 on bad renderer, -2 on load failure, -3 on texture creation failure.

Definition at line 306 of file sdl.c.

References g_renderer_count, g_renderers, g_texture_count, and g_textures.

Referenced by mxvm_sdl_load_texture().

◆ load_texture_color_key()

int64_t load_texture_color_key ( int64_t renderer_id,
const char * file_path )

Load a BMP file as a texture with black color-key transparency.

Definition at line 330 of file sdl.c.

References g_renderer_count, g_renderers, g_texture_count, and g_textures.

Referenced by mxvm_sdl_load_texture_color_key().

◆ load_texture_color_key_rgb()

int64_t load_texture_color_key_rgb ( int64_t renderer_id,
const char * file_path,
int64_t r,
int64_t g,
int64_t b )

Load a BMP file as a texture with a custom RGB color-key transparency.

Load a BMP file as a texture with a custom RGB color-key transparency.

Loads the bitmap via SDL_LoadBMP, sets the specified (r, g, b) color as the transparent color key with SDL_SetColorKey, then creates an accelerated texture from the surface. The surface is freed after texture creation.

Parameters
renderer_idIndex into the renderer array.
file_pathPath to the .bmp file.
rRed component of the color key (0–255).
gGreen component of the color key (0–255).
bBlue component of the color key (0–255).
Returns
Texture index on success, -1 on bad renderer or allocation failure, -2 on load failure, -3 on texture creation failure.

Definition at line 371 of file sdl.c.

References g_renderer_count, g_renderers, g_texture_count, and g_textures.

Referenced by mxvm_sdl_load_texture_color_key_rgb().

◆ load_wav()

int64_t load_wav ( const char * file_path,
int64_t * audio_buf,
int64_t * audio_len,
int64_t * audio_spec )

Load a WAV file.

Parameters
file_pathPath to the WAV file
[out]audio_bufReceives the audio buffer pointer
[out]audio_lenReceives the audio length in bytes
[out]audio_specReceives the audio spec pointer
Returns
Non-zero on success

Definition at line 478 of file sdl.c.

Referenced by mxvm_sdl_load_wav().

◆ lock_texture()

int64_t lock_texture ( int64_t texture_id,
void ** pixels,
int64_t * pitch )

Lock a texture for direct pixel access.

Parameters
[out]pixelsReceives pointer to pixel data
[out]pitchReceives row pitch in bytes

Definition at line 434 of file sdl.c.

References g_texture_count, and g_textures.

Referenced by mxvm_sdl_lock_texture().

◆ open_audio()

int64_t open_audio ( int64_t freq,
int64_t format,
int64_t channels,
int64_t samples )

Open the audio device.

Parameters
freqSample rate (e.g. 44100)
formatAudio format
channelsNumber of channels
samplesBuffer size in samples
Returns
0 on success

Definition at line 458 of file sdl.c.

Referenced by mxvm_sdl_open_audio().

◆ pause_audio()

void pause_audio ( int64_t pause_on)

Pause or unpause audio playback.

Definition at line 474 of file sdl.c.

Referenced by mxvm_sdl_pause_audio().

◆ poll_event()

int64_t poll_event ( void )

Poll for a pending SDL event.

Returns
1 if an event was available, 0 otherwise

Definition at line 182 of file sdl.c.

References g_event.

Referenced by mxvm_sdl_poll_event().

◆ present()

void present ( int64_t renderer_id)

Present the renderer's back buffer to the screen.

Definition at line 218 of file sdl.c.

References g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_present().

◆ present_scaled()

void present_scaled ( int64_t renderer_id,
int64_t target_id,
int64_t scale_width,
int64_t scale_height )

Present a render target scaled to the given dimensions.

Definition at line 224 of file sdl.c.

References g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_present_scaled().

◆ present_stretched()

void present_stretched ( int64_t renderer_id,
int64_t target_id,
int64_t dst_width,
int64_t dst_height )

Present a render target stretched to the given dimensions.

Definition at line 233 of file sdl.c.

References g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_present_stretched().

◆ queue_audio()

int64_t queue_audio ( const void * data,
int64_t len )

Queue audio data for playback.

Definition at line 502 of file sdl.c.

Referenced by mxvm_sdl_queue_audio().

◆ quit()

void quit ( void )

Shut down SDL2 and release all resources.

Definition at line 34 of file sdl.c.

References g_font_count, g_fonts, g_render_target_count, g_renderer_count, g_renderers, g_target_heights, g_target_widths, g_texture_count, g_textures, g_window_count, and g_windows.

Referenced by mxvm_sdl_quit().

◆ quit_text()

void quit_text ( void )

Shut down the SDL_ttf subsystem.

Definition at line 613 of file sdl.c.

References g_font_count, and g_fonts.

Referenced by mxvm_sdl_quit_text().

◆ render_texture()

void render_texture ( int64_t renderer_id,
int64_t texture_id,
int64_t src_x,
int64_t src_y,
int64_t src_w,
int64_t src_h,
int64_t dst_x,
int64_t dst_y,
int64_t dst_w,
int64_t dst_h )

Render a portion of a texture to a destination rectangle.

Definition at line 397 of file sdl.c.

References g_renderer_count, g_renderers, g_texture_count, and g_textures.

Referenced by mxvm_sdl_render_texture().

◆ set_clipboard_text()

void set_clipboard_text ( const char * text)

Set the system clipboard text.

Definition at line 557 of file sdl.c.

Referenced by mxvm_sdl_set_clipboard_text().

◆ set_draw_color()

void set_draw_color ( int64_t renderer_id,
int64_t r,
int64_t g,
int64_t b,
int64_t a )

Set the current draw color (RGBA).

Definition at line 206 of file sdl.c.

References g_renderer_count, and g_renderers.

Referenced by mxvm_sdl_set_draw_color().

◆ set_render_target()

void set_render_target ( int64_t renderer_id,
int64_t target_id )

Set the current render target (0 to render to the window).

Definition at line 173 of file sdl.c.

Referenced by mxvm_sdl_set_render_target().

◆ set_window_fullscreen()

void set_window_fullscreen ( int64_t window_id,
int64_t fullscreen )

Set or clear fullscreen mode for a window.

Definition at line 590 of file sdl.c.

References g_window_count, and g_windows.

Referenced by mxvm_sdl_set_window_fullscreen().

◆ set_window_icon()

void set_window_icon ( uint64_t window_id,
const char * path )

Set the window icon from an image file.

Definition at line 113 of file sdl.c.

References g_windows.

Referenced by mxvm_sdl_set_window_icon().

◆ set_window_position()

void set_window_position ( int64_t window_id,
int64_t x,
int64_t y )

Set the position of a window.

Definition at line 575 of file sdl.c.

References g_window_count, and g_windows.

Referenced by mxvm_sdl_set_window_position().

◆ set_window_title()

void set_window_title ( int64_t window_id,
const char * title )

Set the title of a window.

Definition at line 569 of file sdl.c.

References g_window_count, and g_windows.

Referenced by mxvm_sdl_set_window_title().

◆ show_cursor()

void show_cursor ( int64_t show)

Show or hide the mouse cursor.

Definition at line 605 of file sdl.c.

Referenced by mxvm_sdl_show_cursor().

◆ unlock_texture()

void unlock_texture ( int64_t texture_id)

Unlock a previously locked texture.

Definition at line 444 of file sdl.c.

References g_texture_count, and g_textures.

Referenced by mxvm_sdl_unlock_texture().

◆ update_texture()

int64_t update_texture ( int64_t texture_id,
const void * pixels,
int64_t pitch )

Update a texture with new pixel data.

Definition at line 427 of file sdl.c.

References g_texture_count, and g_textures.

Referenced by mxvm_sdl_update_texture().