Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ Programing with out header files Pin
CPallini16-Dec-13 9:13
mveCPallini16-Dec-13 9:13 
GeneralRe: C++ Programing with out header files Pin
Stefan_Lang16-Dec-13 21:36
Stefan_Lang16-Dec-13 21:36 
AnswerRe: C++ Programing with out header files Pin
Stefan_Lang15-Dec-13 23:31
Stefan_Lang15-Dec-13 23:31 
GeneralRe: C++ Programing with out header files Pin
Richard MacCutchan16-Dec-13 3:30
mveRichard MacCutchan16-Dec-13 3:30 
AnswerRe: C++ Programing with out header files Pin
tgsb22-Dec-13 22:43
tgsb22-Dec-13 22:43 
QuestionOpenGL - Change Torus color into Red instead Grey Color Pin
M Riaz Bashir15-Dec-13 1:29
M Riaz Bashir15-Dec-13 1:29 
AnswerRe: OpenGL - Change Torus color into Red instead Grey Color Pin
AmbiguousName16-Dec-13 22:32
AmbiguousName16-Dec-13 22:32 
QuestionAllegro Dev C++ program crash Pin
ashutoshrambhal14-Dec-13 23:53
ashutoshrambhal14-Dec-13 23:53 
Hello, I am making a Ball Breaker game and i have got some unusual crsh error in main when i call b.fill_bricks(); and when i press esc button it crashes.if i use it without class,everything works fine but in class it won't.Plz give me a solution.

#include <allegro.h>
BITMAP *buffer;
class Bricks {

public:
int bricks_array[4][5];
void display_Bricks();
int fill_bricks();
};

int Bricks::fill_bricks()
{
for(int i = 0;i<4;i++)//layer
{
for(int j = 0;j<10;j++)//brick_no
{
bricks_array[i][j] = 0;
}
}
return 0;
}

void Bricks::display_Bricks()
{
int x=50,y=25;

for(int i = 0;i<4;i++)//layer
{
for(int j = 0;j<10;j++) //brick_no
{
if(bricks_array[i][j] == 0)
{
rect(buffer,x,y,x+100,y+50,makecol(225,225,225));
}
x += 50;
}
y += 25;
x = 50;
}

}

void init();
void deinit();

int main() {
init();
Bricks b;
b.fill_bricks();

acquire_screen();
b.display_Bricks();
draw_sprite(screen,buffer,0,0);
release_screen();

while(!key[KEY_ESC]){}
//deinit();
return 0;
}
END_OF_MAIN()

void init() {
int depth, res;
allegro_init();
buffer = create_bitmap(640,480);
clear(buffer);
depth = desktop_color_depth();
if (depth == 0) depth = 32;
set_color_depth(depth);
res = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
if (res != 0) {
allegro_message(allegro_error);
exit(-1);
}

install_timer();
install_keyboard();
install_mouse();
/* add other initializations here */
}

void deinit() {
clear(buffer);
clear_keybuf();
/* add other deinitializations here */
}
AnswerRe: Allegro Dev C++ program crash Pin
Richard MacCutchan15-Dec-13 0:38
mveRichard MacCutchan15-Dec-13 0:38 
GeneralRe: Allegro Dev C++ program crash Pin
ashutoshrambhal15-Dec-13 2:46
ashutoshrambhal15-Dec-13 2:46 
GeneralRe: Allegro Dev C++ program crash Pin
Richard MacCutchan15-Dec-13 2:59
mveRichard MacCutchan15-Dec-13 2:59 
QuestionRich edit control and caption Pin
RaymondM14-Dec-13 1:43
RaymondM14-Dec-13 1:43 
SuggestionRe: Rich edit control and caption Pin
Richard MacCutchan15-Dec-13 0:34
mveRichard MacCutchan15-Dec-13 0:34 
AnswerRe: Rich edit control and caption Pin
enhzflep15-Dec-13 3:56
enhzflep15-Dec-13 3:56 
QuestionNON MFC / WINAPI Problem related to Process and Files. Pin
lokesh.mavale13-Dec-13 13:07
lokesh.mavale13-Dec-13 13:07 
QuestionExtract RGB Colors Pin
Django_Untaken13-Dec-13 1:31
Django_Untaken13-Dec-13 1:31 
AnswerRe: Extract RGB Colors Pin
Richard MacCutchan13-Dec-13 1:49
mveRichard MacCutchan13-Dec-13 1:49 
AnswerRe: Extract RGB Colors Pin
CPallini13-Dec-13 3:06
mveCPallini13-Dec-13 3:06 
AnswerRe: Extract RGB Colors Pin
Eugen Podsypalnikov13-Dec-13 3:18
Eugen Podsypalnikov13-Dec-13 3:18 
QuestionC pointer and array question [Resolved] Pin
econy12-Dec-13 20:07
econy12-Dec-13 20:07 
AnswerRe: C pointer and array question Pin
econy12-Dec-13 20:19
econy12-Dec-13 20:19 
AnswerRe: C pointer and array question [Resolved] Pin
Richard MacCutchan12-Dec-13 21:19
mveRichard MacCutchan12-Dec-13 21:19 
AnswerRe: C pointer and array question [Resolved] Pin
Stefan_Lang12-Dec-13 22:42
Stefan_Lang12-Dec-13 22:42 
GeneralRe: C pointer and array question [Resolved] Pin
econy16-Dec-13 9:14
econy16-Dec-13 9:14 
GeneralRe: C pointer and array question [Resolved] Pin
Stefan_Lang16-Dec-13 21:25
Stefan_Lang16-Dec-13 21:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.