Files
handmadehero/sdl_handmade.h
T
2026-07-14 13:21:04 -07:00

56 lines
1.0 KiB
C

#ifndef SDL_HANDMADE_H
#define SDL_HANDMADE_H
#include <SDL.h>
#include "core.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 SamplesPerSecond;
int BytesPerSample;
int SecondaryBufferSize;
int LatencySampleCount;
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 TotalSize;
void *GameMmemoryBlock;
char EXEDirPath[SDL_STATE_PATH_SIZE];
char DLLPath[SDL_STATE_PATH_SIZE];
};
#endif