|
what is wrong? |
Money
Member #6,730
December 2005
|
what is wrong with this code?? the sprite doens't show up on the screen, i checked the source and the .bmp's and i don't understand why the sprite doens't show on the screen, there is just a black screen.
|
GullRaDriel
Member #3,861
September 2003
|
Quote: blit( *iter,... I'm not sure that allegro is able to blit that , but i'm noob at c++ purpose. "Code is like shit - it only smells if it is not yours" |
miran
Member #2,407
June 2002
|
Because you draw only after the main loop and only let the sprite stay on the screen for 50 ms. -- |
GullRaDriel
Member #3,861
September 2003
|
He isn't clearing the screen, it should be right for that. EDIT: And I think He could throw this "rest(50)" line. He will have better results using QueryPerformanceCounter and an adapted loop. "Code is like shit - it only smells if it is not yours" |
miran
Member #2,407
June 2002
|
GullRaDriel: You're missing the point. He's asking why he gets a black screen. The answer is because he doesn't draw anything in the main loop. -- |
GullRaDriel
Member #3,861
September 2003
|
Ho YES ! He didn't put the blit in the loop ! EDIT:
Now this should work ! "Code is like shit - it only smells if it is not yours" |
Money
Member #6,730
December 2005
|
i did put the blit in the loop..its in a while loop |
Jonatan Hedborg
Member #4,886
July 2004
|
No, it isnt. Only your input is in the loop.
|
Money
Member #6,730
December 2005
|
ahhhh, ok wow, all of the nested if and loops and whiles, that was crazy, thank you all so much im such an idiot for not seeing that |
GullRaDriel
Member #3,861
September 2003
|
Quote: im such an idiot for not seeing that Don't be too hard with yourself. I remember having doing such things and more :-p "Code is like shit - it only smells if it is not yours" |
miran
Member #2,407
June 2002
|
Which editor do you use to write your code? I though every decent editor higlights your loops and things like that so it's easy to see what goes where... -- |
GullRaDriel
Member #3,861
September 2003
|
That's how Scite does, for example. DevCpp isn't (Or i don't found how) "Code is like shit - it only smells if it is not yours" |
HoHo
Member #4,534
April 2004
|
devcpp can highlight matching braces too. It was somewhere in the editor options __________ |
Tobias Dammers
Member #2,604
August 2002
|
Notepad however doesn't --- |
Don Freeman
Member #5,110
October 2004
|
Hey Money... I think that set_color_conversion is also in the wrong order, it should be: allegro_init(); install_timer(); install_keyboard(); install_mouse(); set_color_depth(32); set_gfx_mode(GFX_AUTODETECT,800,600,0,0); set_color_conversion(COLORCONV_TOTAL); I'm not exactly sure that it needs to be in that order, but it works fine for me. -- |
Tobias Dammers
Member #2,604
August 2002
|
Doesn't matter when you call set_color_conversion, as long as it's after allegro_init() and before loading the bitmap or datafile. --- |
|