Files
prosperon/sdl.h

33 lines
1.1 KiB
C

#ifndef QJS_SDL_H
#define QJS_SDL_H
#include <SDL3/SDL.h>
#include "cell.h"
SDL_Window *js2SDL_Window(JSContext *js, JSValue v);
JSValue SDL_Window2js(JSContext *js, SDL_Window *w);
SDL_PixelFormat str2pixelformat(const char *str);
SDL_PixelFormat js2pixelformat(JSContext *js, JSValue v);
JSValue pixelformat2js(JSContext *js, SDL_PixelFormat format);
const char *pixelformat2str(SDL_PixelFormat format);
// New enum system functions
int js2SDL_PixelFormat(JSContext *js, JSValue v);
JSValue SDL_PixelFormat2js(JSContext *js, int enumval);
SDL_Colorspace str2colorspace(const char *str);
SDL_Colorspace js2colorspace(JSContext *js, JSValue v);
JSValue colorspace2js(JSContext *js, SDL_Colorspace colorspace);
const char *colorspace2str(SDL_Colorspace colorspace);
// SDL Scale Mode functions
SDL_ScaleMode js2SDL_ScaleMode(JSContext *js, JSValue v);
JSValue SDL_ScaleMode2js(JSContext *js, SDL_ScaleMode mode);
// Surface type
typedef struct SDL_Surface SDL_Surface;
SDL_Surface *js2SDL_Surface(JSContext *js, JSValue v);
JSValue SDL_Surface2js(JSContext *js, SDL_Surface *s);
#endif