-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass_t_c_o_d_system.html
1255 lines (1188 loc) · 72.1 KB
/
class_t_c_o_d_system.html
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!-- HTML header for doxygen 1.9.5-->
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-772NXFFJ4E"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-772NXFFJ4E');
</script>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=11" />
<meta name="generator" content="Doxygen 1.9.5" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>libtcod: TCODSystem Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript" src="doxygen-awesome-fragment-copy-button.js"></script>
<script type="text/javascript" src="doxygen-awesome-paragraph-link.js"></script>
<script type="text/javascript" src="doxygen-awesome-interactive-toc.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
DoxygenAwesomeFragmentCopyButton.init()
DoxygenAwesomeParagraphLink.init()
DoxygenAwesomeInteractiveToc.init()
</script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top">
<!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">libtcod
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function(){initNavTree('class_t_c_o_d_system.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="class_t_c_o_d_system-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">TCODSystem Class Reference</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a557976239dea6ec766f556d4049d1cc8"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a557976239dea6ec766f556d4049d1cc8">setFps</a> (int val)</td></tr>
<tr class="memdesc:a557976239dea6ec766f556d4049d1cc8"><td class="mdescLeft"> </td><td class="mdescRight">The setFps function allows you to limit the number of frames per second. If a frame is rendered faster than expected, the TCOD_console_flush function will wait so that the frame rate never exceed this value. You can call this function during your game initialization. You can dynamically change the frame rate. Just call this function once again. <b>You should always limit the frame rate, except during benchmarks, else your game will use 100% of the CPU power</b> <a href="class_t_c_o_d_system.html#a557976239dea6ec766f556d4049d1cc8">More...</a><br /></td></tr>
<tr class="separator:a557976239dea6ec766f556d4049d1cc8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afd165edd84355acf1470c992110a1289"><td class="memItemLeft" align="right" valign="top"><a id="afd165edd84355acf1470c992110a1289" name="afd165edd84355acf1470c992110a1289"></a>
static int </td><td class="memItemRight" valign="bottom"><b>getFps</b> ()</td></tr>
<tr class="memdesc:afd165edd84355acf1470c992110a1289"><td class="mdescLeft"> </td><td class="mdescRight">The value returned by this function is updated every second. <br /></td></tr>
<tr class="separator:afd165edd84355acf1470c992110a1289"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a589961a2170c3b21fe43bc30aedc03bf"><td class="memItemLeft" align="right" valign="top">static float </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a589961a2170c3b21fe43bc30aedc03bf">getLastFrameLength</a> ()</td></tr>
<tr class="memdesc:a589961a2170c3b21fe43bc30aedc03bf"><td class="mdescLeft"> </td><td class="mdescRight">This function returns the length in seconds of the last rendered frame. <a href="class_t_c_o_d_system.html#a589961a2170c3b21fe43bc30aedc03bf">More...</a><br /></td></tr>
<tr class="separator:a589961a2170c3b21fe43bc30aedc03bf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6a7ab32dc1bb1cd78a0318337f0887a0"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a6a7ab32dc1bb1cd78a0318337f0887a0">sleepMilli</a> (uint32_t val)</td></tr>
<tr class="memdesc:a6a7ab32dc1bb1cd78a0318337f0887a0"><td class="mdescLeft"> </td><td class="mdescRight">Use this function to stop the program execution for a specified number of milliseconds. <a href="class_t_c_o_d_system.html#a6a7ab32dc1bb1cd78a0318337f0887a0">More...</a><br /></td></tr>
<tr class="separator:a6a7ab32dc1bb1cd78a0318337f0887a0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a95969dab1cb6b25225e015ad42aaaeb4"><td class="memItemLeft" align="right" valign="top"><a id="a95969dab1cb6b25225e015ad42aaaeb4" name="a95969dab1cb6b25225e015ad42aaaeb4"></a>
static uint32_t </td><td class="memItemRight" valign="bottom"><b>getElapsedMilli</b> ()</td></tr>
<tr class="memdesc:a95969dab1cb6b25225e015ad42aaaeb4"><td class="mdescLeft"> </td><td class="mdescRight">This function returns the number of milliseconds since the program has started. <br /></td></tr>
<tr class="separator:a95969dab1cb6b25225e015ad42aaaeb4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa6c7b08fd607d3fd94700a81b8e6cefd"><td class="memItemLeft" align="right" valign="top"><a id="aa6c7b08fd607d3fd94700a81b8e6cefd" name="aa6c7b08fd607d3fd94700a81b8e6cefd"></a>
static float </td><td class="memItemRight" valign="bottom"><b>getElapsedSeconds</b> ()</td></tr>
<tr class="memdesc:aa6c7b08fd607d3fd94700a81b8e6cefd"><td class="mdescLeft"> </td><td class="mdescRight">This function returns the number of seconds since the program has started. <br /></td></tr>
<tr class="separator:aa6c7b08fd607d3fd94700a81b8e6cefd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9688e693ce6b6af18a02523fd4b4654f"><td class="memItemLeft" align="right" valign="top">static TCOD_event_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a9688e693ce6b6af18a02523fd4b4654f">waitForEvent</a> (int eventMask, <a class="el" href="struct_t_c_o_d__key__t.html">TCOD_key_t</a> *key, <a class="el" href="struct_t_c_o_d__mouse__t.html">TCOD_mouse_t</a> *mouse, bool flush)</td></tr>
<tr class="memdesc:a9688e693ce6b6af18a02523fd4b4654f"><td class="mdescLeft"> </td><td class="mdescRight">This function waits for an event from the user. <a href="class_t_c_o_d_system.html#a9688e693ce6b6af18a02523fd4b4654f">More...</a><br /></td></tr>
<tr class="separator:a9688e693ce6b6af18a02523fd4b4654f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aee8ba5dcf5318b676721033a5ddacbe6"><td class="memItemLeft" align="right" valign="top">static TCOD_event_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#aee8ba5dcf5318b676721033a5ddacbe6">checkForEvent</a> (int eventMask, <a class="el" href="struct_t_c_o_d__key__t.html">TCOD_key_t</a> *key, <a class="el" href="struct_t_c_o_d__mouse__t.html">TCOD_mouse_t</a> *mouse)</td></tr>
<tr class="memdesc:aee8ba5dcf5318b676721033a5ddacbe6"><td class="mdescLeft"> </td><td class="mdescRight">This function checks if an event from the user is in the buffer. <a href="class_t_c_o_d_system.html#aee8ba5dcf5318b676721033a5ddacbe6">More...</a><br /></td></tr>
<tr class="separator:aee8ba5dcf5318b676721033a5ddacbe6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a754da5fd1f6c8ab9c8e358d9e8cc7086"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a754da5fd1f6c8ab9c8e358d9e8cc7086">saveScreenshot</a> (const char *filename)</td></tr>
<tr class="memdesc:a754da5fd1f6c8ab9c8e358d9e8cc7086"><td class="mdescLeft"> </td><td class="mdescRight">This function allows you to save the current game screen in a png file, or possibly a bmp file if you provide a filename ending with .bmp. <a href="class_t_c_o_d_system.html#a754da5fd1f6c8ab9c8e358d9e8cc7086">More...</a><br /></td></tr>
<tr class="separator:a754da5fd1f6c8ab9c8e358d9e8cc7086"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa68fab820837f3addb3095cebea6e766"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#aa68fab820837f3addb3095cebea6e766">createDirectory</a> (const char *path)</td></tr>
<tr class="separator:aa68fab820837f3addb3095cebea6e766"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae2eba30c7f68d857cf171c1f79337d76"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#ae2eba30c7f68d857cf171c1f79337d76">deleteDirectory</a> (const char *path)</td></tr>
<tr class="separator:ae2eba30c7f68d857cf171c1f79337d76"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4e58afb8ef2ee8f969a81b833cfaeed3"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a4e58afb8ef2ee8f969a81b833cfaeed3">deleteFile</a> (const char *path)</td></tr>
<tr class="separator:a4e58afb8ef2ee8f969a81b833cfaeed3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9aeebaa2c55febbb2a536152d2ea012f"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a9aeebaa2c55febbb2a536152d2ea012f">isDirectory</a> (const char *path)</td></tr>
<tr class="separator:a9aeebaa2c55febbb2a536152d2ea012f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a978af1fea07e3743c71882067a0bb031"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_t_c_o_d___list.html">TCOD_list_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a978af1fea07e3743c71882067a0bb031">getDirectoryContent</a> (const char *path, const char *pattern)</td></tr>
<tr class="memdesc:a978af1fea07e3743c71882067a0bb031"><td class="mdescLeft"> </td><td class="mdescRight">To get the list of entries in a directory (including sub-directories, except . <a href="class_t_c_o_d_system.html#a978af1fea07e3743c71882067a0bb031">More...</a><br /></td></tr>
<tr class="separator:a978af1fea07e3743c71882067a0bb031"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af07c4f58860fd3f8def701429b8e3aed"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#af07c4f58860fd3f8def701429b8e3aed">fileExists</a> (const char *filename,...)</td></tr>
<tr class="memdesc:af07c4f58860fd3f8def701429b8e3aed"><td class="mdescLeft"> </td><td class="mdescRight">In order to check whether a given file exists in the filesystem. <a href="class_t_c_o_d_system.html#af07c4f58860fd3f8def701429b8e3aed">More...</a><br /></td></tr>
<tr class="separator:af07c4f58860fd3f8def701429b8e3aed"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3e0eca089430c27f5200cfc1de4f26bd"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a3e0eca089430c27f5200cfc1de4f26bd">readFile</a> (const char *filename, unsigned char **buf, size_t *size)</td></tr>
<tr class="memdesc:a3e0eca089430c27f5200cfc1de4f26bd"><td class="mdescLeft"> </td><td class="mdescRight">This is a portable function to read the content of a file from disk or from the application apk (android). <a href="class_t_c_o_d_system.html#a3e0eca089430c27f5200cfc1de4f26bd">More...</a><br /></td></tr>
<tr class="separator:a3e0eca089430c27f5200cfc1de4f26bd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a80c34cc60181517cdc9b5beb4d421378"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a80c34cc60181517cdc9b5beb4d421378">writeFile</a> (const char *filename, unsigned char *buf, uint32_t size)</td></tr>
<tr class="memdesc:a80c34cc60181517cdc9b5beb4d421378"><td class="mdescLeft"> </td><td class="mdescRight">This is a portable function to write some data to a file. <a href="class_t_c_o_d_system.html#a80c34cc60181517cdc9b5beb4d421378">More...</a><br /></td></tr>
<tr class="separator:a80c34cc60181517cdc9b5beb4d421378"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8ab538cb3664980df84287908a16146c"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a8ab538cb3664980df84287908a16146c">registerSDLRenderer</a> (<a class="el" href="class_i_t_c_o_d_s_d_l_renderer.html">ITCODSDLRenderer</a> *renderer)</td></tr>
<tr class="memdesc:a8ab538cb3664980df84287908a16146c"><td class="mdescLeft"> </td><td class="mdescRight">To disable the custom renderer, call the same method with a NULL parameter. Note that to keep libtcod from requiring the SDL headers, the callback parameter is a void pointer. You have to include SDL headers and cast it to SDL_Surface in your code.class TCODLIB_API <a class="el" href="class_i_t_c_o_d_s_d_l_renderer.html">ITCODSDLRenderer</a> { public : virtual void render(void *sdlSurface) = 0; }; static void <a class="el" href="class_t_c_o_d_system.html#a8ab538cb3664980df84287908a16146c" title="To disable the custom renderer, call the same method with a NULL parameter. Note that to keep libtcod...">TCODSystem::registerSDLRenderer(ITCODSDLRenderer *callback)</a>;typedef void (*SDL_renderer_t) (void *sdl_surface); void TCOD_sys_register_SDL_renderer(SDL_renderer_t callback)def renderer ( sdl_surface ) : ... TCOD_sys_register_SDL_renderer( callback ) <a href="class_t_c_o_d_system.html#a8ab538cb3664980df84287908a16146c">More...</a><br /></td></tr>
<tr class="separator:a8ab538cb3664980df84287908a16146c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab70d91408051b349407637a03c203fc9"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#ab70d91408051b349407637a03c203fc9">forceFullscreenResolution</a> (int width, int height)</td></tr>
<tr class="memdesc:ab70d91408051b349407637a03c203fc9"><td class="mdescLeft"> </td><td class="mdescRight">libtcod is not aware of the part of the screen your SDL renderer has updated. <a href="class_t_c_o_d_system.html#ab70d91408051b349407637a03c203fc9">More...</a><br /></td></tr>
<tr class="separator:ab70d91408051b349407637a03c203fc9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9aa79b292d51ba103f6d9cdd7800c6cc"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a9aa79b292d51ba103f6d9cdd7800c6cc">getCurrentResolution</a> (int *width, int *height)</td></tr>
<tr class="memdesc:a9aa79b292d51ba103f6d9cdd7800c6cc"><td class="mdescLeft"> </td><td class="mdescRight">You can get the current screen resolution with getCurrentResolution. <a href="class_t_c_o_d_system.html#a9aa79b292d51ba103f6d9cdd7800c6cc">More...</a><br /></td></tr>
<tr class="separator:a9aa79b292d51ba103f6d9cdd7800c6cc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae52e79f9dc8b5ff81a2f2d1b65fe4603"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#ae52e79f9dc8b5ff81a2f2d1b65fe4603">getFullscreenOffsets</a> (int *offset_x, int *offset_y)</td></tr>
<tr class="memdesc:ae52e79f9dc8b5ff81a2f2d1b65fe4603"><td class="mdescLeft"> </td><td class="mdescRight">If the fullscreen resolution does not matches the console size in pixels, black borders are added. <a href="class_t_c_o_d_system.html#ae52e79f9dc8b5ff81a2f2d1b65fe4603">More...</a><br /></td></tr>
<tr class="separator:ae52e79f9dc8b5ff81a2f2d1b65fe4603"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa3f6e274558edf397084432ae5f8db90"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#aa3f6e274558edf397084432ae5f8db90">getCharSize</a> (int *w, int *h)</td></tr>
<tr class="memdesc:aa3f6e274558edf397084432ae5f8db90"><td class="mdescLeft"> </td><td class="mdescRight">You can get the size of the characters in the font. <a href="class_t_c_o_d_system.html#aa3f6e274558edf397084432ae5f8db90">More...</a><br /></td></tr>
<tr class="separator:aa3f6e274558edf397084432ae5f8db90"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5166aaee7710f7c3001a3e12a1860062"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a5166aaee7710f7c3001a3e12a1860062">updateChar</a> (int asciiCode, int font_x, int font_y, const <a class="el" href="class_t_c_o_d_image.html">TCODImage</a> *img, int x, int y)</td></tr>
<tr class="memdesc:a5166aaee7710f7c3001a3e12a1860062"><td class="mdescLeft"> </td><td class="mdescRight">You can dynamically change the bitmap of a character in the font. <a href="class_t_c_o_d_system.html#a5166aaee7710f7c3001a3e12a1860062">More...</a><br /></td></tr>
<tr class="separator:a5166aaee7710f7c3001a3e12a1860062"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5d51442d7715be19198e4ae1a2c6f13c"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a5d51442d7715be19198e4ae1a2c6f13c">setRenderer</a> (<a class="el" href="console__types_8h.html#a875d34dae7188cfc93d4fecf5f93f208">TCOD_renderer_t</a> renderer)</td></tr>
<tr class="memdesc:a5d51442d7715be19198e4ae1a2c6f13c"><td class="mdescLeft"> </td><td class="mdescRight">As of 1.5.1, libtcod contains 3 different renderers : SDL : historic libtcod renderer. <a href="class_t_c_o_d_system.html#a5d51442d7715be19198e4ae1a2c6f13c">More...</a><br /></td></tr>
<tr class="separator:a5d51442d7715be19198e4ae1a2c6f13c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a32a7c86add58fcfd4c6ac4d8e4a7dd43"><td class="memItemLeft" align="right" valign="top"><a id="a32a7c86add58fcfd4c6ac4d8e4a7dd43" name="a32a7c86add58fcfd4c6ac4d8e4a7dd43"></a>
static <a class="el" href="console__types_8h.html#a875d34dae7188cfc93d4fecf5f93f208">TCOD_renderer_t</a> </td><td class="memItemRight" valign="bottom"><b>getRenderer</b> ()</td></tr>
<tr class="separator:a32a7c86add58fcfd4c6ac4d8e4a7dd43"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a083351dcd4b0d89498789803d7cdfdb4"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a083351dcd4b0d89498789803d7cdfdb4">setClipboard</a> (const char *value)</td></tr>
<tr class="memdesc:a083351dcd4b0d89498789803d7cdfdb4"><td class="mdescLeft"> </td><td class="mdescRight">Takes UTF-8 text and copies it into the system clipboard. On Linux, because an application cannot access the system clipboard unless a window is open, if no window is open the call will do nothing. <a href="class_t_c_o_d_system.html#a083351dcd4b0d89498789803d7cdfdb4">More...</a><br /></td></tr>
<tr class="separator:a083351dcd4b0d89498789803d7cdfdb4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a62434f82380326fe5783844fe70dbbab"><td class="memItemLeft" align="right" valign="top">static char * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_c_o_d_system.html#a62434f82380326fe5783844fe70dbbab">getClipboard</a> ()</td></tr>
<tr class="memdesc:a62434f82380326fe5783844fe70dbbab"><td class="mdescLeft"> </td><td class="mdescRight">Returns the UTF-8 text currently in the system clipboard. <a href="class_t_c_o_d_system.html#a62434f82380326fe5783844fe70dbbab">More...</a><br /></td></tr>
<tr class="separator:a62434f82380326fe5783844fe70dbbab"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5a9b0fbf3e65e72029bfc3c5ad82455b"><td class="memItemLeft" align="right" valign="top"><a id="a5a9b0fbf3e65e72029bfc3c5ad82455b" name="a5a9b0fbf3e65e72029bfc3c5ad82455b"></a>
static int </td><td class="memItemRight" valign="bottom"><b>getNumCores</b> ()</td></tr>
<tr class="separator:a5a9b0fbf3e65e72029bfc3c5ad82455b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0f3ffea9a7e511fbadf1679769bb2061"><td class="memItemLeft" align="right" valign="top"><a id="a0f3ffea9a7e511fbadf1679769bb2061" name="a0f3ffea9a7e511fbadf1679769bb2061"></a>
static TCOD_thread_t </td><td class="memItemRight" valign="bottom"><b>newThread</b> (int(*func)(void *), void *data)</td></tr>
<tr class="separator:a0f3ffea9a7e511fbadf1679769bb2061"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2e18ba05930b3597a4670c04ac78919a"><td class="memItemLeft" align="right" valign="top"><a id="a2e18ba05930b3597a4670c04ac78919a" name="a2e18ba05930b3597a4670c04ac78919a"></a>
static void </td><td class="memItemRight" valign="bottom"><b>deleteThread</b> (TCOD_thread_t th)</td></tr>
<tr class="separator:a2e18ba05930b3597a4670c04ac78919a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac4f89748c5383595afc13adc355309be"><td class="memItemLeft" align="right" valign="top"><a id="ac4f89748c5383595afc13adc355309be" name="ac4f89748c5383595afc13adc355309be"></a>
static void </td><td class="memItemRight" valign="bottom"><b>waitThread</b> (TCOD_thread_t th)</td></tr>
<tr class="separator:ac4f89748c5383595afc13adc355309be"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2abca76cb0fd78be12a82907e2b267de"><td class="memItemLeft" align="right" valign="top"><a id="a2abca76cb0fd78be12a82907e2b267de" name="a2abca76cb0fd78be12a82907e2b267de"></a>
static TCOD_mutex_t </td><td class="memItemRight" valign="bottom"><b>newMutex</b> ()</td></tr>
<tr class="separator:a2abca76cb0fd78be12a82907e2b267de"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a30f7d900d8367e9be03b2d580374a92f"><td class="memItemLeft" align="right" valign="top"><a id="a30f7d900d8367e9be03b2d580374a92f" name="a30f7d900d8367e9be03b2d580374a92f"></a>
static void </td><td class="memItemRight" valign="bottom"><b>mutexIn</b> (TCOD_mutex_t mut)</td></tr>
<tr class="separator:a30f7d900d8367e9be03b2d580374a92f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac69c6302239ff36420b86ef005e144dd"><td class="memItemLeft" align="right" valign="top"><a id="ac69c6302239ff36420b86ef005e144dd" name="ac69c6302239ff36420b86ef005e144dd"></a>
static void </td><td class="memItemRight" valign="bottom"><b>mutexOut</b> (TCOD_mutex_t mut)</td></tr>
<tr class="separator:ac69c6302239ff36420b86ef005e144dd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8b9edb83698284bcb1feddec8030d583"><td class="memItemLeft" align="right" valign="top"><a id="a8b9edb83698284bcb1feddec8030d583" name="a8b9edb83698284bcb1feddec8030d583"></a>
static void </td><td class="memItemRight" valign="bottom"><b>deleteMutex</b> (TCOD_mutex_t mut)</td></tr>
<tr class="separator:a8b9edb83698284bcb1feddec8030d583"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab5ec884bd7747b94fd3cb441388258ca"><td class="memItemLeft" align="right" valign="top"><a id="ab5ec884bd7747b94fd3cb441388258ca" name="ab5ec884bd7747b94fd3cb441388258ca"></a>
static TCOD_semaphore_t </td><td class="memItemRight" valign="bottom"><b>newSemaphore</b> (int initVal)</td></tr>
<tr class="separator:ab5ec884bd7747b94fd3cb441388258ca"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a25582d3c2df33a4afb570e4d8708dca4"><td class="memItemLeft" align="right" valign="top"><a id="a25582d3c2df33a4afb570e4d8708dca4" name="a25582d3c2df33a4afb570e4d8708dca4"></a>
static void </td><td class="memItemRight" valign="bottom"><b>lockSemaphore</b> (TCOD_semaphore_t sem)</td></tr>
<tr class="separator:a25582d3c2df33a4afb570e4d8708dca4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9af6af13ffa897cda81bd4f3a3bc627d"><td class="memItemLeft" align="right" valign="top"><a id="a9af6af13ffa897cda81bd4f3a3bc627d" name="a9af6af13ffa897cda81bd4f3a3bc627d"></a>
static void </td><td class="memItemRight" valign="bottom"><b>unlockSemaphore</b> (TCOD_semaphore_t sem)</td></tr>
<tr class="separator:a9af6af13ffa897cda81bd4f3a3bc627d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9a02e9efef0218017d797cdfbf6d5096"><td class="memItemLeft" align="right" valign="top"><a id="a9a02e9efef0218017d797cdfbf6d5096" name="a9a02e9efef0218017d797cdfbf6d5096"></a>
static void </td><td class="memItemRight" valign="bottom"><b>deleteSemaphore</b> (TCOD_semaphore_t sem)</td></tr>
<tr class="separator:a9a02e9efef0218017d797cdfbf6d5096"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9289f31bcac87c8addacbd1d6c7a5074"><td class="memItemLeft" align="right" valign="top"><a id="a9289f31bcac87c8addacbd1d6c7a5074" name="a9289f31bcac87c8addacbd1d6c7a5074"></a>
static TCOD_cond_t </td><td class="memItemRight" valign="bottom"><b>newCondition</b> ()</td></tr>
<tr class="separator:a9289f31bcac87c8addacbd1d6c7a5074"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a55779a37c50ff5b8e8708aefd5fc753d"><td class="memItemLeft" align="right" valign="top"><a id="a55779a37c50ff5b8e8708aefd5fc753d" name="a55779a37c50ff5b8e8708aefd5fc753d"></a>
static void </td><td class="memItemRight" valign="bottom"><b>signalCondition</b> (TCOD_cond_t sem)</td></tr>
<tr class="separator:a55779a37c50ff5b8e8708aefd5fc753d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af8a86f5c331bff96a355647b07eb3bca"><td class="memItemLeft" align="right" valign="top"><a id="af8a86f5c331bff96a355647b07eb3bca" name="af8a86f5c331bff96a355647b07eb3bca"></a>
static void </td><td class="memItemRight" valign="bottom"><b>broadcastCondition</b> (TCOD_cond_t sem)</td></tr>
<tr class="separator:af8a86f5c331bff96a355647b07eb3bca"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9b179b542ad52fcd9b24326202aa2745"><td class="memItemLeft" align="right" valign="top"><a id="a9b179b542ad52fcd9b24326202aa2745" name="a9b179b542ad52fcd9b24326202aa2745"></a>
static void </td><td class="memItemRight" valign="bottom"><b>waitCondition</b> (TCOD_cond_t sem, TCOD_mutex_t mut)</td></tr>
<tr class="separator:a9b179b542ad52fcd9b24326202aa2745"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aee9d8e85641cfaad8a9d58b687983f67"><td class="memItemLeft" align="right" valign="top"><a id="aee9d8e85641cfaad8a9d58b687983f67" name="aee9d8e85641cfaad8a9d58b687983f67"></a>
static void </td><td class="memItemRight" valign="bottom"><b>deleteCondition</b> (TCOD_cond_t sem)</td></tr>
<tr class="separator:aee9d8e85641cfaad8a9d58b687983f67"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aee8ba5dcf5318b676721033a5ddacbe6" name="aee8ba5dcf5318b676721033a5ddacbe6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee8ba5dcf5318b676721033a5ddacbe6">◆ </a></span>checkForEvent()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static TCOD_event_t TCODSystem::checkForEvent </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>eventMask</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_t_c_o_d__key__t.html">TCOD_key_t</a> * </td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_t_c_o_d__mouse__t.html">TCOD_mouse_t</a> * </td>
<td class="paramname"><em>mouse</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This function checks if an event from the user is in the buffer. </p>
<p >The eventMask shows what events we're waiting for. The return value indicate what event was actually found. Values in key and mouse structures are updated accordingly.</p>
<p >TCOD_EVENT_KEY_PRESS=1, TCOD_EVENT_KEY_RELEASE=2, TCOD_EVENT_KEY=TCOD_EVENT_KEY_PRESS|TCOD_EVENT_KEY_RELEASE, TCOD_EVENT_MOUSE_MOVE=4, TCOD_EVENT_MOUSE_PRESS=8, TCOD_EVENT_MOUSE_RELEASE=16, TCOD_EVENT_MOUSE=TCOD_EVENT_MOUSE_MOVE|TCOD_EVENT_MOUSE_PRESS|TCOD_EVENT_MOUSE_RELEASE, TCOD_EVENT_ANY=TCOD_EVENT_KEY|TCOD_EVENT_MOUSE, } TCOD_event_t; static TCOD_event_t <a class="el" href="class_t_c_o_d_system.html#aee8ba5dcf5318b676721033a5ddacbe6" title="This function checks if an event from the user is in the buffer.">TCODSystem::checkForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse)</a></p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">eventMask</td><td>event types to wait for (other types are discarded) </td></tr>
<tr><td class="paramname">key</td><td>updated in case of a key event. Can be null if eventMask contains no key event type </td></tr>
<tr><td class="paramname">mouse</td><td>updated in case of a mouse event. Can be null if eventMask contains no mouse event type</td></tr>
</table>
</dd>
</dl>
<p><a class="el" href="struct_t_c_o_d__key__t.html">TCOD_key_t</a> key; <a class="el" href="struct_t_c_o_d__mouse__t.html">TCOD_mouse_t</a> mouse; TCOD_event_t ev = TCODSystem::checkForEvent(TCOD_EVENT_ANY,&key,&mouse); if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... }</p>
<p ><a class="el" href="struct_t_c_o_d__key__t.html">TCOD_key_t</a> key; <a class="el" href="struct_t_c_o_d__mouse__t.html">TCOD_mouse_t</a> mouse; TCOD_event_t ev = TCOD_sys_check_for_event(TCOD_EVENT_ANY,&key,&mouse); if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } </p>
</div>
</div>
<a id="aa68fab820837f3addb3095cebea6e766" name="aa68fab820837f3addb3095cebea6e766"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa68fab820837f3addb3095cebea6e766">◆ </a></span>createDirectory()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool TCODSystem::createDirectory </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>path</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p >Those are a few function that cannot be easily implemented in a portable way in C/C++. They have no Python wrapper since Python provides its own builtin functions. All those functions return false if an error occurred.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">path</td><td>Directory path. The immediate father directory (<path>/..) must exist and be writable. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ae2eba30c7f68d857cf171c1f79337d76" name="ae2eba30c7f68d857cf171c1f79337d76"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae2eba30c7f68d857cf171c1f79337d76">◆ </a></span>deleteDirectory()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool TCODSystem::deleteDirectory </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>path</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">path</td><td>directory path. This directory must exist, be writable and empty </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a4e58afb8ef2ee8f969a81b833cfaeed3" name="a4e58afb8ef2ee8f969a81b833cfaeed3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e58afb8ef2ee8f969a81b833cfaeed3">◆ </a></span>deleteFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool TCODSystem::deleteFile </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>path</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">path</td><td>File path. This file must exist and be writable. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="af07c4f58860fd3f8def701429b8e3aed" name="af07c4f58860fd3f8def701429b8e3aed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af07c4f58860fd3f8def701429b8e3aed">◆ </a></span>fileExists()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool TCODSystem::fileExists </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname"><em>...</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>In order to check whether a given file exists in the filesystem. </p>
<p >Useful for detecting errors caused by missing files.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>the file name, using printf-like formatting </td></tr>
<tr><td class="paramname">...</td><td>optional arguments for filename formatting</td></tr>
</table>
</dd>
</dl>
<p>if (!TCODSystem<a class="el" href="class_t_c_o_d_system.html#af07c4f58860fd3f8def701429b8e3aed" title="In order to check whether a given file exists in the filesystem.">fileExists</a>("myfile.%s","txt")) { fprintf(stderr,"no such file!"); }</p>
<p >if (!TCOD_sys_file_exists("myfile.%s","txt")) { fprintf(stderr,"no such file!"); } </p>
</div>
</div>
<a id="ab70d91408051b349407637a03c203fc9" name="ab70d91408051b349407637a03c203fc9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab70d91408051b349407637a03c203fc9">◆ </a></span>forceFullscreenResolution()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void TCODSystem::forceFullscreenResolution </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>height</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>libtcod is not aware of the part of the screen your SDL renderer has updated. </p>
<p >If no change occurred in the console, it won't redraw them except if you tell him to do so with this function</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">x,y,w,h</td><td>Part of the root console you want to redraw even if nothing has changed in the console back/fore/char.</td></tr>
</table>
</dd>
</dl>
<p>This function allows you to force the use of a specific resolution in fullscreen mode. The default resolution depends on the root console size and the font character size.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">width,height</td><td>Resolution to use when switching to fullscreen. Will use the smallest available resolution so that : resolution width >= width and resolution width >= root console width * font char width resolution width >= height and resolution height >= root console height * font char height</td></tr>
</table>
</dd>
</dl>
<p>TCODSystem::forceFullscreenResolution(800,600); // use 800x600 in fullscreen instead of 640x400 <a class="el" href="class_t_c_o_d_console.html#a62995995a3e61210697f1ee72ece387b" title="static void TCODConsole::initRoot(int w, int h, string title) static void TCODConsole::initRoot(int w...">TCODConsole::initRoot</a>(80,50,"",true); // 80x50 console with 8x8 char => 640x400 default resolution</p>
<p >TCOD_sys_force_fullscreen_resolution(800,600); TCOD_console_init_root(80,50,"",true);</p>
<p >libtcod.sys_force_fullscreen_resolution(800,600) libtcod.console_init_root(80,50,"",True)</p>
<p >tcod.system.forceFullscreenResolution(800,600) – use 800x600 in fullscreen instead of 640x400 tcod.console.initRoot(80,50,"",true) – 80x50 console with 8x8 char => 640x400 default resolution </p>
</div>
</div>
<a id="aa3f6e274558edf397084432ae5f8db90" name="aa3f6e274558edf397084432ae5f8db90"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa3f6e274558edf397084432ae5f8db90">◆ </a></span>getCharSize()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void TCODSystem::getCharSize </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"><em>w</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>h</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>You can get the size of the characters in the font. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">width,height</td><td>contains a character size when the function returns </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a62434f82380326fe5783844fe70dbbab" name="a62434f82380326fe5783844fe70dbbab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a62434f82380326fe5783844fe70dbbab">◆ </a></span>getClipboard()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static char * TCODSystem::getClipboard </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the UTF-8 text currently in the system clipboard. </p>
<p >On Linux, because an application cannot access the system clipboard unless a window is open, if no window is open an empty string will be returned. For C and C++, note that the pointer is borrowed, and libtcod will take care of freeing the memory. </p>
</div>
</div>
<a id="a9aa79b292d51ba103f6d9cdd7800c6cc" name="a9aa79b292d51ba103f6d9cdd7800c6cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9aa79b292d51ba103f6d9cdd7800c6cc">◆ </a></span>getCurrentResolution()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void TCODSystem::getCurrentResolution </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>height</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>You can get the current screen resolution with getCurrentResolution. </p>
<p >You can use it for example to get the desktop resolution before initializing the root console.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">width,height</td><td>contains current resolution when the function returns </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a978af1fea07e3743c71882067a0bb031" name="a978af1fea07e3743c71882067a0bb031"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a978af1fea07e3743c71882067a0bb031">◆ </a></span>getDirectoryContent()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="struct_t_c_o_d___list.html">TCOD_list_t</a> TCODSystem::getDirectoryContent </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>path</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>pattern</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>To get the list of entries in a directory (including sub-directories, except . </p>
<p >and ..). The returned list is allocated by the function and must be deleted by you. All the const char * inside must be also freed with <a class="el" href="class_t_c_o_d_list.html#ada3171ec562496b0cd735eef09aa366e" title="For lists containing pointers, you can clear the list and delete (or free for C) the elements :">TCODList::clearAndDelete</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">path</td><td>a directory </td></tr>
<tr><td class="paramname">pattern</td><td>If NULL or empty, returns all directory entries. Else returns only entries matching the pattern. The pattern is NOT a regular expression. It can only handle one '*' wildcard. Examples : *.png, saveGame*, font*.png </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ae52e79f9dc8b5ff81a2f2d1b65fe4603" name="ae52e79f9dc8b5ff81a2f2d1b65fe4603"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae52e79f9dc8b5ff81a2f2d1b65fe4603">◆ </a></span>getFullscreenOffsets()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void TCODSystem::getFullscreenOffsets </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"><em>offset_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>offset_y</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>If the fullscreen resolution does not matches the console size in pixels, black borders are added. </p>
<p >This function returns the position in pixels of the console top left corner in the screen.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">offset_x,offset_y</td><td>contains the position of the console on the screen when using fullscreen mode. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a589961a2170c3b21fe43bc30aedc03bf" name="a589961a2170c3b21fe43bc30aedc03bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a589961a2170c3b21fe43bc30aedc03bf">◆ </a></span>getLastFrameLength()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static float TCODSystem::getLastFrameLength </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This function returns the length in seconds of the last rendered frame. </p>
<p >You can use this value to update every time dependent object in the world.</p>
<p >moving an objet at 5 console cells per second float x=0,y=0; // object coordinates x += 5 * <a class="el" href="class_t_c_o_d_system.html#a589961a2170c3b21fe43bc30aedc03bf" title="This function returns the length in seconds of the last rendered frame.">TCODSystem::getLastFrameLength()</a>; TCODConsole::root->putChar((int)(x),(int)(y),'X');</p>
<p >float x=0,y=0; x += 5 * <a class="el" href="sys_8h.html#a2b9f8e28e717372edec11d983a1cedc3" title="Get the delta time between the last two frames.">TCOD_sys_get_last_frame_length()</a>; TCOD_console_put_char(NULL,(int)(x),(int)(y),'X');</p>
<p >x=0.0 y=0.0 x += 5 * libtcod.sys_get_last_frame_length() libtcod.console_put_char(0,int(x),int(y),'X')</p>
<p >– moving an objet at 5 console cells per second x=0 y=0 – object coordinates x = x + 5 * tcod.system.getLastFrameLength() libtcod.TCODConsole_root:putChar(x,y,'X') </p>
</div>
</div>
<a id="a9aeebaa2c55febbb2a536152d2ea012f" name="a9aeebaa2c55febbb2a536152d2ea012f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9aeebaa2c55febbb2a536152d2ea012f">◆ </a></span>isDirectory()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool TCODSystem::isDirectory </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>path</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">path</td><td>a path to check </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a3e0eca089430c27f5200cfc1de4f26bd" name="a3e0eca089430c27f5200cfc1de4f26bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e0eca089430c27f5200cfc1de4f26bd">◆ </a></span>readFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool TCODSystem::readFile </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char ** </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t * </td>
<td class="paramname"><em>size</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This is a portable function to read the content of a file from disk or from the application apk (android). </p>
<p >buf must be freed with free(buf).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>the file name </td></tr>
<tr><td class="paramname">buf</td><td>a buffer to be allocated and filled with the file content </td></tr>
<tr><td class="paramname">size</td><td>the size of the allocated buffer.</td></tr>
</table>
</dd>
</dl>
<p>unsigned char *buf; uint32_t size; if (<a class="el" href="class_t_c_o_d_system.html#a3e0eca089430c27f5200cfc1de4f26bd" title="This is a portable function to read the content of a file from disk or from the application apk (andr...">TCODSystem::readFile</a>("myfile.dat",&buf,&size)) { do something with buf free(buf); }</p>
<p >if (TCOD_sys_read_file("myfile.dat",&buf,&size)) { do something with buf free(buf); } </p>
</div>
</div>
<a id="a8ab538cb3664980df84287908a16146c" name="a8ab538cb3664980df84287908a16146c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8ab538cb3664980df84287908a16146c">◆ </a></span>registerSDLRenderer()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void TCODSystem::registerSDLRenderer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_i_t_c_o_d_s_d_l_renderer.html">ITCODSDLRenderer</a> * </td>
<td class="paramname"><em>renderer</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>To disable the custom renderer, call the same method with a NULL parameter. Note that to keep libtcod from requiring the SDL headers, the callback parameter is a void pointer. You have to include SDL headers and cast it to SDL_Surface in your code.class TCODLIB_API <a class="el" href="class_i_t_c_o_d_s_d_l_renderer.html">ITCODSDLRenderer</a> { public : virtual void render(void *sdlSurface) = 0; }; static void <a class="el" href="class_t_c_o_d_system.html#a8ab538cb3664980df84287908a16146c" title="To disable the custom renderer, call the same method with a NULL parameter. Note that to keep libtcod...">TCODSystem::registerSDLRenderer(ITCODSDLRenderer *callback)</a>;typedef void (*SDL_renderer_t) (void *sdl_surface); void TCOD_sys_register_SDL_renderer(SDL_renderer_t callback)def renderer ( sdl_surface ) : ... TCOD_sys_register_SDL_renderer( callback ) </p>
<p >You can register a callback that will be called after the libtcod rendering phase, but before the screen buffer is swapped. This callback receives the screen SDL_Surface reference. This makes it possible to use any SDL drawing functions (including openGL) on top of the libtcod console.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">callback</td><td>The renderer to call before swapping the screen buffer. If NULL, custom rendering is disabled</td></tr>
</table>
</dd>
</dl>
<p>class MyRenderer : public <a class="el" href="class_i_t_c_o_d_s_d_l_renderer.html">ITCODSDLRenderer</a> { public : void render(void *sdlSurface) { SDL_Surface *s = (SDL_Surface *)sdlSurface; ... draw something on s } }; TCODSystem::registerSDLRenderer(new MyRenderer());</p>
<p >void my_renderer( void *sdl_surface ) { SDL_Surface *s = (SDL_Surface *)sdl_surface; ... draw something on s } TCOD_sys_register_SDL_renderer(my_renderer);</p>
<p >def my_renderer(sdl_surface) : ... draw something on sdl_surface using pygame libtcod.sys_register_SDL_renderer(my_renderer) </p>
</div>
</div>
<a id="a754da5fd1f6c8ab9c8e358d9e8cc7086" name="a754da5fd1f6c8ab9c8e358d9e8cc7086"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a754da5fd1f6c8ab9c8e358d9e8cc7086">◆ </a></span>saveScreenshot()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void TCODSystem::saveScreenshot </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>filename</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This function allows you to save the current game screen in a png file, or possibly a bmp file if you provide a filename ending with .bmp. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>Name of the file. If NULL, a filename is automatically generated with the form "./screenshotNNN.png", NNN being the first free number (if a file named screenshot000.png already exist, screenshot001.png will be used, and so on...). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a083351dcd4b0d89498789803d7cdfdb4" name="a083351dcd4b0d89498789803d7cdfdb4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a083351dcd4b0d89498789803d7cdfdb4">◆ </a></span>setClipboard()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool TCODSystem::setClipboard </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Takes UTF-8 text and copies it into the system clipboard. On Linux, because an application cannot access the system clipboard unless a window is open, if no window is open the call will do nothing. </p>
<p >With these functions, you can copy data in your operating system's clipboard from the game or retrieve data from the clipboard.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">value</td><td>UTF-8 text to copy into the clipboard </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a557976239dea6ec766f556d4049d1cc8" name="a557976239dea6ec766f556d4049d1cc8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a557976239dea6ec766f556d4049d1cc8">◆ </a></span>setFps()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void TCODSystem::setFps </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>val</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The setFps function allows you to limit the number of frames per second. If a frame is rendered faster than expected, the TCOD_console_flush function will wait so that the frame rate never exceed this value. You can call this function during your game initialization. You can dynamically change the frame rate. Just call this function once again. <b>You should always limit the frame rate, except during benchmarks, else your game will use 100% of the CPU power</b> </p>
<p >These are functions specifically aimed at real time game development.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">val</td><td>Maximum number of frames per second. 0 means unlimited frame rate. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a5d51442d7715be19198e4ae1a2c6f13c" name="a5d51442d7715be19198e4ae1a2c6f13c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d51442d7715be19198e4ae1a2c6f13c">◆ </a></span>setRenderer()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void TCODSystem::setRenderer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="console__types_8h.html#a875d34dae7188cfc93d4fecf5f93f208">TCOD_renderer_t</a> </td>
<td class="paramname"><em>renderer</em></td><td>)</td>
<td></td>
</tr>
</table>