Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Allegro Simplificator

This thread is locked; no one can reply to it. rss feed Print
 1   2   3   4 
Allegro Simplificator
Jennifer Perkins
Member #8,203
January 2007

Hello All,
I'm attempting to add the Allegro Simplificator to my Dev C++/Allegro setup. I have no idea how to do this, but I need to be able to use the Allegro code utilizing C++ classes. If anyone can help I would appreciate it soooooo much. Any advice etc... will be GREAT!

Thanks so much ???

Neil Walker
Member #210
April 2000
avatar

I know nothing of that sourceforge project, but you could always try out my AXL system, which handles all allegro configurations, animations, game time, etc. AXL is as my sig, just have a read of the online documentation. Don't know if it's the same thing.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Ariesnl
Member #2,902
November 2002
avatar

Allegro is written in plain C
Try OpenLayer ( wich is a C++ wrapper for allegro and also boosts your FPS)

It comes ready to use without having to compile al sort of stuff yourself

(And Welcome to Allegro.cc ;D)

Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard)
Current project: [Star Trek Project ] Join if you want ;-)

gnolam
Member #2,030
March 2002
avatar

Don't double post.

Quote:

Allegro is written in plain C

And is as such perfectly usable in C++.

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

CGamesPlay
Member #2,559
July 2002
avatar

I don't know what the "Allegro Simplificator" is, but you can use C++ with Allegro just fine... Omigosh, deja vu.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Jennifer Perkins
Member #8,203
January 2007

Thank you so much. I'm so glad you guys are so helpful. I'm very grateful for the advice and I'm sure I'll be back to the forums often. I hate to admit it, but I teach programming classes and I want to incorporate allegro into them, and I'm trying to figure it all out first. :-) I have to teach the class in C++ and need to be able to have the students add to classes, create classes incorporating several concepts we will cover in class etc. Thank Goodness for the grad students, they are very involved with this as well and are really enthusiastic. I'm sure I'll be back asking for your help as well. So thanks for the warm welcome, sometimes it can be intimidating asking for help from the gurus. But I'm the first one to tell my students that I don't know everything and if I don't know I'll try to find the answer.
Any advice you want to send my way -- shoot. I'm totally receptive to new ideas.

A struggling teacher trying to give the students something fun to do,
Jennifer :)

Ariesnl
Member #2,902
November 2002
avatar

Quote:

[Quote]
Allegro is written in plain C

And is as such perfectly usable in C++.
</quote>

True, but you won't have any base classes to derive from..

If you want to derive classes use OpenLayer (it's also a lot faster than plain Allegro)

Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard)
Current project: [Star Trek Project ] Join if you want ;-)

Jennifer Perkins
Member #8,203
January 2007

Oh yes, that's exactly what I need to be able to do. Ya'll are soooo great. Going to download it now. Is there anything I need to know about installing it that will keep me from screwing it up? ;D

Richard Phipps
Member #1,632
November 2001
avatar

If you are using windows you should just be able to run the build utility and have it set it up for you.

Epsi
Member #5,731
April 2005
avatar

Quote:

Oh yes, that's exactly what I need to be able to do. Ya'll are soooo great. Going to download it now. Is there anything I need to know about installing it that will keep me from screwing it up?

Well OpenLayer needs hardware accelerated video cards, so you might want to check what kind of video card is available on the school's computers if you decide to go for OL.

If you just want plain old Allegro, any hardware configuration should be ok.

___________________________________

piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from."
piccolo: "just wait until my invetion comes out its going to take the wii to the next leave of game play. it will run sony and microsoft out of busness if i dont let them use it aswell."

Jennifer Perkins
Member #8,203
January 2007

Sorry to be such a pain.... went to this website:
http://developer.berlios.de/project/showfiles.php?group_id=6183&release_id=9237
downloaded OpenLayer2.0.zip, decompressed it, and the installation.txt says:

FOR OTHER COMPILERS THAN GCC

- A package containing the MSVC versions of the libraries might already have been release.
See https://sourceforge.net/projects/openlayer/ for more info.

- If no package exists for your compiler you'll have to compile OpenLayer's source files and
include them in the same archive. Also download the required external libraries and follow the
installation instructions included with them.

