![]() |
|
Smooth Animation |
miguel meza
Member #5,447
January 2005
|
Hi, i am doing the arkanoid game, an for the ball i am using a .bmp file. (i am using winxp and have an nvidia geforce 440go 32ram, pentium4).... thanks.... |
GullRaDriel
Member #3,861
September 2003
![]() |
it's automagically activated if supported (or i'm thinking wrong) You can just check if it is or not. "Code is like shit - it only smells if it is not yours" |
miguel meza
Member #5,447
January 2005
|
if it is activated by default then that's not the solution thanks.... |
Tobias Dammers
Member #2,604
August 2002
![]() |
You don't need to activate anything. Instead, to take advantage of hardware vram blitting, you must do the following: If your hardware supports it, all video-video blits are accelerated. However, I don't think that this is your problem. Unless you're doing something horribly wrong (like loading bitmaps every frame), your machine should be perfectly capable of producing smooth output without hardware accel. If it's not too large, I suggest you post your code here (use code tags). --- |
miguel meza
Member #5,447
January 2005
|
Ok, this is some part of the code: this is my main: int main(int argc , char *argv[]) { srand(time(NULL)); Init(); MainLoop(); return 0; } END_OF_MAIN(); this is the Init method void Init() { // all the graphics and sound initialization // and TIMERS InitializeAllegro(); // load the bitmaps ball =load_bitmap("ball.bmp", NULL); bar = load_bitmap("barra.bmp", NULL); brick = load_bitmap("brick1.bmp", NULL); buffer = create_bitmap(SCREEN_WIDTH, SCREEN_HEIGHT); // OTHER STUFF..... } this is the mainLoop
and this is the MOST important method called in my RenderScene
if i uncomment the the acquire and release bitmaps the result is the same..... |
Jonatan Hedborg
Member #4,886
July 2004
![]() |
I cant see anything wrong with that code, at least now - the acquire_screen and acquire_bitmap are bad. don't use them. Only use acquire_screen if you make more than one consecutive blit to video memory. Anyway, how about posting the logic code and the actual init code?
|
miguel meza
Member #5,447
January 2005
|
ok, here goes mi InitAllegro and Logic code..... Here is the InitializeAllegro and the TIMER code called in "init()"
and here is the "logic" code:
|
Jonatan Hedborg
Member #4,886
July 2004
![]() |
And checkcollision? You could try and add a vsync(); before you blit to screen as well. just for fun...
|
miguel meza
Member #5,447
January 2005
|
my CheckCollision code is unclear, and i dont think that could be the problem because i only do simple math things there, so there is anything related with drawing.... i remove the acquire methods and added vsync() and the result is the same |
|