39int64_t
create_window(
const char *title, int64_t x, int64_t y, int64_t w, int64_t h, int64_t flags);
71int64_t
create_renderer(int64_t window_id, int64_t index, int64_t flags);
77void set_draw_color(int64_t renderer_id, int64_t r, int64_t g, int64_t b, int64_t a);
80void clear(int64_t renderer_id);
83void present(int64_t renderer_id);
96void draw_point(int64_t renderer_id, int64_t x, int64_t y);
99void draw_line(int64_t renderer_id, int64_t x1, int64_t y1, int64_t x2, int64_t y2);
102void draw_rect(int64_t renderer_id, int64_t x, int64_t y, int64_t w, int64_t h);
105void fill_rect(int64_t renderer_id, int64_t x, int64_t y, int64_t w, int64_t h);
144int64_t
blit_surface(int64_t src_ptr, int64_t dst_ptr, int64_t x, int64_t y);
224int64_t
create_texture(int64_t renderer_id, int64_t format, int64_t access, int64_t w, int64_t h);
234int64_t
load_texture(int64_t renderer_id,
const char *file_path);
243void 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);
253void delay(int64_t ms);
265int64_t
open_audio(int64_t freq, int64_t format, int64_t channels, int64_t samples);
280int64_t
load_wav(
const char *file_path, int64_t *audio_buf, int64_t *audio_len, int64_t *audio_spec);
299int64_t
update_texture(int64_t texture_id,
const void *pixels, int64_t pitch);
305int64_t
lock_texture(int64_t texture_id,
void **pixels, int64_t *pitch);
325int64_t
load_font(
const char *file, int64_t ptsize);
328void 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);
344void present_scaled(int64_t renderer_id, int64_t target_id, int64_t scale_width, int64_t scale_height);
347void present_stretched(int64_t renderer_id, int64_t target_id, int64_t dst_width, int64_t dst_height);
int64_t poll_event(void)
Poll for a pending SDL event.
void quit(void)
Shut down SDL2 and release all resources.
void fill_rect(int64_t renderer_id, int64_t x, int64_t y, int64_t w, int64_t h)
Draw a filled rectangle.
int64_t get_queued_audio_size(void)
Get the number of bytes of queued audio.
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 get_renderer_output_size(int64_t renderer_id, int64_t *w, int64_t *h)
Get the renderer output size.
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.
int64_t get_relative_mouse_state(int64_t *x, int64_t *y)
Get the relative mouse state.
int64_t open_audio(int64_t freq, int64_t format, int64_t channels, int64_t samples)
Open the audio device.
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.
void set_clipboard_text(const char *text)
Set the system clipboard text.
const char * get_clipboard_text(void)
Get the system clipboard text.
void set_window_title(int64_t window_id, const char *title)
Set the title of a window.
int64_t get_num_keys(void)
Get the total number of keyboard keys.
int64_t get_key_code(void)
Get the key code from the last keyboard event.
void set_render_target(int64_t renderer_id, int64_t target_id)
Set the current render target (0 to render to the window).
int64_t get_mouse_state(int64_t *x, int64_t *y)
Get the current mouse state with pointer coordinates.
void free_surface(int64_t surf_ptr)
Free a surface.
int64_t get_mouse_button(void)
Get the mouse button from the last mouse event.
int64_t update_texture(int64_t texture_id, const void *pixels, int64_t pitch)
Update a texture with new pixel data.
int64_t load_wav(const char *file_path, int64_t *audio_buf, int64_t *audio_len, int64_t *audio_spec)
Load a WAV file.
int64_t get_mouse_buttons(void)
Get the current mouse button bitmask (pointerless variant).
int64_t create_rgb_surface(int64_t width, int64_t height, int64_t depth)
Create an RGB surface.
void quit_text(void)
Shut down the SDL_ttf subsystem.
void set_window_position(int64_t window_id, int64_t x, int64_t y)
Set the position of a window.
int64_t get_relative_mouse_y(void)
Get the relative mouse y delta (pointerless variant).
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 delay(int64_t ms)
Pause execution for the given number of milliseconds.
int64_t get_keyboard_state(int64_t *numkeys)
Get the keyboard state array.
void get_window_size(int64_t window_id, int64_t *w, int64_t *h)
Get the size of a window.
void clear_queued_audio(void)
Clear all queued audio data.
int64_t get_event_type(void)
Get the type of the last polled event.
int64_t init(void)
Initialize SDL2 subsystems.
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 draw_rect(int64_t renderer_id, int64_t x, int64_t y, int64_t w, int64_t h)
Draw a rectangle outline.
int64_t get_relative_mouse_x(void)
Get the relative mouse x delta (pointerless variant).
int64_t get_mouse_y(void)
Get the mouse y coordinate from the last mouse event.
void show_cursor(int64_t show)
Show or hide the mouse cursor.
void clear(int64_t renderer_id)
Clear the renderer with the current draw color.
void pause_audio(int64_t pause_on)
Pause or unpause audio playback.
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.
void destroy_window(int64_t window_id)
Destroy a window by ID.
void free_wav(int64_t audio_buf)
Free a loaded WAV buffer.
int64_t get_relative_mouse_buttons(void)
Get the relative mouse button bitmask (pointerless variant).
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.
void destroy_render_target(int64_t target_id)
Destroy a render target texture.
int64_t is_key_pressed(int64_t scancode)
Check whether a specific key is currently pressed.
int64_t get_mouse_x(void)
Get the mouse x coordinate from the last mouse event.
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 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 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.
void set_window_icon(uint64_t window_id, const char *path)
Set the window icon from an image file.
int64_t queue_audio(const void *data, int64_t len)
Queue audio data for playback.
void set_window_fullscreen(int64_t window_id, int64_t fullscreen)
Set or clear fullscreen mode for a window.
void close_audio(void)
Close the audio device.
int64_t load_font(const char *file, int64_t ptsize)
Load a TrueType font.
int64_t create_render_target(int64_t renderer_id, int64_t width, int64_t height)
Create an off-screen 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.
int64_t load_texture(int64_t renderer_id, const char *file_path)
Load a texture from an image file.
void unlock_texture(int64_t texture_id)
Unlock a previously locked texture.
void present(int64_t renderer_id)
Present the renderer's back buffer to the screen.
int64_t get_ticks(void)
Get the number of milliseconds since SDL initialization.
int64_t init_text(void)
Initialize the SDL_ttf text rendering subsystem.
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).
int64_t lock_texture(int64_t texture_id, void **pixels, int64_t *pitch)
Lock a texture for direct pixel access.
void draw_point(int64_t renderer_id, int64_t x, int64_t y)
Draw a single pixel.
void destroy_texture(int64_t texture_id)
Destroy a texture.