Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » Thing 1.0

This thread is locked; no one can reply to it. rss feed Print
Thing 1.0
Dustin Dettmer
Member #3,935
October 2003
avatar

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 
4int 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}
19END_OF_MAIN()

DOWNLOAD IT NOW

Steve Terry
Member #1,989
March 2002
avatar

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]
:o 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.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

Dustin Dettmer
Member #3,935
October 2003
avatar

Quote:

So what does this thing have over OpenLayer?

Support for D3D and allegro. OpenLayer just supports OpenGL.

Fladimir da Gorf
Member #1,565
October 2001
avatar

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 ;)

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Michael Faerber
Member #4,800
July 2004
avatar

Quote:

And I still think our projects should be merged ;)

You forget about the C zealots. ;)

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

Simon Parzer
Member #3,330
March 2003
avatar

I already have something better.

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

You forget about the C zealots.

Well, the Thing is made with C++ as well.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Paul whoknows
Member #5,081
September 2004
avatar

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.

____

"The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner.

Elverion
Member #6,239
September 2005
avatar

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?

--
SolarStrike Software - MicroMacro home - Automation software.

Dustin Dettmer
Member #3,935
October 2003
avatar

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.

juvinious
Member #5,145
October 2004
avatar

I agree with flad that the two projects should be merged.

__________________________________________
Paintown

Go to: