Allegro Simplificator
Jennifer Perkins

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

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.

Ariesnl

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)

gnolam

Don't double post.

Quote:

Allegro is written in plain C

And is as such perfectly usable in C++.

CGamesPlay

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

Jennifer Perkins

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

Jennifer Perkins

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

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

Epsi
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.

Jennifer Perkins

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

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

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

Jennifer Perkins

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

Epsi

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.

Jennifer Perkins

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

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

Jennifer Perkins

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
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}

Jennifer Perkins

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

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

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

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

Richard Phipps

Allegro is very easy to create 2D games, (I even made a series of game creation articles). I think it would get your students interested in programming if they had the choice of making a game, and with Allegro that can be using as much or as little C++ as you direct.

Jennifer Perkins

Hey Tobing and Richard,

Maybe I should also have explained where these students are in their programming experience. Many of them have just completed programming 1 (which I teach) and they have NEVER programmed before (most of them) so arrays and sorts were giving them issues. In programming 1 they learn basically calling programmer created functions from main - call by value, call by reference, they are major beginner programmers. In programming 2, I introduce them to OOP, creating classes, overloading operators, dynamic arrays and the issues with passing objects containing pointers to functions, therefore the need to create copy constructors... etc. They haven't even had data structures yet, they take that after my class. I'm just trying to give them some OOP projects that aren't console apps -- MAJOR boring. I'm developing this approach because they have come to me begging to do some gaming, so I'm trying to step up and find a way to do that.

I am studying as hard and fast as I can so I can incorporate more interesting projects while learning these concepts. I wish I could teach more advanced students some game programming, but maybe at a later date the department will let me do that.

My problem is finding a way for them to create these types of projects and use Allegro at the same time. Maybe I'm getting them over their heads, but I've got to find a way. It's too important to them and I want them to enjoy programming. I hated doing banking projects when I was a student and I don't want to put off these bright kids, because I'm the first one to teach them any programming.

So maybe now that I've explained myself a little better, which I should have been better at in the beginning, you have a better idea at what I'm up against.

Richard -- do you have those articles online, or are they your private papers? I don't want to step on your toes, just thought if you published them online, I might really need to look at them.

Jennifer

tobing

I can only recommend guichan + allegro once again. It's simple, yet powerful, you get all possibilities of allegro, and you have a lot of OOP inside guichan to learn from.

Jennifer Perkins

I'm google ing that right now.

Thanks so much for your help. You guys have been very patient and understanding and I really appreciate it.

:)

Richard Phipps

My articles are here:
http://www.reflectedgames.com/create.html

8 parts and with very simple parts of C aimed at beginners.

So, no pointers, dynamic variables or dynamic data structures. Just simple structs, allegro function calls, use of defines and variables in structs.

It might not be the most efficient way, but it's easy to learn and it gets results. :)

Jennifer Perkins

You guys soooo rock!!!

tobing
Jennifer Perkins

NIRVANA!!!!! Guichan seems to be EXACTLY what I need and Richard, I'm downloading your articles as well.

I can't tell you how much this means to me, and will mean to my students. You may have made a huge difference in a lot of beginning programmers lives.

Thanks - the word doesn't do justice to your help and patience.

Jennifer

LennyLen
Quote:

No need to be ugly.

He isn't being ugly, he's being realistic. Do you honestly think you should be teaching something that it appears you don't know the workings of?

Audric

Personally I bow down to the initiative and dedication.

A small arcade game (pong-ish) is definitely a reachable goal, trying to do something more complicated is maybe dangerous as there are many ways to proceed, and it will be difficult to TEACH why such or such technique was chosen, if you haven't tried the alternatives yourself yet.

Jennifer Perkins

Thank you Audric for your encouragement.

Believe me we're gonna keep it simple, but anything is better than a boring console app.

I seriously doubt LennyLen shot out of the womb knowing how to program and there were probably many who answered his questions along the way and didn't berate him for asking. I just expect the same courtesy that his mentors gave him.

But, some people don't remember where they came from and luckily I'm not one of those. I constantly remember those that helped me when I was first programming, so I try to put myself in my student's shoes and understand where they are in their learning process and am sympathetic to their confusion and insecurity of their own abilities. I just want to help make it more exciting so they keep that enthusiasm going and see the fruits of their labors.

