After reading Xception's post on the winbgim library, I decided to check it out. I seemed to have hit a snag, though. No matter what I've tried, the background of the window stays black. The other ones work fine. I can work around this problem, but I would like to fix it.
Oh well, here's my code. It's originally based off the one Xception used.
| CODE |
#define Key_pressed(k) GetAsyncKeyState(k) #include <winbgim.cpp> #include <twodplayerclass.h> #include <twodwallclass.h>
int main() { twodplayer player(320, 240); twodwall wall(16, 16);
initwindow(640,480); //open a 640x480 graphics window ////////////////////////////////////////// setbkcolor(WHITE/2);// this doesn't work ////////////////////////////////////////// setcolor(BLACK);
do // loop { setvisualpage(1); // double setactivepage(0); // buffer clearviewport(); // clear background
//call events player.keyboard(); player.draw(); wall.draw();
delay(10); // delay } while(!Key_pressed(VK_ESCAPE)); // until Escape key pressed closegraph(); //close graphics window return 0; }; |
Forget that library, I also can't get it to work. Download the Allegro Game library for Dev-C++, it's much more powerful and easy to use.
I was just determined to make it work since I spent three hours trying to get it set up in the first place :P
I've had a bunch of other problems too, so I already scrapped it.
I downloaded Allegro a few days ago. Might take a while for me to get started with it.