timesynk/tile_editor/sdl.h

47 lines
1.1 KiB
C

#ifndef SDL_H
#define SDL_H
#include "elements.h"
SDL_Surface* screen;
SDL_Surface* menu_area;
SDL_Surface* tile_area;
SDL_Rect tile_area_rect;
SDL_Rect update_rect;
SDL_Event event;
struct Font font;
struct Font {
int width;
int height;
SDL_Surface *surface;
};
void loadFont(struct Font *font, unsigned char *memory, unsigned int length, int width, int height);
void drawChar(const struct Font *font, SDL_Surface *surface, int x, int y, const char ch);
void drawString(const struct Font *font, SDL_Surface *surface, int x, int y, const char *string);
void drawElement(const struct Element *element);
void clearElement(const struct Element *element);
void addElement(struct Element *element, SDL_Surface *surface);
void handleMouseDown(const SDL_MouseButtonEvent *event);
void handleMouseUp(const SDL_MouseButtonEvent *event);
void handleMouseMove(const SDL_MouseMotionEvent *event);
int getElementWidth(const struct Element* element);
int getElementHeight(const struct Element* element);
void loadGraphicsCallback();
void loadDataCallback();
void saveDataCallback();
void setSetCallback();
void setIdCallback();
void Quit();
#endif