I really appreciate your kind words.

Jennifer

LennyLen
Quote:

I seriously doubt LennyLen shot out of the womb knowing how to program and there were probably many who answered his questions along the way and didn't berate him for asking. I just expect the same courtesy that his mentors gave him.

What does that have to do with what I said?

edit: Oh and don't get me wrong, I also admire your dedication and think it's great that you want to help keep things exciting for your students. I just feel that if you don't know enough about what you are teaching (and I'm not saying you don't, it just appears that way from your questions), you can undermine the faith your students have in your teaching abilities. This is NOT a good thing.

Neil Walker

Well, my AXL library is an Allegro wrapper/add-on in C++ complete with online documentation including samples taking you from Allegro initialisation, to animation, game timer control and ending up in a mostly complete tile mapping game as a separate tutorial. It also allows XML files to be for setting up the system and animations.

http://retrospec.sgn.net/users/nwalker/axl

It may not be the most elegant C++ or worthy of use in a class, but it does the job.

Johan Halmén

I've been teaching programming and I've often been in situations where I don't know how things are to be done. Either I say to my students that I return next week with this problem or I solve the problem before their eyes. I might google for something or use some online C++ references. Usually I want to show them that I'm not a const teacher, who knows everything and they have to try to be like me. By saying "I don't know the answer to your question, but this is how I would try to solve the problem" I hope to give them confidence so they might solve their next problem by themselves.

Jennifer Perkins

Sorry LennyLen, didn't mean to misinterpret your comments. I've just had a long day trying to track this stuff down, about 12 hours straight now with no breaks. I'm not going to be teaching this stuff tomorrow, so I have plenty of time to prepare, just trying to get a handle on it so I can teach it in summer or fall.

Neil, thanks for the websites, I'm going there to download AXL and check it out as well, especially since you have such good documentation. I really appreciate all the effort you've put into it.

Johan, thanks again for understanding where I'm coming from. I once googled a question in the classroom when we came across something we all had questions about. I think it's good to show students that no one knows everything, but also how to find resources, because when I worked in industry, we definately used forums and the Internet for information. And I tell my students that. I want them to know that they don't have to know all of the answers, but they should know how to find the answers for themselves.

We can always learn something new and we just need to be supportive of each other because one developer will know one subject and another developer a different subject and we need to be willing to share information. It only makes us all better programmers, and in my view better people.

Thanks all, I will continue to persevere and will eventually get "in the know", promise.

And I'm sure I'll be back here aggrivating you further, so brace up. :)

Jennifer

LennyLen
Quote:

Sorry LennyLen, didn't mean to misinterpret your comments.

Don't worry, it happens a lot. ;)

Quote:

I'm not going to be teaching this stuff tomorrow, so I have plenty of time to prepare, just trying to get a handle on it so I can teach it in summer or fall.

Then I should apologise. I must have misread one of your sentences, as I had thought you'd said this was for the class you were currently teaching.

Oh, and I agree that teachers don't need to be infallible, so long as they know enough to be able to find out what they don't know. I'm possibly a bit sour on the subject of poorly informed lecturers as I had a first year Gofer lecturer who had no idea what he was teaching. He caused so much confusion that most of the class either dropped the course (even though it was mandatory for all second year papers) or just failed. None of us were surprised when he was fired.

Quote:

I think it's good to show students that no one knows everything, but also how to find resources, because when I worked in industry, we definately used forums and the Internet for information. And I tell my students that. I want them to know that they don't have to know all of the answers, but they should know how to find the answers for themselves.

A sterling attitude.

OT: Is anyone else amused by people who manage to find forums (by googling I assume) only to ask a question that a simple google search would have answered?

HardTranceFan
Quote:

I think it's good to show students that no one knows everything, but also how to find resources ... I want them to know that they don't have to know all of the answers, but they should know how to find the answers for themselves.

And that's how it is in real life too. You don't need to know all the detailed information or the answers, only how and where to find it.

[A little Off Topic]

So why are so many tests and exams closed book? This goes directly against that philosophy.

[/A little Off Topic]

