Pure game programming problem
keprast

hello

For example: a rectangle, rotating in the plane. (The actual rotation, not just the camera)
Camera how to follow the rotation?

Edgar Reynaldo
keprast

Thank you for your help. I think it's very useful.

But, obviously, I can't find this example.

NiteHackr

There is no "ex_camera.c" for Allegro 5 (that comes with the source anyhow). Allegro 4 has that though.

I honestly can't find an equivalent example for Allegro 5.

Edgar Reynaldo

Yes, yes there is. It's right there in the examples folder. ex_camera.c .

Yes, Allegro 5 has ex_camera.c .

NiteHackr

The last version of Allegro 5 I have doesn't have it (which honestly surprised me as it used to be there).

Strange. (checks version I have) I have v5.1.9 source on my system... so a little out of date. I just noticed it is in 5.2.2, last compiled version I have, my bad, sorry.

Edgar Reynaldo

I get mine from github with git, so I always have an up to date version. If you'll kindly remember, when we were messing around with skyboxes and opengl = never did get that to work using a triangle fan )Elias pointed out that he updated ex_camera.c to use a skybox.

You should really try building allegro again sometime. It's a very satisfying experience to have it all do what you tell it to. That's the problem with computers, they only do what you tell them to, disregarding hardware failure.

NiteHackr

Elias pointed out that he updated ex_camera.c to use a skybox.

You're right. I checked that out. Looked good.

I dont' use a triangle fan for skyboxes. Just a cube made up of either quads or two triangles per side. There isn't much of a hit on performance no matter which way you do it. I kind of like quads for it so when I view everything in wireframe mode I just see a normal box. I'm not sure how one would do a cube with a triangle fan. Check my City3D source I sent you, you should be able to copy the OpenGL from it straight into Allegro as the OpenGL is independent of that.

I still have yet to build Allegro 5, though I came close. It is a better option, I just always seem to run into problems. Never had a problem with Allegro 4. It's those Allegro 5 dependencies that always get me.

Edgar Reynaldo

I'll teach you a trick. I've already compiled all the dependencies for you.

Use those binaries I gave you. They include the /include and /lib folders for all the dependencies to build allegro yourself. Just use cmake-gui and specify the correct directories and libraries for allegro to link to.

Or you can do like the manual suggests and use the build/deps directory to store the lib and include folders for the dependencies. Makes it easier so I hear.

Just check out allegro from git here : https://github.com/liballeg/allegro5.git

At a c:\ prompt, enter the following :

mkdir allegro
cd allegro
git clone https://github.com/liballeg/allegro5.git
git checkout master
git pull
mkdir build
cd build
mkdir deps
copy c:\path\to\distrofolder\* deps\
mkdir include
mkdir lib
mkdir bin
cmake-gui -DCMAKE_INSTALL_PREFIX=.\ ..
{specify a whole bunch of stuff, hope it sees the deps folder}
make
make install


And you'll note I had to patch several libraries. I'll see if there are newer versions that fix the problems the old ones had.

keprast

@Edgar Reynaldo

Hello, developer.
I play your game, "skyline", I feel there are many deficiencies.
For example, why do I need to press esc to open the menu?
Moreover, there are bug, the upper left corner "aimed Cross" of the screen.

But it is still as it was like, I do not know how to play.

However, although there are many problems, but he still is a complete game.
However, I would like to ask, Allegro supports transparent bitmaps do?

I checked your picture, found a lot of purple background, can not directly use the transparent background?

Edgar Reynaldo

I made skyline in 24 hours. There are bugs I never got around to fixing. It was made with allegro 4 not 5.

keprast

Sorry, I did not notice.
However, Allegro 5 supports a transparent background?

Edgar Reynaldo

Yes , by loading a proper image file such as 32 bit png. I think .tga is supported too.

keprast

Oh, that's awesome.

NiteHackr

My Deluxe Pacman 2 game is written in C using Allegro 5 and it uses all PNGs for the menu buttons etc... all have transparent backgrounds. The player, ghosts, pills etc... are all transparent PNGs.

keprast

@Neil Roy

I also play your game, but as always.
I am still easily eaten by ghosts.
----------------------------------

Talking about, do you have a complete example of moving the Camera?
Can you give me a copy? Right here.

NiteHackr

I'm not exactly certain what you mean by "moving the Camera"? 3D? 2D scrolling?