Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Allegro 5 Book

This thread is locked; no one can reply to it. rss feed Print
Allegro 5 Book
AleX-G Squadron
Member #13,593
October 2011
avatar

Hi!
I came to another problem.
After looking at the manual i saw that the al_show_native_message_box()
has 6 parameters. What is the first parameter shown as: ALLEGRO_DISPLAY *display
What it will display exactly? The screen itself? What is drawing on the screen?

www.anothergames.com

bamccaig
Member #7,536
July 2006
avatar

AleX-G Squadron
Member #13,593
October 2011
avatar

I cannot understand it. I am not a native English speaker.
Also the 5th parameter is button. How am i supposed to modify it with a | in between buttons when you have them as a string?

www.anothergames.com

Arthur Kalliokoski
Second in Command
February 2005
avatar

I had to try it myself.

#SelectExpand
1#include <stdio.h> 2#include <allegro5/allegro.h> 3#include <allegro5/allegro_native_dialog.h> 4 5 6int button; 7 8int main(int argc, char **argv){ 9 button = al_show_native_message_box( 10 0, 11 "Warning", 12 "Are you sure?", 13 "If you click yes then you are confirming that \"Yes\"" 14 "is your response to the query which you have" 15 "generated by the action you took to open this" 16 "message box.", 17 "Yessir!|Nossir!", 18 ALLEGRO_MESSAGEBOX_YES_NO 19 ); 20 21 printf("button was %d\n",button); 22 return 0; 23 24}

The separator bar is part of the string, and the function looks for that and splits the string into two parts I suppose.

They all watch too much MSNBC... they get ideas.

AleX-G Squadron
Member #13,593
October 2011
avatar

Where is the Yes sir! and No sir!
What is the purpose of the fifth parameter, i cannot find it.
I thought it renames the ok and cancel
And i got a very similar result:

#SelectExpand
1#include <allegro5\allegro.h> 2#include<allegro5\allegro_native_dialog.h> 3 4int main (void) 5{ 6 ALLEGRO_DISPLAY *display = NULL; 7 al_show_native_message_box(display, "123Hello World!", "3.8 Hello!", "How are you today?", "Hello|World", ALLEGRO_MESSAGEBOX_OK_CANCEL); 8 return -1; 9 if(!al_init()) 10 { 11 al_show_native_message_box(NULL, NULL, NULL, "Error", NULL, NULL); 12 return -1; 13 } 14 15}

www.anothergames.com

Arthur Kalliokoski
Second in Command
February 2005
avatar

{"name":"606466","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/6\/2604ad0e4d8ffc1399f33a672bf52ceb.png","w":351,"h":259,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/6\/2604ad0e4d8ffc1399f33a672bf52ceb"}606466

They all watch too much MSNBC... they get ideas.

AleX-G Squadron
Member #13,593
October 2011
avatar

{"name":"295r6f8.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/7\/2705e6abbefbe570283fe8b47bbdddb8.png","w":1281,"h":418,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/7\/2705e6abbefbe570283fe8b47bbdddb8"}295r6f8.png
It doesnt show on mine. Very weird. Is there anything to do with visual studio 2012?
How can i add coding and image tags on here?

www.anothergames.com

Arthur Kalliokoski
Second in Command
February 2005
avatar

It doesnt show on mine. Very weird. Is there anything to do with visual studio 2012?

I don't have a clue, I don't use it. Anyone?

Quote:

How can i add coding and image tags on here?

{"name":"606468","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/0\/a03938535080105763dfcac1fe62f3cd.png","w":472,"h":149,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/0\/a03938535080105763dfcac1fe62f3cd"}606468

They all watch too much MSNBC... they get ideas.

Trent Gamblin
Member #261
April 2000
avatar

I think the dialogs on Windows will only use names based on the last parameter (YES_NO). Winapi is a pain and the easy messageboxes don't allow changing those, and nobody wants to code a full fledged one.

AleX-G Squadron
Member #13,593
October 2011
avatar

Is it some kind or bug?

www.anothergames.com

Arthur Kalliokoski
Second in Command
February 2005
avatar

Is it some kind or bug?

Trent meant nobody's bothered to write an entire modeless dialog box framework for the odd case where somebody wants multiple buttons with custom text. When you get up to speed in Allegro, write one yourself for fame and fortune! OTOH, you might simply add a modeless dialog yourself with an #ifdef WINDOWS #elif section.

They all watch too much MSNBC... they get ideas.

AleX-G Squadron
Member #13,593
October 2011
avatar

Ok, i got it. Anyway it is a bit weird it doesn't work.
I will report bugs during the journey.
I hope developers resolve this problem.

www.anothergames.com

Thomas Fjellstrom
Member #476
June 2000
avatar

I don't think you can change the strings for the buttons on some Windows dialogs. So its not a bug in allegro. Just a feature allegro exposes but windows doesn't.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

AleX-G Squadron
Member #13,593
October 2011
avatar

Looks like the book will be bigger than expected. I reached page 40 and still on the chapter text and fonts. It is 2:03 AM on here, so i am working very hard on this book. Hope anyone got any ideas or some diagonal text programming ;)
It is fun to give new ideas, seriously.

I have a big question. What is a backbuffer?

www.anothergames.com

Specter Phoenix
Member #1,425
July 2001
avatar

I cannot understand it. I am not a native English speaker.

Okay, so your book will either be for a narrow non-English speaking audience or if you do it in English it will be possibly confusing at times due to, you yourself, saying your English is poor due to it not being your native language? Also, there was a book written back around Allegro 3.1.x and the author of that himself said Allegro didn't have a large enough of a following to warrant a new book for it. He said it was a niche library that no company would or could justify publishing a book about it.

To me, Allegro is for programmers, by programmers, and programmers that can't understand the manual or what it means shows how much more the programmer needs to improve.

My question is: allegro 5 book. Any? NO! Epic fail.
Videos? Only 2 guys! I hope you find them!
Wiki is like a manual. I hate wiki. The manual is better.

A5 Book. Any? NO! Reason: no one would read the stupid thing (ask Harbour, his A3 book only sold due to starry eyed programmer wannabes).
Videos? Only 2 guys? A YT search shows a few A5 tutorials especially from Coding Made Easy.
Wiki is a collection of links to articles, documents to help learn Allegro so I fail to even understand your argument on that.

1)Installing Allegro
2)Creating your first program
3)Using text and fonts
4)Creating geometrical objects
5)Advanced objects
6)Input Keyboard
7)Input Mouse
8)Timer
9)Allegro for iPhone

Each one of those could be an article on the wiki as a wiki is, in a sense, just a large table of contents with a search feature to help find the articles(chapters) you need.

Does the manual tell me how can i make 2 doors that teleport the player?

That has nothing to do with Allegro at all. The only thing Allegro would be doing in that case would be handling events, input, and displaying the doors and player. Otherwise that would be reliant on your abilities with the language you are using and math/physics skills.

Nothing you have mentioned in this thread has justified or warranted a book. Plus, as ML pointed out to Harbour when he did his A3 book, Allegro updates so rapidly that the book would be outdated by the time it was published and released.

I have a big question. What is a backbuffer?

That question just shows you aren't ready or the person needed to write a book about A5 or anything in programming.

AleX-G Squadron
Member #13,593
October 2011
avatar