arrrrrrrghhhh I'm soooo confused. I've got allegro set up with Dev-C++ and need OpenLayer to work with what I have already setup. I don't want to screw up what I've already got working, so I'm afraid now to do anything..

OOOOPPPssss.... My video card may not run it. I've got an older Dell laptop from our department. arrrrrgggghhh again.

Jennifer ???

Richard Phipps
Member #1,632
November 2001
avatar

If you have allegro working with Dev-C then you either have GCC or Cygwin setup as the compiler. I'd say it's highly likely that GCC is setup, so running the cbuild file should start the build process.

nonnus29
Member #2,606
August 2002
avatar

Try L zero L, our benevolent, enlightened leader has some filters setup on the forums. :P

Jennifer Perkins
Member #8,203
January 2007

L0L wondered what ethereal entity put that I'm dumb in there... :D

Epsi
Member #5,731
April 2005
avatar

You won't break what is already working, don't worry. But without hardware acceleration it will be very, very slow.

However you can still develop full speed pure Allegro games on the same computer.

Launch the buildme.bat on Windows to compile OpenLayer.

___________________________________

piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from."
piccolo: "just wait until my invetion comes out its going to take the wii to the next leave of game play. it will run sony and microsoft out of busness if i dont let them use it aswell."

Jennifer Perkins
Member #8,203
January 2007

Ok, please don't hate me because I'm stupid, but after decompressing the .zip folder there is:

Demo.cpp, Demo.dev, Makefile.win, Install.txt and the folders for the includes, demos, dll's, lib's etc.. no batch file

ugh...

Neil Walker
Member #210
April 2000
avatar

If you're new to all this and just want to learn how to program games, then Openlayer/OpenGL is overkill and the installation more error prone, just go for the plain Allegro installation.

The easiest way is to get a binary release, this is in the files section of allegro.cc

If you are using DevCPP then you can get a devpak (from the menu within devc++) for Allegro that does everything for you.

The stuff in the files section is a basic shell of allegro, so for all the demos, etc. get the remainder (or all of it, for 4.2 that is) at http://retrospec.sgn.net/allegro.php

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Jennifer Perkins
Member #8,203
January 2007

I have DevC++ and allegro set up and working, but I have to have the code in C++ classes and not in C code. That's my issue, not necessarily needing anything else. It just has to be converted to C++ classes. Any ideas? Suggestions? I would love to use OpenLayer or Allegro Simplification, or if there's some other wrapper out there that will give me C++ classes I'm open for any suggestions.

Considering Hari-kari - is this how people start smoking crack??? L0L ;D

CGamesPlay
Member #2,559
July 2002
avatar

1class ICanUseAllegroWithCPlusPlus {
2 public:
3 BITMAP* sprite;
4 
5 void Load() {
6 sprite = load_bitmap("holy_cow.bmp", NULL);
7 ASSERT(sprite);
8 }
9 
10 virtual void Draw() {
11 masked_blit(sprite, screen, 0, 0, 5, 5, sprite->w, sprite->h);
12 textprintf_ex(screen, font, 10 + sprite->w, 5, makecol(255, 255, 255), -1, "Holy Cow says, \"Holy Crap!\"");
13 }
14};
15 
16class ICanEvenDerive: public ICanUseAllegroWithCPlusPlus {
17 public:
18 void Draw() {
19 ICanUseAllegroWithCPlusPlus::Draw();
20 textprintf_ex(screen, font, 10 + sprite->w, 8 + text_height(font), makecol(255, 255, 255), -1, "\"I can even derive!\"");
21 }
22};
23 
24extern "C" int main(int argc, char* argv[])
25{
26 ICanUseAllegroWithCPlusPlus* ICanEvenUseItFromACFunction = new ICanEvenDerive;
27 delete ICanEvenUseItFromACFunction;
28 
29 // If you already know this information, then you should be more specific in your original post
30 // when specifying what you are looking for. Otherwise, please, please learn C++ before teaching it,
31 // lest you get kids who figure out that they know more than you and aren't afraid to tell you.
32 
33 return 0;
34}

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Jennifer Perkins
Member #8,203
January 2007

