No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I'm trying to create a function that draws with the mouse using allegro. Here is the original code: [code=cplusplus]int SCREEN_WIDTH; int SCREEN_HEIGHT; BITMAP *buffer; int sandcol; int pthickness; int mx, my, mx2, my2; void ThickLine(BITMAP *bmp, int x, int y, int x_, int y_,int thickness, int color){ int dx = … |
|
so I was wondering how to push int's into an array. In other languages that I learned, I can just call the push() method. But looking around, people say that I need to use priority_queue. What is it and can I use it in Allegro? |
|
I am using dev-c++ with allegro here is the code: [code=cplusplus]#include <allegro.h> int SCREEN_WIDTH; int SCREEN_HEIGHT; BITMAP *buffer; int main(int argc, char *argv[]){ allegro_init(); install_mouse(); SCREEN_WIDTH = 620; SCREEN_HEIGHT = 240; set_color_depth(16); set_gfx_mode( GFX_AUTODETECT_WINDOWED, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); show_mouse(screen); buffer = create_bitmap(SCREEN_WIDTH, SCREEN_HEIGHT); putpixel(buffer,300,300,4); blit(buffer,screen,0,0,0,0,SCREEN_WIDTH,SCREEN_HEIGHT); while(!key[KEY_ESC]){ //do stuff clear_keybuf(); } … |
|
here is the simple code: [code=cplusplus]#include <allegro.h> #include <iostream> using namespace std; int FindArea(int,int); int main(){ int lenghtOfYard; int widthOfYard; int areaOfYard; cout << "\nHow wide is your yard? "; cin >> widthOfYard; cout << "\nHow lond is your yard? "; cin >> lenghtOfYard; areaOfYard= FindArea(lenghtOfYard,widthOfYard); cout << "\nYour yard … |
|
I have this example file that I've been using to get used to the perks of Allegro, but the file is written in an earlier version of Allegro than 4.2.2. There are only a few errors, but I don't know how to fix them! I'll post the code and the … |
|
Re:
Hello, I am having problems with templates. I wrote a templated version of vector. My vector is working. Here is the header file for it: [code=C++] // m_vector_g.h template<typename T> class m_vector { private: // Some code here... public: // Some code here... }; [/code] I want to make another … |