Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » textout problem

This thread is locked; no one can reply to it. rss feed Print
textout problem
Sylvarant
Member #7,886
October 2006

I'm trying to compile a really simple code with just the initialize stuff and a textout but it keeps saying

[Warning] `textout' is deprecated (declared at C:/Dev-C/Dev-Cpp/include/allegro/alcompat.h:155)

code (I'm using dev-c++)

1#include <allegro.h>
2 
3 
4void init();
5void shutdown();
6 
7// main function
8int main() {
9 allegro_init();
10 init();
11 while (!key[KEY_ESC]) {
12 textout(screen,font," try printing text", 0, 0,15);
13 }
14 shutdown();
15 return 0;
16}
17END_OF_MAIN()
18 
19void init() {
20 int depth, res;
21 depth = desktop_color_depth();
22 if (depth == 0) depth = 32;
23 set_color_depth(depth);
24 res = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
25 if (res != 0) {
26 allegro_message(allegro_error);
27 exit(-1);
28 }
29 
30 install_timer();
31 install_keyboard();
32 install_mouse();
33 /* add other initializations here */
34}
35 
36void shutdown() {
37 clear_keybuf();
38 /* add other deinitializations here */
39}

Evert
Member #794
November 2000
avatar

Read what it tells you:

Quote:

[Warning] `textout' is deprecated

That's a warning, your program works just fine. As for getting rid of it, look upthe manual entry for textout_ex.

Go to: