After talking with juv a bunch, I've decided to release Thing version 1.0
I don't have a good name for it yet, so I'm calling it thing.
Basically it wraps allegro (triple buffer, page flipping, double buffer etc), Opengl and Direct3D. You get a nice little 2D gfx interface that can go where no game has gone before!
Well maybe they have gone there before but at least you can get there easily.
Heres an example program that gives you a green screen:
| 1 | #include "conf.h" |
| 2 | #include "bitmap.h" |
| 3 | |
| 4 | int main() |
| 5 | { |
| 6 | allegro_init(); |
| 7 | |
| 8 | Conf conf(Conf::WINDOWED, Conf::HARDWARE); |
| 9 | |
| 10 | conf.beginScene(); |
| 11 | conf.clearScreen(); |
| 12 | |
| 13 | Bitmap::rect(0, 0, 640, 480, Tint(0, 1, 0)); |
| 14 | |
| 15 | conf.flip(); |
| 16 | |
| 17 | readkey(); |
| 18 | } |
| 19 | END_OF_MAIN() |
Thanks Dustin, I'll see if I can't use it in my current game project, that's what my Display class was going to do anyway, it just does double buffering at the moment though.
[edit]
what's one hell of a lot of linker options ^_^
So what does this thing have over OpenLayer?
[/edit]
In Conf.cpp you have included aldumb.h... this file is not needed.
So what does this thing have over OpenLayer?
Support for D3D and allegro. OpenLayer just supports OpenGL.
Why's a color called Tint? The tint-parameter in Bitmap's drawing routines doesn't tint the image, but instead is multiplied with the pixel colors.
Why does Bitmap have the primitive routines as static methods? And why can't the obviously overloaded methods have the same name? And all the drawing goes to the screen, so why to give such long names for the methods (magicBlitToScreen). Also, non-power-of-two Bitmaps are just crudely stretched.
However, the code is pretty clean and quite easy to read.
And I still think our projects should be merged
And I still think our projects should be merged
You forget about the C zealots.
I already have something better.
You forget about the C zealots.
Well, the Thing is made with C++ as well.
I have an idea.
Chose an allegro example, like exsprite.c, and add some lines of code to show us how your thing works, running under all possible configurations.
I haven't really messed around with it, but I do have some questions. Is there some way to explicitly use either D3D or OGL at your choice, or does it autodetect what it thinks will be best? Is Allegro necessary, or can it operate (graphics at least) solely on its own? Bitmap::rect... I see no parameter telling it which bitmap to draw to. Is it always assumed it will be drawing to the screen, with no way to change this? Oh, and with Tint...is there alpha available or only RGB?
Tint has the following attributes:
r
g
b
a
additiveBlending
You can access them in that order with the constructor. Tint(r, g, b, a, additiveBlending).
The second parameter to Conf::Conf can be Conf::SOFTWARE, Conf::HARDWARE, or Conf::D3D.
Originally there wasn't going to be a D3D driver, which is why OpenGL is named HARDWARE.
I agree with flad that the two projects should be merged.