Wow man, i see you like commercial.
I just think that allegro can be used for programmers and a book can make a big step.
I even dont want to sell the book. I wrote 40 pages today as i am at page 46. How comes allegro is so fast? A year ago it was version 5.0.5 now it is 5.0.7
What a little snail. I can write the book in a week, that means the book will resist for a lot of time, not because of allegro, but because of people who want money and dont write a book because they are lazy, want to win money fast. Than thanks for paving the way toward success. I see on youtube only mikegeig and coding made easy, which i argued to him about why he didnt make allegro 5 and than he made allegro 5.
Allegro seems to me an easy job man. After all, there is no need even to answer the backbuffer as i already found it and i know what it is. Now i am the right person to write the book i guess. After all, someone said "Go write the book then!"
so there is no time for talking. Help if you want, attack if you can. Allegro is going to be a good friend for me, no matter what his "owners" use against.
I am writting so fast, you dont have time to reinvent the wheel.
I would say that the book is dead when allegro 6 comes out and than still, i would copy paste things 8-)
So i have to sleep now, hope to see millions of replies tomorrow.
Also, find any grammar error above, if you can.
I think the manual has grammar errors as it doesnt make total sense.
Thanks for fireballs and storms attacks again.

www.anothergames.com

Specter Phoenix
Member #1,425
July 2001
avatar

Wow man, i see you like commercial.

Nope, I only use Allegro, played with SFML and SDL and have never touched DirectX with plans to look into OpenGL at a later date.

Quote:

I just think that allegro can be used for programmers and a book can make a big step.

It is used for and by programmers and you are the only one whining about wanting a book for it.

Quote:

I even dont want to sell the book. I wrote 40 pages today as i am at page 46. How comes allegro is so fast? A year ago it was version 5.0.5 now it is 5.0.7
What a little snail.

What? ??? Allegro is on 5.1.3 :-/.

Quote:

I can write the book in a week, that means the book will resist for a lot of time, not because of allegro, but because of people who want money and dont write a book because they are lazy, want to win money fast. Than thanks for paving the way toward success. I see on youtube only mikegeig and coding made easy, which i argued to him about why he didnt make allegro 5 and than he made allegro 5.

I'm going to have to call bu||sh!t on that one. He started making those back in February of this year and you waited six months to post about a book?

Quote:

Allegro seems to me an easy job man. After all, there is no need even to answer the backbuffer as i already found it and i know what it is. Now i am the right person to write the book i guess. After all, someone said "Go write the book then!"
so there is no time for talking. Help if you want, attack if you can. Allegro is going to be a good friend for me, no matter what his "owners" use against.
I am writting so fast, you dont have time to reinvent the wheel.
I would say that the book is dead when allegro 6 comes out and than still, i would copy paste things 8-)
So i have to sleep now, hope to see millions of replies tomorrow.

Millions? You'd be lucky if you get 10.

Quote:

Also, find any grammar error above, if you can.

If I can? A blind man could find your errors above! You drop out words, use wrong words, put the word 'even' in the wrong spot in at least two sentences, 'i' should be 'I', I could keep going on just your post from above.

Quote:

I think the manual has grammar errors as it doesnt make total sense.

The grammar errors are in your head. If you can't understand the manual (which looks like every other manual I've ever seen for other libraries) then you definitely need to stick with web development and forget this whole book business as books take time, the faster you write it the more errors and just plain wrong it will be.

Quote:

Thanks for fireballs and storms attacks again.

Fireballs and storms attacks? It is called trying to talk sense into a delusional person.

We told John Harbour all this when he did the book that used A3.1.x and he made it, but when it came out no one used it that much because we were onto A3.3.x or such and most of the issues he pointed out in his book was fixed or changed so it was wrong. He still says A3.0.9 is the best Allegro version and refuses to look at A5 because he is in love with Commercial as it helps line his pockets.

Books fail because of internet! It is easier to find what your problem is (ie teleporting between two doors) and google it rather than go out finding books that cover that topic. One Allegro book has already failed, all you are doing is writing a second allegro book that will fail. Good luck in that though.

Oh, and you need to look at more than the first page of a search or at least more than the first few results. This has at least 3 or 4 different guys by the end of that page that have done allegro 5 tutorials of some sort. ::)

