ayuda con este codigo usando libreria allego en codeblock
Publicado por daniel (1 intervención) el 11/12/2016 17:36:29
no se porque no me compila, cuando le doy compilar y ejecutar me sale una ventana diciendo que el programa a dejado de funcionar, llevo 1 dia buscando solucion a esto y nada que encuentro alguno me podria colaborar?
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
#include <iostream>
#include <allegro.h>
#include <string>
#include <stdlib.h> /* srand, rand */
#include <time.h>
#define ancho 637
#define alto 467
using namespace std;
bool salida=true;
// variable globales
BITMAP *buffer;
BITMAP *principal;
BITMAP *about;
//BITMAP *salir;
//Funciones Prototipo
void Menu();
void Iniciar();
void About();
int main()
{
allegro_init();
install_keyboard();
install_timer();
install_mouse();
set_gfx_mode(GFX_AUTODETECT_WINDOWED,ancho, alto, 0, 0);
if (install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL) != 0)
{
allegro_message("Error: inicializando sistema de sonido\n%s\n", allegro_error);
return 1;
}
set_volume(230, 200);
// definimos el audio del programa
set_color_depth(16);
set_gfx_mode(GFX_AUTODETECT_WINDOWED, ancho, alto, 0, 0);
show_mouse(screen);
buffer = create_bitmap(ancho, alto);
principal= load_bitmap("Imagenes/Principal.bmp",NULL);
about= load_bitmap("Imagenes/About.bmp",NULL);
Menu();
return 0;
}
END_OF_MAIN();
void Menu()
{
blit(principal,screen,0,0,0,0,ancho,alto);
while (!key[KEY_ESC]&&(salida))
{
if ((mouse_x > 12 && mouse_x < 185 && mouse_y > 213 && mouse_y < 372)&&(mouse_b & 1))
{
rest(200);
destroy_bitmap(principal);
Iniciar();
}
else if(mouse_x > 197 && mouse_x < 364 && mouse_y > 210 && mouse_y < 374)
{
destroy_bitmap(about);
About();
}
else if(mouse_x > 380 && mouse_x < 558 && mouse_y > 213 && mouse_y < 370)
{
allegro_exit();
}
else
{
blit(principal,screen,0,0,0,0,ancho,alto);
}
}
}
void Iniciar(){
}
void About(){
}
Valora esta pregunta
0