I want to make a 2D table card game with Allegro, but I also want the cards to flip onto the table which would require: a depth buffer, creating OpenGL textures from pngs, and creating VBOs for the card planes. I would be basically reinventing many elements of Allegro. I was wondering if Allegro might have a simple and convenient way of doing something like this? Games Like World Of Goo also implement something similar with a goo mesh when you fill the bottle with goo. Is there a simple way to incorporate these things? Would the primitives addon be what I'm looking for? Can it texture a 2 sided plane eg: a card? Can Allegro do transformations for depth?
Thanks
would require: a depth buffer, creating OpenGL textures from pngs, and creating VBOs for the card planes. I would be basically reinventing many elements of Allegro. I was wondering if Allegro might have a simple and convenient way of doing something like this?
Allegro can create the OpenGL context and create the main framebuffer, load OpenGL extensions (if required) for VBO, and convert BITMAP* to OpenGL texture (GLuint).
The depth buffer and VBOs are done via OpenGL directly. They're simple to learn.
Is this possible with A4? If so, I have put too much work in my first game... I ended up making an animation for each and putting all frames of those animations in one big bitmap... 20MB+
If you are just starting on this, I would suggest beginning with A5. Only stick with A4 if its an existing project.
Is this possible with A4? If so, I have put too much work in my first game... I ended up making an animation for each and putting all frames of those animations in one big bitmap... 20MB+
It is possible with Allegro 4 via the AllegroGL addon (all a part of the 4.4 download).
If you are using OpenGL, you can easily convert your Allegro 4 project to Allegro 5 if you wish.
I am not, that's why I had to make a 20MB+ bitmap... but that's almost half a year ago. I quit that project, and it's finished(look at my site for Projects->Memory).
I've been able to mix 3D and 2D with A5 easily. I even made a mockup to test it:
{"name":"603432","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/9\/e974ba1f88995769114b52b3034cdb5a.png","w":822,"h":526,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/9\/e974ba1f88995769114b52b3034cdb5a"}
a depth buffer
Since you claim that your game is simply going to be a 2D card game, you can just use the Depth buffer that Allegro creates for you.
creating OpenGL textures from pngs
No need to, you can use al_get_opengl_texture to retrieve the OpenGL texture id, ready to use with any OpenGL code you want.
VBOs
Since we're talking about just card planes, just rendering two quads(one for the back and one for the front) should do the trick right? It's not about reinventing so much in that case. Be sure to set up the proper projection before, and then just switch back to the Orthographic one.
Games Like World Of Goo also implement something similar with a goo mesh when you fill the bottle with goo.
If you're looking for that effect, I think you should just refer to al_draw_prim. Be aware that you might have some artifacts such as the one described in this thread, which is not Allegro related but just the way a quad is rendered on 2D projection.