Jennifer Perkins

LMA0... I totally understand the open book issue. That's why on my exams, I give code and ask them what the issues are with the code. More theory and understanding concepts. To have them write code on an exam is redundant, when they've already coded the projects. I usually just want them to explain that they understand why we have the issues, such as needing a copy constructor, etc.

When I was a student however and a Professor told us it was going to be an open book, open notes exam, that's when I started to panic... L0L

Oh yeah... google does answer most questions, but it's also important for them to find the forums so they can meet great folks like you guys, in order to see how things can be done from a different perspective. I love that part of forums.

Johan Halmén
LennyLen said:

Is anyone else amused by people who manage to find forums (by googling I assume) only to ask a question that a simple google search would have answered?

Did you just throw that question here or did you google first?

Ariesnl
Quote:

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

If you're teaching C++ the least the could do is give you a decent computer.;D

annyway If you want to use Open Layer I can put up the game engine code of my last project, wich is easy to use as skelleton code.

Right now I don't have it handy ( I'm at my work now) But I can put it up tonight.

Quote:

LMA0... I totally understand the open book issue. That's why on my exams, I give code and ask them what the issues are with the code. More theory and understanding concepts. To have them write code on an exam is redundant, when they've already coded the projects. I usually just want them to explain that they understand why we have the issues, such as needing a copy constructor, etc.

When I was a student however and a Professor told us it was going to be an open book, open notes exam, that's when I started to panic... L0L

Oh yeah... google does answer most questions, but it's also important for them to find the forums so they can meet great folks like you guys, in order to see how things can be done from a different perspective. I love that part of forums.

I still have nightmares having to write code on a piece of paper ;D
NO insert and I have a habit of starting with

if (blCond)
{

}

and inserting lines afterwards

Trezker

OpenLayer only C++ifies the graphics part though.
Input and other things are untouched.

Coding on paper is a true nightmare. One mistake and you have to start over from scratch if you care about how it looks. Coding should be an assignment during the course.
I also always type the {} first and write the code afterwards.

Fladimir da Gorf
Quote:

If you're new to all this and just want to learn how to program games, then Openlayer/OpenGL is overkill

How's OpenLayer overkill? I'd say that it's easier to use for beginners than Allegro.

You can't forget to change the color depth. Program setup is simple. Functions are easy to grasp and there's no weird legacy function names (like draw_sprite or draw_trans_sprite). No palettes to confuse people. You don't even need pointers anywhere! Destroying the loaded stuff is done automatically. Collision routines, some simple game logic classes and speed regulation routines are included in the package. Buffering is done behind the scenes. Cool looking effects are easy to make and won't slow down the game.

Setting up the library is slightly more difficult because of the dependencies. The reason why you don't have buildme.bat is that it didn't exist when the 2.0 version was released. So you should use TortoiseSVN to download the latest version from the SVN repository, or if that sounds too difficult, I could upload the package somewhere.

PS. Teaching C++ in a class but using a C library doesn't sound good. If you teach how to use C++, then use C++. Not partily C and partily C++.

tobing

It's very interesting to see how everybody tries to advertise his own library. While this is a good thing if someone looks for a good start to do an own game, it's a little different in this case: Jennifer is looking for something that she could TEACH about. Of course, there will (or should) be a game at the end of that course, but priority is something which helps to explain OOP concepts to her students.

To be honest, I wouldn't recommend OpenLayer for that purpose (writing a game using OL is a completely different matter though: I'll be using it myself). And that's also why I suggested guichan, because if you look into that, you can learn (and teach!) a whole lot about different OOP concepts.

Fladimir da Gorf
Quote:

Of course, there will (or should) be a game at the end of that course, but priority is something which helps to explain OOP concepts to her students.

So how's Allegro better for that? :P

Quote:

To be honest, I wouldn't recommend OpenLayer for that purpose... And that's also why I suggested guichan, because if you look into that, you can learn (and teach!) a whole lot about different OOP concepts.

But why? OpenLayer is OOP. And why not to use both? Guichan can be integrated to OpenLayer.

tobing

Allegro is not better, and I didn't talk about allegro but guichan.