No need to be ugly.
I've given my kids plenty of C++ boring projects and I've written plenty of boring C++ code myself (even tho I still find it fun).
I'm just trying to give them something new and exciting to do, more graphics related, but I'm not a gamer and I'm not a game programmer. Give me a break here.
And believe me there are kids who come into my class that know about things I don't and I'm perfectly willing to learn from them too. I make it perfectly clear to them that I don't know everything and they actually respect me for that. There are many times we learn from each other and it enhances the class.
I don't know everything, no one does. I'm just needing some help so I can give these very bright kids something fun to do instead of the same old boring projects. We all have to start from the beginning sometimes.

Audric
Member #907
January 2001

Ariesnl said:

If you want to derive classes use OpenLayer

This wasn't a friendly hint >:(, OpenLayer classes are NOT meant to be derived.

gnolam said:

(Allegro is written in plain C) And is as such perfectly usable in C++.

CGamesPlay said:

you can use C++ with Allegro just fine

+1.

Allegro is a library, just like libc. It means you don't need to see the code behind each function, you only need to understand the interface (?) (ie: which functions does what.)

Just write your own code in C++, in whatever organization you see fit. But inside methods, whenever you need to actually DO stuff related to the screen, keyboard, mouse etc. you call the relevant allegro functions.

If you want to derive classes from something rock-solid, you could check AMGC2 by Miran Amon.
It defines a generic class "game", and when you want to add a new game, you only need to provide your derived methods for display and logic. (See kickups.cpp for a crystal-clear example game)
In this case, you don't even have to recompile amgc2.exe ! just compile your own dll, it will be dynamically loaded when amgc2 starts.

tobing
Member #5,213
November 2004
avatar

Jennifer, if you want something with beautiful classes for your lessons, but stick with allegro technically, I can only recommend you have a look at guichan. It's a GUI library, quite well designed, and works perfectly well with allegro. You have all sorts of classes and OO stuff in there, so you can derive classes to override behavior or appearance. The gui itself is non-intrusive, so you can use it as an addition to what you already have, it shouldn't break existing code or force a particular style upon you.

Look at the CVS version, and look into the allegrowidgets example program.

OpenLayer is much more advanced and has a whole lot of dependancies, i.e. other libraries you also have to compile and link with, I wouldn't recommend that for your purposes.

Trezker
Member #1,739
December 2001
avatar

Well... Give your students the task of creating a C++ wrapper for allegro.
Problem solved, next! ;)
It should be a great exercise actually.

I'm thinking of doing a wrapper myself... But there's no time.

Jennifer Perkins
Member #8,203
January 2007

I understand what you mean now. I got confused when I looked at the Allegro Simplification Documentation. It shows things like:

als::bitmap Class Reference
[Bitmap components]
Simple replacement for directly using BITMAPs. More...
List of all members.

Public Member Functions
bitmap (const bitmap &)
Construct from existing bitmap.

bitmap (BITMAP *)
Construct from BITMAP*. etc........

shows constructors, destructors, public member function, private member functions, private member variables, namespaces etc... for each class

After reading all of this documentation, I thought that you could use this Allegro Simplificator to change the way you would interface with Allegro. So instead of straight function calls... you would use the classes and their member functions.

So I'm mistaken about that, right? I don't understand what the wrappers do then. So instead of being able to add member function, member variables to the classes that would already exist (if I had been right about Allegro Simplificator as I was thinking), I need to instead just build new classes using the predefined C functions.

I'm going to have to look at this from a different perspective then. I appreciate you pointing me in the right direction. I'm just trying to learn here, for my students. I don't want to be the type of professor that keeps teaching the same crap for 20 years. I'm trying to keep up with what the kids want and keep them interested in Computer Science.

I really appreciate your help.

Great.... was busy typing when I got the last 2 posts. I will definately look into that instead of OpenLayer. That would give me what I need to teach the specific concepts I have to cover (this determined by the powers that be).

Would they hate me if I made them create a wrapper? I'd love to have one project that they added to all semester and finally developed a functioning game in the end. That was my thought anyway.

tobing
Member #5,213
November 2004
avatar

Quote:

Would they hate me if I made them create a wrapper?

Hm? Who do you mean? The guichan people already have guichan_allegro, which is the allegro backend for the use of guichan with your own allegro program (there are also other backends available). You're always free to take the sources and make your own library (which I would not recommend), or to add your own wrapper library to use (the better way).

 1   2   3   4 


Go to: