ObjectivelyGPU
Object oriented graphics framework for SDL3 and C
Loading...
Searching...
No Matches
Types.h File Reference
#include <stdlib.h>
#include <SDL3/SDL_assert.h>
#include <SDL3/SDL_gpu.h>
#include <SDL3/SDL_log.h>
#include <Objectively/Types.h>

Go to the source code of this file.

Data Structures

struct  SDL_Size
 The SDL_Size type. More...
 

Macros

#define OBJECTIVELYGPU_EXPORT   extern
 
#define OBJECTIVELYGPU_EXPORT_DATA
 
#define MakePoint(x, y)   (SDL_Point) { (x), (y) }
 Creates an SDL_Point with the given coordinates.
 
#define MakeRect(x, y, w, h)   (SDL_Rect) { (x), (y), (w), (h) }
 Creates an SDL_Rect with the given origin and size.
 
#define MakeSize(w, h)   (SDL_Size) { (w), (h) }
 Creates an SDL_Size with the given dimensions.
 
#define GPU_Assert(cond, fmt, ...)
 Asserts that cond is true, logging the SDL error and exiting on failure.
 

Typedefs

typedef struct SDL_Size SDL_Size
 

Macro Definition Documentation

◆ GPU_Assert

#define GPU_Assert (   cond,
  fmt,
  ... 
)
Value:
do { \
if (!(cond)) { \
SDL_LogCritical(SDL_LOG_CATEGORY_GPU, "%s::%d::%s: " fmt ": %s", __FILE__, __LINE__, __func__, ## __VA_ARGS__, SDL_GetError()); \
SDL_TriggerBreakpoint(); \
exit(EXIT_FAILURE); \
} \
} while (0)

Asserts that cond is true, logging the SDL error and exiting on failure.

Unlike assert(3), this macro is never compiled out.

◆ MakePoint

#define MakePoint (   x,
 
)    (SDL_Point) { (x), (y) }

Creates an SDL_Point with the given coordinates.

◆ MakeRect

#define MakeRect (   x,
  y,
  w,
 
)    (SDL_Rect) { (x), (y), (w), (h) }

Creates an SDL_Rect with the given origin and size.

◆ MakeSize

#define MakeSize (   w,
 
)    (SDL_Size) { (w), (h) }

Creates an SDL_Size with the given dimensions.

◆ OBJECTIVELYGPU_EXPORT

#define OBJECTIVELYGPU_EXPORT   extern

◆ OBJECTIVELYGPU_EXPORT_DATA

#define OBJECTIVELYGPU_EXPORT_DATA

Typedef Documentation

◆ SDL_Size

typedef struct SDL_Size SDL_Size