It actually depends on what the students already know. From what Jennifer posted I assume that they are more beginners than advanced, so I would keep things as simple as possible. For my own purpose I have integrated OpenLayer with guichan, and I think that this is a great platform to make games with.

I'm not sure if that is simple enough to be used in such a course: There are quite a few dependencies which all have to be set up, especially if you want to be able to debug and single step into one of the libraries (which is something you want to do from time to time, to look where a problem is, and to understand what really happens inside one of the libs. Once you have everything up and running (I have, but it took me some time!) I'm sure that the actual programming is indeed easier.

Let's say it's Jennifers choice, and it should be good to know what can be done: guichan to use with pure allegro, which is quite simple to setup, or use the OpenLayer backend, which requires more work to setup the project, but might make the actual game programming easier.

Fladimir da Gorf
Quote:

Let's say it's Jennifers choice, and it should be good to know what can be done: guichan to use with pure allegro, which is quite simple to setup, or use the OpenLayer backend, which requires more work to setup the project, but might make the actual game programming easier.

Indeed, and I think all the setup should be done for the students beforehand. And I don't think they should worry about how the various libraries are made. It'd just confuse them. (Reading Allegro's sources would be really, really difficult)

Ariesnl
Quote:

but priority is something which helps to explain OOP concepts to her students.

I always used mother nature for that. and it's great for explaining how inheritance works. You make it more "visible" and less abstract that way.

Neil Walker

What I mean by openlayer not suitable is if you're learning to code simple 2d games then (and I know OL simplifies some stuff) you shouldn't have to worry about openGL, rather you should concentrate on drawing sprites and pushing pixels. Plus there is a distinct lack of documentation on OL, other than the reference guide.

Fladimir da Gorf
Quote:

Plus there is a distinct lack of documentation on OL, other than the reference guide.

If you mean a lack of examples, that's right. Only the most simple stuff is covered.

Quote:

What I mean by openlayer not suitable is if you're learning to code simple 2d games then (and I know OL simplifies some stuff) you shouldn't have to worry about openGL, rather you should concentrate on drawing sprites and pushing pixels.

Yes, that's exactly what you do with OpenLayer. One of my friends who uses the library didn't even know that the it used OpenGL before I told him...

Neil Walker

I'm not knocking anything flad, I think OL is great, but there are loads of issues cropping up with OL I see in the forum requiring people needing to make explicit openGL calls or errors with things not showing properly due to the way openGL works. When you want to learn Allegro, the best place to start is Allegro, and if you want it OOPs based, add a wrapper around it.

As for the documentation, that is a problem, because any newbie who reads the documentation won't know where to start, I mean it took me ages the first time to even find out how to get the stuff from the buffer to the screen as it's not obvious how things work, nor is it obvious that certain classes are linked and have inter-dependencies with others.

I'm not saying you need a full tutorial, but maybe structure the documentation in such a way that there is linkage between the objects and an order to how you do things - a bit like how the Allegro manual works.

Ariesnl

The documentation of Opel Layer could be improved. but even than , it's verry easy to use. just grab the rxample game and start coding.

But .. there are also people who think FMod is hard to use..

By the way Jennifer:
- Instead of Dev-C++ you could also try Code::Blocks

it has some nice features

And for sound/music ( what's a game without that ? ) you could use FMod
I recommend using FMod 3 ! over the newer FMod versions, the interface of FMod 3 is Much simpeler. (It took me 15 minutes to incorporate it in my game when I started using it )

Michael Faerber

Ok, now I want to post something too since I am the author of a software called "Allegro Simplificator". ;)

The Simplificator was some kind of personal project of mine and I think I only once posted a version of it here on allegro.cc, when suddenly a community member contacted me, saying that I should publish my wrapper.

That time I just had a programming job (which I still have), and my arms were a bit damaged from my bicycle crash, furthermore I didn't really do much Allegro programming anymore (the last thing I programmed was my game for SpeedHack).

However, I decided to release my wrapper anyway, but I was a bit too lazy to maintain it really - school was here too, I was playing Final Fantasy :) and I didn't program with Allegro much anyway anymore.

Therefore I was quite stunned when I saw this long thread with the title of my wrapper - I thought of this project more as an inspiring example for somebody's own wrapper, because I always look at other people's wrappers, then write my own one. ;)

