2023-11-01 13:58:22 +01:00
# ifndef _MultiSpacc_h_
# define _MultiSpacc_h_
2023-10-10 18:11:20 +02:00
# include <stdarg.h>
2023-11-01 13:58:22 +01:00
# ifndef MultiSpacc_Target_NES
# include <stdbool.h>
# endif
2022-08-06 20:34:46 +02:00
# include <stddef.h>
2023-10-07 16:51:29 +02:00
# include <stdint.h>
# include <stdio.h>
2023-11-01 13:58:22 +01:00
# include <string.h>
2022-08-06 01:07:35 +02:00
# ifdef MultiSpacc_Target_SDL12
2023-10-30 12:27:41 +01:00
# include <SDL/SDL.h>
# include <SDL/SDL_image.h>
# include <SDL/SDL_mixer.h>
# include <SDL/SDL_ttf.h>
# define MultiSpacc_Window SDL_Surface
# define MultiSpacc_UpdateWindowSurface SDL_Flip
typedef struct MultiSpacc_Event {
Uint32 Type ;
SDLKey Key ;
} MultiSpacc_Event ;
2022-08-06 01:07:35 +02:00
# endif
# ifdef MultiSpacc_Target_SDL20
2023-10-30 12:27:41 +01:00
# include <SDL2/SDL.h>
# include <SDL2/SDL_image.h>
# include <SDL2/SDL_mixer.h>
# include <SDL2/SDL_ttf.h>
# define MultiSpacc_Window SDL_Window
# define MultiSpacc_UpdateWindowSurface SDL_UpdateWindowSurface
typedef struct MultiSpacc_Event {
Uint32 Type ;
SDL_Keycode Key ;
} MultiSpacc_Event ;
# endif
# ifdef MultiSpacc_Target_SDLCom
# define MultiSpacc_Init SDL_Init
# define MultiSpacc_Surface SDL_Surface
# define MultiSpacc_GetTicks SDL_GetTicks
# define MultiSpacc_Sleep SDL_Delay
# define MultiSpacc_Rect SDL_Rect
2022-08-06 01:07:35 +02:00
# endif
2022-08-07 00:38:18 +02:00
2023-10-07 16:51:29 +02:00
# ifdef MultiSpacc_Target_NDS
2023-10-30 12:27:41 +01:00
# include <nds.h>
# define Uint32 int32
# define MultiSpacc_Surface PrintConsole
# define MultiSpacc_Window PrintConsole
typedef struct MultiSpacc_Event {
int Keys ;
} MultiSpacc_Event ;
int MultiSpacc_UpdateWindowSurface ( MultiSpacc_Window * Window ) ;
void MultiSpacc_Sleep ( int milliseconds ) ;
2023-10-07 16:51:29 +02:00
# endif
2023-10-31 18:06:39 +01:00
# ifdef MultiSpacc_Target_NES
# include <nes.h>
# include "neslib.h"
2023-11-01 13:58:22 +01:00
# define Uint32 int
# define MultiSpacc_Window int
# define MultiSpacc_Surface int
# define MultiSpacc_Event int
int MultiSpacc_UpdateWindowSurface ( MultiSpacc_Window * Window ) ;
2023-10-31 18:06:39 +01:00
# endif
2023-10-07 16:51:29 +02:00
typedef struct MultiSpacc_SurfaceConfig {
int Width ;
int Height ;
int Bits ;
2023-11-01 13:58:22 +01:00
char Palette [ 32 ] ;
2023-10-07 16:51:29 +02:00
Uint32 Flags ;
} MultiSpacc_SurfaceConfig ;
2023-11-01 13:58:22 +01:00
MultiSpacc_Window * MultiSpacc_SetWindow ( MultiSpacc_SurfaceConfig * WindowConfig ) ;
2022-08-07 00:38:18 +02:00
MultiSpacc_Surface * MultiSpacc_GetWindowSurface ( MultiSpacc_Window * Window ) ;
2023-07-20 00:51:16 +02:00
void MultiSpacc_SetAppTitle ( MultiSpacc_Window * Window , const char Title [ ] ) ;
2022-08-07 00:38:18 +02:00
void MultiSpacc_SetAppIcon ( MultiSpacc_Window * Window , MultiSpacc_Surface * Icon ) ;
2023-07-20 00:51:16 +02:00
MultiSpacc_Surface * MultiSpacc_LoadImage ( char FilePath [ ] , MultiSpacc_Surface * Screen , Uint32 * ColorKey ) ;
2022-08-07 00:38:18 +02:00
int MultiSpacc_SetColorKey ( MultiSpacc_Surface * Surface , bool Flag , Uint32 Key ) ;
2023-07-20 00:51:16 +02:00
int MultiSpacc_PollEvent ( MultiSpacc_Event * Event ) ;
2023-10-07 01:55:59 +02:00
2023-10-10 18:11:20 +02:00
void MultiSpacc_PrintDebug ( const char * format , . . . ) ;
2023-11-01 13:58:22 +01:00
void MultiSpacc_PrintText ( char Text [ ] , MultiSpacc_Surface * Surface , MultiSpacc_SurfaceConfig * WindowConfig , int x , int y , MultiSpacc_Surface * Tiles /*, int FontSize, int Color */ ) ; // WIP
2023-10-31 18:06:39 +01:00
void MultiSpacc_Sprite ( int id , int x , int y , int sprite , MultiSpacc_Surface * Tiles , MultiSpacc_Surface * Surface ) ;
2023-11-01 13:58:22 +01:00
# endif // _MultiSpacc_h_