Add README, some work on SDL 1.2

This commit is contained in:
octospacc 2022-08-06 13:57:49 +02:00
parent 8bb663a7be
commit 113c2ea17d
7 changed files with 63 additions and 18 deletions

31
LibMultiSpacc/SDL12/SDL.c Normal file
View File

@ -0,0 +1,31 @@
#include <stddef.h>
#include "../MultiSpacc.h"
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_mixer.h"
#include "SDL/SDL_ttf.h"
void MultiSpacc_SetAppTitle( const char *Title ) {
SDL_WM_SetCaption( Title, NULL );
}
void MultiSpacc_SetAppIcon( SDL_Surface *Icon ) {
SDL_WM_SetIcon( Icon, NULL );
}
int MultiSpacc_SetColorKey( SDL_Surface *Surface, bool Flag, Uint32 Key ) {
if ( Flag ) {
return SDL_SetColorKey( Surface, SDL_SRCCOLORKEY, Key );
}
else {
return SDL_SetColorKey( Surface, 0, Key );
}
}
SDL_Surface *MultiSpacc_GetWindow( int Width, int Height, int Bits, Uint32 Flags ) {
return SDL_SetVideoMode( Width, Height, Bits, Flags );
}
SDL_Surface *MultiSpacc_GetWindowSurface( SDL_Surface *Window ) {
return Window;
}

18
LibMultiSpacc/SDL12/SDL.h Normal file
View File

@ -0,0 +1,18 @@
#pragma once
#ifndef MultiSpacc_Target_SDL12
#define MultiSpacc_Target_SDL12
#endif
#include <stddef.h>
#include "../MultiSpacc.h"
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_mixer.h"
#include "SDL/SDL_ttf.h"
void MultiSpacc_SetAppTitle( const char *Title );
void MultiSpacc_SetAppIcon( SDL_Surface *Icon );
int MultiSpacc_SetColorKey( SDL_Surface *Surface, bool Flag, Uint32 Key );
SDL_Surface *MultiSpacc_GetWindow( int Width, int Height, int Bits, Uint32 Flags );
SDL_Surface *MultiSpacc_GetWindowSurface( SDL_Surface *Window );

14
README.md Normal file
View File

@ -0,0 +1,14 @@
# LibMultiSpacc
LibMultiSpacc is a library aiming to provide cross-platform abstractions for a number of less-cross-platform libraries.
The list of backend libraries supported follows:
- SDL 1.2 (WIP)
- SDL 2.0 (planned)
Example programs (and makefiles) will come soon.
### Licensing
I have yet to choose a license for this. I would like for the library to be usable by as many people as possible (and, for that, the Unlicense o zlib license would be the best), but I have yet to understand legal compatibility with all the different libraries mine is made to work on top of.

View File

@ -1,5 +0,0 @@
#include <stddef.h>
void MultiSpacc_SetAppTitle( const char *Title ) {
SDL_WM_SetCaption( Title, NULL );
}

View File

@ -1,13 +0,0 @@
#pragma once
#ifndef MultiSpacc_Target_SDL12
#define MultiSpacc_Target_SDL12
#endif
#include "../MultiSpacc.h"
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_mixer.h"
#include "SDL/SDL_ttf.h"
void MultiSpacc_SetAppTitle( const char *Title );