Quote:

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.

That is the wrapper's purpose, right.

Quote:

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.

Well, you could make new classes that INHERIT the old classes' functions - that way you could add new variables and classes.
However, you can look at my wrapper and the shipped examples if you have time - the examples could be the most helpful thing there.

Quote:

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.

I am really glad that you do this, because I just had some kind of computer lessons today in school and the teachers don't really want to use new software and complain - for example they installed Flash 5 on the computers, although version 9 is the recent version! :P

To say it short: I find it really good that you try to learn the new stuff - keep it up!

Evert

If you're teaching a beginner course, you want a minimum number of library dependences - if for no other reason than that the students will have no clue which part of what they're tought is basic C (or C++), which part is Allegro and which part is some other library.

I'm sure many people find Open Layer easy to use and convenient, but teaching it along with Allegro and C++ to beginners is just going to add to the confusion. That's what I would expect anyway.

Fladimir da Gorf

I just want to correct any misinformation about my library.

Quote:

any newbie who reads the documentation won't know where to start, I mean it took me ages the first time to even find out how to get the stuff from the buffer to the screen as it's not obvious how things work

However, there's a tutorial exactly for that. It's in the demos-directory.

Quote:

I see in the forum requiring people needing to make explicit openGL calls or errors with things not showing properly due to the way openGL works.

Hmm I can't remember such a case, though...

Quote:

nor is it obvious that certain classes are linked and have inter-dependencies with others.

How does that affect anything for the developer? Do you mean the "state machine" classes like Canvas?

Quote:

I'm not saying you need a full tutorial, but maybe structure the documentation in such a way that there is linkage between the objects and an order to how you do things - a bit like how the Allegro manual works.

If it's a direct link between classes, there will be links as all the class and method names are linked to the corresponding page.

Quote:

If you're teaching a beginner course, you want a minimum number of library dependences - if for no other reason than that the students will have no clue which part of what they're tought is basic C (or C++), which part is Allegro and which part is some other library.

With OL, that's not an issue either, since it's only OL that uses the other libraries, not the developer. Everything's abstracted away. It's not any different from just dumping all the other libraries inside OL. I'm just using the Java convention - never code anything that has already been made.

Quote:

I'm sure many people find Open Layer easy to use and convenient, but teaching it along with Allegro and C++ to beginners is just going to add to the confusion. That's what I would expect anyway.

Would you really have to teach any Allegro, except how the key-array, mouse_x, mouse_y and mouse_b?

Neil Walker

Well, I agree with evert for a change, as in when I said 'When you want to learn Allegro, the best place to start is Allegro, and if you want it OOPs based, add a wrapper around it.' I meant exactly what he said, the minimum the better.

At the minute, despite the new build process, OL requires a large amount of external libraries, some of which are hard to build, and the OL build changes every day to fix bugs whereas Allegro requires no external libraries and is stable.

tobing
Quote:

the OL build changes every day to fix bugs

That's not really true. I'm looking into SVN almost daily, and changes are not very often.

Quote:

since it's only OL that uses the other libraries, not the developer. Everything's abstracted away.

Unfortunately that's not completely true. If you include the OpenLayer header file(s), you have to add a series of additional include paths to your compiler settings, because OpenLayer includes all these other header files in his public interface. While this does not immediately effect the application programmer, it definitely adds a lot of symbols which are not used by the application programmer. Things might be a little different if OpenLayer would be a DLL (with Windows at least), but that could only resolve any linking issues (you have to link to a series of libraries), not the compile dependencies to all the other libraries required by OpenLayer.

Fladimir da Gorf

Still, I can't see how a more difficult set-up would affect the students. Just supply pre-made project files which contain the linker commands.

Quote:

When you want to learn Allegro, the best place to start is Allegro, and if you want it OOPs based, add a wrapper around it.

