Blob Blame Raw
#ifndef HELI_WORLD_H
#define HELI_WORLD_H


#include "common.h"
#include "sprite.h"

typedef void (*Callback)();
typedef struct _Sound *Sound;

typedef enum _KeyEvent {
	KEYEVENT_KEY_DOWN,
	KEYEVENT_KEY_WENTDOWN,
	KEYEVENT_KEY_WENTUP,
	KEYEVENT_MOUSE_DOWN,
	KEYEVENT_MOUSE_WENTDOWN,
	KEYEVENT_MOUSE_WENTUP,
} KeyEvent;


void drawSprites();

Sound createSound(const char *path);
void soundDestroy(Sound sound);
void soundPlay(Sound sound, int loop);
void soundStop(Sound sound);

int keyDown(const char *code);
int keyWentDown(const char *code);
int keyWentUp(const char *code);

int keyEventGetCount(KeyEvent mode);
const char *keyEventGet(KeyEvent mode, int i);

int mouseDidMove();
int mouseDown(const char *code);
int mouseWentDown(const char *code);
int mouseWentUp(const char *code);
double mouseX();
double mouseY();

int mouseIsOver(Sprite sprite);
int mousePressedOver(Sprite sprite);

void askText(const char *question, char *answer, int maxAnswerSize);
void askTextEx(const char *question, char *answer, int maxAnswerSize, int multiline, int password);
void messageBox(const char *message);

int worldGetSpriteCount();
Sprite worldGetSprite(int i);

int worldGetWidth();
void worldSetWidth(int width);

int worldGetHeight();
void worldSetHeight(int height);

int worldGetResizable();
void worldSetResizable(int resizable);

const char* worldGetTitle();
void worldSetTitle(const char *title);

double worldGetFrameRate();
void worldSetFrameRate(double frameRate);

double worldGetTimeStep();

int worldGetFrameCount();
double worldGetSeconds();

void worldSetInit(Callback init);
void worldSetDraw(Callback draw);
void worldSetDeinit(Callback deinit);
void worldRun();
void worldStop();


void cameraOn();
void cameraOff();
int cameraIsActive();

double cameraMouseX();
double cameraMouseY();

double cameraGetX();
void cameraSetX(double x);

double cameraGetY();
void cameraSetY(double y);

double cameraGetZoom();
void cameraSetZoom(double zoom);


#endif