summaryrefslogtreecommitdiff
path: root/library.h
blob: 42be89097fe191c562563cd19da89cace6883611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include <memory>
#include "font.h"
#include "global.h"
#include "object_base.h"

using namespace std;


extern Global global;
extern sf::RenderWindow window;


template <typename ObjT>
Object* instance_create(int x,int y){
	Object *ptr=new ObjT(x,y);
	global.objects.insert(ptr);
	ptr->create();
	return ptr;
}

void instance_destroy(Object *obj);

void draw_text(int x,int y,const char *s);
void draw_textf(int x,int y,const char *format,...) __attribute__((format (printf, 3, 4)));

void draw_set_font(const Font *font);

void log(const char *s);
void logf(const char *format,...) __attribute__((format (printf, 1, 2)));