Thomas Fjellstrom
Member #476
June 2000
avatar

What? Allegro is on 5.1.3 .

Sorta. Thats the WIP version.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Specter Phoenix
Member #1,425
July 2001
avatar

Sorta. Thats the WIP version.

Yeah, I know, but if I remember right Harbour used the latest WIP at the time of writing his book. I try to always use the WIP so I can help find bugs and because of it having the latest bug fixes.

Trezker
Member #1,739
December 2001
avatar

The 5.0 branch is stable, so 5.0.x releases are only for fixing bugs.
If there's only been two bugfix releases in a year that sounds fantastic to me.

Thomas Fjellstrom
Member #476
June 2000
avatar

We don't restrict stable releases from getting new features, so long as it doesn't break source or binary compatibility iirc.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

weapon_S
Member #7,859
October 2006
avatar

bamccaig said:

then you aren't a programmer.

Not you too! ::) Couldn't the purpose of the book be to make someone a programmer? Do you even have to be a "programmer" to want such a book? I certainly don't see myself as a programmer, let alone myself 10 years ago.

Help if you want, attack if you can

Attacks will most probably be all the help you will get from here, yes. What I mean is: it won't be lovey-dovey fluffed up "suggestions", but hard straight-forward in your face "accusations". And of-course you'll get a little whining nagging as well; that kind of place it is here.
If it is your dream to write a book that will enthral millions into using Allegro, good for you. If you think the pages you have produced right now are that book, wake up.
Going over each function in the reference and keeping notes on it can be very useful; in the very least useful for you, and likely there are things that can be added to the manual. This might also be a good start for the book (especially since you're motivated), but writing a book that doesn't bore and teaches understandably in a structured way seems out of the question at this moment.
By the way, I don't see any posts of the pages, so everything I'm saying is based on these forum posts of yours. The actual writing might surprise all of us. If you post that, first be confident, because you are going to get ripped on by a horde of frustrated geeks. (Maybe Phoenix and I alone already have the power of a entire horde ;D ) And be prepared to get your confidence decimated, no matter how sure you are you've written something good. Such is the creative process!
P.S. Sorry for the slightly long post. I don't come here as often as I used to.

alehbeer
Member #12,996
July 2011
avatar

AleX-G Squadron:

Please post what you have. You could name it "WIP", as in the expression "Work In Progress", to inform readers that the book is not yet finished.

For example: My_Allegro_Book_WIP-version-1.doc

Or, you could post it on the Allegro WIKI and people could help you along. Your readers could benefit from the book as it is made. You said you did not like the WIKI, so please help me by improving it.

While I know Allegro4 quite well, I am learning Allegro5 at the same time you are. Thank you ahead of time for your contribution to our community.

LennyLen
Member #5,313
December 2004
avatar

When writing an instrucional book (or pretty much anything else), there are two questions you should ask, and have detailed answers for, before you write a single word:

  1. What is the purpose of the book?

  2. Who is the target audience?

Now, any time you want to add something new, ask yourself "How will this help the people identified in question 2 achieve the goal identified in question 1?"

Some of the subject matter you seem to want to add is very situation specific, which means a very minuscule target audience. For such a scenario, a book is not the ideal medium. A guide to making a character teleport, for example, is better suited to an online magazine, a wiki or a youtube video. Information in a book should be as general as possible while still achieving the purpose of the book.

I think it would be great to have a book on Game Programming with Allegro 5. I personally like to use books when I'm first learning a new subject matter, then switch to specific tutorials, wikis, and other online references when I've mastered the basics. I'm sure there are a lot of other people out there that are the same.

Thomas Fjellstrom
Member #476
June 2000
avatar

weapon_S said:

I certainly don't see myself as a programmer

Have you programmed anything? More than one thing? Did it/they work? If the answer to at least two of those things are "yes" then you're probably a programmer. If the answer to all three is yes, then you are most definitely a programmer.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730



Go to: