shithub: candycrisis

ref: 56f1e92bcab1dad60dad8791428b84a0a4c0453b
dir: /src/SDLU.h/

View raw version
///
///  SDLU.h
///

#pragma once

#include <SDL.h>
#include "MTypes.h"

#define BLUE_MASK          0x0000FF
#define GREEN_MASK         0x00FF00
#define RED_MASK           0xFF0000
#define CHANNEL_MASK       BLUE_MASK
#define FULL_WEIGHT        (1+CHANNEL_MASK)

#define COLOR_T            int

#define BITS_PER_1CHANNEL  8
#define BITS_PER_2CHANNELS 16
#define BITS_PER_3CHANNELS 24

#define BYTES_PER_PIXEL    4
#define BYTES_PER_MASK_PIXEL 1
#define MASK_DEPTH 8

#define SYSTEM_CURSOR_OFF       0
#define SYSTEM_CURSOR_ARROW     1
#define SYSTEM_CURSOR_HAND      2

void         SDLU_Init(void);
void         SDLU_CreateRendererTexture(void);
SDL_Rect*    SDLU_MRectToSDLRect( const MRect* in, SDL_Rect* out );
MRect*       SDLU_SDLRectToMRect( const SDL_Rect* in, MRect* out );
int          SDLU_BlitSurface( SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect );
void         SDLU_GetPixel( SDL_Surface* surface, int x, int y, SDL_Color* pixel );
void         SDLU_ChangeSurfaceDepth( SDL_Surface** surface, int depth );
SDL_Surface* SDLU_InitSurface( SDL_Rect* rect, int depth );
void         SDLU_BlitFrontSurface( SDL_Surface* source, SDL_Rect* sourceSDLRect, SDL_Rect* destSDLRect );
void         SDLU_SetBrightness( float b );
void         SDLU_AcquireSurface( SDL_Surface* surface );
SDL_Surface* SDLU_GetCurrentSurface(void);
void         SDLU_ReleaseSurface( SDL_Surface* surface );
void         SDLU_GetMouse( MPoint* pt );
int          SDLU_Button(void);
void         SDLU_Yield(void);
void         SDLU_PumpEvents(void);
void         SDLU_StartWatchingTyping(void);
void         SDLU_StopWatchingTyping(void);
MBoolean     SDLU_CheckASCIITyping(char* ascii);
MBoolean     SDLU_CheckSDLTyping(SDL_Keycode* sdlKey);
MBoolean     SDLU_IsForeground(void);
void         SDLU_Present(void);
void         SDLU_SetSystemCursor(int which);