-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSDLfunctions.h
53 lines (43 loc) · 1.28 KB
/
SDLfunctions.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* SDLfunctions.h
* Hedgewood
*
* Prozedurale Programmierung WS10/11 TUHH
*
* Created by Tobias Conradi
* Version 08.01.11
*
* Copyright 2011 Gruppe 34. All rights reserved.
*
* Description:
*
*
*/
#ifndef SDLFUNCTIONS_H
#define SDLFUNCTIONS_H
#ifndef SDLINCLUDES_H
#include "SDLincludes.h"
#endif
#ifndef STRUCTS_H
#include "structs.h"
#endif
#include "hedgewoodIO.h"
//#define WINDOWWIDTH 800
//#define WINDOWHEIGTH 600
//#define WINDOWBPP 32
SDL_Surface* initSDL(dataStore *data);
//wechselt zwischen fullscreen und windows mode, return: mode nach umschalten
int toggleFullscreen(SDL_Surface *screen, int windowed);
void quitSDL(dataStore *data);
SDL_Surface *load_image(char *filename );
void printdb(char *str);
TTF_Font *buttonFont(); /*requires TTF_CloseFont(font); after use*/
TTF_Font *theFont(int size); /*requires TTF_CloseFont(font); after use*/
//draws button and ignores state
//return 0 on no errors – return 1 on errors
int drawButton (SDL_Surface *destinationSurface, myButton *button);
//draw button and if withState==1 it uses the state from myButton-struct
int drawButtonWithState (SDL_Surface *destinationSurface, myButton *button, int withState);
//returns 1 if button is clicked else 0
int isButtonClicked(myButton *button, int x, int y);
#endif