Blob Blame Raw
#ifndef HELI_WINDOW_H
#define HELI_WINDOW_H


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

typedef void (*Callback)();

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


void drawSprites();

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);

const char* textInputGet();
void textInputClear();
void textInputBegin();
void textInputEnd();

int mouseDidMove();
int mouseDown(const char *code);
int mouseWentDown(const char *code);
int mouseWentUp(const char *code);
int mouseScrolledX();
int mouseScrolledY();
double mouseX();
double mouseY();
double mouseTransformedX();
double mouseTransformedY();
void mouseWarp(double x, double y);
void mouseTransformedWarp(double x, double y);

void messageBox(const char *message);
int questionBox(const char *question, const char *answer0, const char *answer1);
int questionBox3(const char *question, const char *answer0, const char *answer1, const char *answer2);
int askText(const char *question, char *answer, int maxAnswerSize);
int askTextf(const char *question, const char *format, ...);
int askTextEx(const char *question, char *answer, int maxAnswerSize, int multiline, int password);

const char* windowGetClipboardText();
void windowSetClipboardText(const char *text);
void windowSetClipboardTextEx(const char *text, int len);

int windowGetWidth();
void windowSetWidth(int width);

int windowGetHeight();
void windowSetHeight(int height);

void windowSetSize(int width, int height);

int windowGetResizable();
void windowSetResizable(int resizable);

const char* windowGetTitle();
void windowSetTitle(const char *title);

double windowGetMinFrameRate();
double windowGetMaxFrameRate();
void windowSetFrameRateEx(double minFrameRate, double maxFrameRate);
void windowSetFrameRate(double frameRate);
void windowSetVariableFrameRate();
double windowGetFrameTime();

int windowGetFrameCount();
double windowGetSeconds();
double windowGetMonotonicSeconds();
unsigned long long windowGetMonotonicMilliseconds();

void windowSetInit(Callback init);
void windowSetDraw(Callback draw);
void windowSetDeinit(Callback deinit);
void windowRun();
void windowStop();


#endif