-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
88 lines (50 loc) · 1.13 KB
/
main.cpp
File metadata and controls
88 lines (50 loc) · 1.13 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <stdio.h>
#include <stdlib.h>
#include "Catan.h"
#include "Graph.h"
#include "Visualize.h"
int main()
{
// configure catan board
Catan catan;
catan.initBoard();
if (SDL_Init(SDL_INIT_VIDEO) == 0) {
SDL_Window* window = NULL;
SDL_Renderer* renderer = NULL;
if (SDL_CreateWindowAndRenderer(XLEN, YLEN, 0, &window, &renderer) == 0) {
SDL_bool done = SDL_FALSE;
SDL_Surface *s;
if(TTF_Init()==-1) {
printf("TTF_Init: %s\n", TTF_GetError());
}
// initialize window
SDL_Event event;
SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
SDL_RenderClear(renderer);
SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE);
// draw the board here
drawBoard(renderer, catan);
// render
SDL_RenderPresent(renderer);
while (!done) {
// check for exit event
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
done = SDL_TRUE;
}
}
}
}
}
SDL_Quit();
TTF_Quit();
//catan.printBoard();
/*
Graph g;
g.init(5);
g.printGraph();
g.addEdgesLinear(0,3);
g.printGraph();
*/
return 0;
}