Files
handmadehero/sdl_handmade.h

55 lines
1.0 KiB
C

#ifndef SDL_HANDMADE_H
#define SDL_HANDMADE_H
#include <SDL3/SDL.h>
#include "handmade.h"
struct sdl_border_size {
int top;
int bottom;
int left;
int right;
};
struct sdl_window_size {
int width;
int height;
};
struct sdl_window_position {
int x;
int y;
};
struct offscreen_buffer {
/* Pixels are always 32-bit and have the bytes in BGRX (little-endian). */
SDL_Texture *texture;
void *memory;
int width;
int height;
int pitch;
};
struct sdl_sound_output {
int samples_per_second;
int bytes_per_sample;
int secondary_buffer_size;
int latency_sample_count;
void *samples;
};
/* TODO: We choose 1024 only because MacOS's MAXPATHLEN says such a value.
* For example, linux/limits.h PATH_MAX says 4096. Windows has MAX_PATH. */
#define SDL_STATE_PATH_SIZE 1024
struct sdl_state {
unsigned long long total_size;
void *game_memory_block;
char exe_dir_path[SDL_STATE_PATH_SIZE];
char dll_path[SDL_STATE_PATH_SIZE];
};
#endif