allegro5

Running Allegro 5 on other computers

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-29 09:43:05
问题 I have made an allegro simple game . But when I open the *.exe file on another computer it says that there are many missing .dll files . How can I make my game to run on other computers without Visual Studio and Allegro 5 library installed ? 回答1: Longer version of my comment: When you created your application, it links to certain DLL's that exist on your computer. When you distribute your game, you will either need to ZIP the DLL's along with your .exe or package them using package creators

Allegro 5: al_load_bitmap not working

限于喜欢 提交于 2019-12-25 08:59:39
问题 I'm developing an Allegro-library based framework for simple game development in C++, and so far I haven't had a single problem with Allegro. Now, though, for my bitmap-extension class, nfImage (Line 196), when I use my "nfImage.loadFromFile" function (Line 1429) it doesn't want to load a perfectly legitimate PNG file I made in MS Paint. The file wouldn't fit in this post, so the code's here. When I try to load "hello.png" it gives me my "Neil's Framework: al_load_bitmap failed to load the

How do I link Allegro 5 from my Makefile?

萝らか妹 提交于 2019-12-24 03:35:23
问题 I need to link the Allegro Game Development Library from my Makefile . When I do this, the compiler returns: Undefinied Reference < Function Name >. 回答1: Before trying to embed the compilation line into the Makefile, make sure you understand how to do it the command line, and more important, make sure it works: g++ hello.cpp -o hello -I/usr/include/allegro5 -L/usr/lib -lallegro Then, a simple Makefile to compile hello.cpp could be: CXX=g++ CFLAGS= LDFLAGS=-L/usr/lib -lallegro INCLUDE=-I. -I

loading a bitmap image to a certain size

南楼画角 提交于 2019-12-23 19:18:14
问题 Im trying to load a bitmap to a certain size using allegro. al_crate_bitmap(x,y) - creates a bitmap to a certain size al_load_bitmap(filename) - loads the image i need, but to its original size. I need to load a bitmap to a size I set. Any ideas? Thanks, Sonny 回答1: The key is al_draw_scaled_bitmap() . With that, you can blit any source bitmap onto the target bitmap at any new size. So you may not actually need to create a new bitmap. You can always use that function to draw the bitmap at a

The procedure entry point _gxx_personality_v0 could not be located in the dynamic link library libstdc++-6.dll Error

本小妞迷上赌 提交于 2019-12-21 04:54:29
问题 Yesterday I decided to download, install, and attempt to use Allegro 5. I also downloaded Code::Blocks 12.11 w/ the MinGW compiler. I set up everything and installed everything correctly (or so I thought) and tried to run a sample code to see if it would work: #include <stdio.h> #include <allegro5/allegro.h> int main(int argc, char **argv){ ALLEGRO_DISPLAY *display = NULL; if(!al_init()) { fprintf(stderr, "failed to initialize allegro!\n"); return -1; } display = al_create_display(640, 480);

Xcode 4 and Allegro 5.1 - Linker can't find Framework

泄露秘密 提交于 2019-12-19 11:36:13
问题 I know there are several other questions here regarding the Linker and Xcode 4, but they don't really relate to my problem. I've built Allegro 5.1 and it took me a while because of FreeType, but eventually it worked. Now I've written a little Space Invader game using Allegro. But somehow the linker can't find the framework. What I've done so far: The Frameworks are located at /Library/Frameworks/ and they have the same structure like all the other frameworks in that place I've added the

Xcode 4 and Allegro 5.1 - Linker can't find Framework

我与影子孤独终老i 提交于 2019-12-19 11:36:05
问题 I know there are several other questions here regarding the Linker and Xcode 4, but they don't really relate to my problem. I've built Allegro 5.1 and it took me a while because of FreeType, but eventually it worked. Now I've written a little Space Invader game using Allegro. But somehow the linker can't find the framework. What I've done so far: The Frameworks are located at /Library/Frameworks/ and they have the same structure like all the other frameworks in that place I've added the

Translating x,y while scaling

天大地大妈咪最大 提交于 2019-12-12 05:49:18
问题 I'm trying to graph x,y coordinates where the window size is 600px by 600px. (0,0) would be in the top left. (300,300) middle of the window. (600,600) would be in the bottom right. I am trying to translate latitude/longitude in radians to pixels and then plotting them. I'm calculating 1px = ? lat by `fabs(lborder+rborder)/600` I calculated lon by taking the top and bottom borders. Then when I want to find a specific position for a specific lat or lon: lat/(previous # calculated above) Problem

Checking pixel color Allegro 5 C++

被刻印的时光 ゝ 提交于 2019-12-11 20:38:01
问题 I want to check if a pixel on the screen is red or not . I am using allegro 5 . Here is my code ALLEGRO_BITMAP *bitmap ; int x , y; x=*xIter-20; y=*yIter; ALLEGRO_COLOR red_color = al_map_rgb (255,0,0); ALLEGRO_COLOR new_color = al_get_pixel (bitmap , x , y); if(new_color==red_color) return 1; But it reports a sytnax error error C2678: binary '==' : no operator found which takes a left-hand operand of type 'ALLEGRO_COLOR' (or there is no acceptable conversion) 回答1: unsigned char r,g,b; al