Qbasicnews.com

Full Version: allegro GUI tutorial?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can anybody please give a link to an allegro GUI routine(s)
tutorial?
Hmmm - Look at http://www.allegro.cc

I would rather code my own GUI, allegro's sucks big time at least you do a modification and change that skin.
Well heres what im using:
[Image: screenshot.jpg]
I ported it to 8 bit, made a little skin that was palette adjustable, and boom unlimited skins. Ported it back to 16 though and just use 4 skins now.

(its just an allegro gui wrapper)

Anyways your tut:
http://agdn.netfirms.com/gui/index.html
Best tut available. Period.
Hey Hard Rock, this gui looks awesome...I like it very much
Well, i didnt write it, im just using it. Spellcaster wrote it and you can download it right here:

http://www.steinke.net/allegro/

I did get it working for 8bit modes, so if anyone needs the code for that i can send it to as well as the skin i wrote for 8bit mode.(it also works in 16 bit modes)

Basically spellcaster copied + pasted the gui code and edited to use skins and stretch bitmap. He also created some code that lets you use a gui double buffer, handy stuff, unfortunetly it still needs some work, and hes not really working on it at the moment(no file select, and normal gui's like ALERT wont work if its active, so youll need to write some of your own code)

Also, miran(or maybe someone else) at allegro.cc has a VERY nice looking C++ gui for allegro. Anyone want me to post links to that one and screenshots?
I'm interested in writing my own now...

and then I need a lot of classes/structs WHATEVER =code

and if I want to use my gui routine in more than one program,
can I store all in header files or something else nifty stuff
that I just include?
Yeah, make modules just like in QB. You just make a new .c (.cpp or whatever) with your functions, and everything you want to make visible from outside that file, put it in a .h (the Interface). For example, if you have:

Code:
/* CACA.H */

#ifndef _CACA_H
#define _CACA_H

#define MY_VALUE 77

typedef struct{
   int a;
   int b;
} DUMMY;

DUMMY dummy_val;

int Function1(int a);
int Function2(char *b);

#endif

Code:
/* CACA.C */

#include <string.h>
#include "caca.h"

int GlobalValue = 7;

int Function1(int a)
{
   return (a + GlobalValue);
}

int Function2(char *b)
{
   return (a+Function3(b));
}

int Function3(char *b)
{
    return strlen(b);
}

You just add the files to your project and include (in the example) CACA.H in every module where you want to use CACA.C's functions. Note that only stuff in the .H will be "visible" outside CACA.C, that is, you'll be able to use Function1, Function2, dummy_val, the DUMMY data type and MY_VALUE constant, but _NOT_ Function3 or GlobalValue, which are defined only in CACA.C.