But then you'd have to add both Allegro and the wrapper to the linker line! How's that more difficult than adding a few more? (Especially when copy-pasting stuff, I can't remember the whole linker line myself either)

Of course, if you really want to, you can just bundle all the libraries inside libopenlayer.a.

Quote:

the OL build changes every day to fix bugs

Yeah, right. That's what I would really call misinformation. Besides, almost all the issues thus far have been with the features that don't even exist in Allegro.

Indeterminatus

Jennifer, kudos to your motivation and dedication. Keep the momentum! In hindsight, I'd have loved to be one of your students, I guess ;)

Not helping, I know, as I don't have anything to say that hasn't been said before. Keep it up!

Ariesnl
Quote:

If you're teaching a beginner course, you want a minimum number of library dependences - if for no other reason than that the students will have no clue which part of what they're tought is basic C (or C++), which part is Allegro and which part is some other library.

I'm sure many people find Open Layer easy to use and convenient, but teaching it along with Allegro and C++ to beginners is just going to add to the confusion. That's what I would expect anyway.

Maybe.. BUT..
I remember having to write dull and completely useless programs. If that was my first programming experience it wouldn't have lit my fire.

The first program I wrote in C++ (after Hello World) was a CD player using MSCDEX.
It wasn't easy, it took me a month. BUT it was fun to do and I learned a lot from it.

Quote:

I'd have loved to be one of your students, I guess ;)

[lame mode]
You haven't seen her yet, have you ;D
[/lame mode]

By the way:
Teach them STL !!!!!
When I was a student they skipped it ( too complicated or something) but I use it almost daily !

kentl

If you want a finished OOP framework and let the students create something upon it, then perhaps ClanLib would be a better choice than Allegro. It's certainly worth checking out.

Ariesnl

hmmpf I didn't like clanlib..
it's a pain in the **** setting up

Trezker

There's only one hard thing about STL, the compiler errors when you miss something.
I can't live without my precius vectors, lists, maps etc...

/me huggles STL

I like boost too, but that's not for this class.

kentl
Quote:

it's a pain in the **** setting up

It is? I've never done it but it doesn't seem that hard judging by their home page. If she wants something which is OO-based out of the box so that her students can use it in their projects, then creating an OO-framework might not be what she wants. On the other hand it could be a good assignment albeit a bit boring.

gnolam

ClanLib was, at least a couple of years ago, not even worth thinking about setting up. It was beyond the 9th circle of dependency hell.

Jennifer Perkins

God you guys are great. I'm learning so much from just reading your posts and accessing some of these websites and reading reading reading. I have my 2 teaching assistants all involved too and they're enjoying learning this as well. We're having a good time with all of this info. Even if we are such newbies to all of this gaming. We spent about 6 hours the other day, laptops in one hand, pizza in the other just going thru so much material and the websites and ideas you have all suggested. You have all been so good to me, and have given me so many things to think about. You all are the greatest!!

Jennifer....

P.S. - I'll post my pic in a bit and you can then decide if you would have liked to have me as a teacher... L0L;D

Richard Phipps

You are welcome. We hope it helps you. :)

Ariesnl
Quote:

laptops in one hand, pizza in the other

That almost makes you a game coder already ;D;)

Trezker

Just add tons of caffeine and late nights.

Neil Walker
Quote:

God you guys are great.

We're so much better than those SDL losers ;)

Quote:

Teach them STL !!!!!

If you don't you'll be letting them down I think. STL is a big topic and can be complicated but if you stick to strings (effectively giving you the native type c/c++ has always missed) and vectors (proper dynamic arrays, e.g. your sprites) you can't go wrong. Possibly include in there 'map' (for storing stuff by name, e.g. resources) and the sort algorithm to use in conjunction with vectors/maps (sorting drawing order or high-scores)

Johan Halmén
Quote:

laptops in one hand, pizza in the other

{"name":"590988","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/9\/49909bd33f47c4ca679f3efd22cad755.jpg","w":374,"h":537,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/9\/49909bd33f47c4ca679f3efd22cad755"}590988
{"name":"590989","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/3\/d3084124f1f72f1ba5138ee73b6e4bb2.jpg","w":363,"h":499,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/3\/d3084124f1f72f1ba5138ee73b6e4bb2"}590989

LennyLen

;D

Richard Phipps

:D

Neil Walker

You'll not be laughing if she's a teacher for a special school and all the kids use those suckers stuck to their foreheads to type ;)

Thread #589484. Printed from Allegro.cc