Interface Engine Tutorial



I......... What is it
II........ How does it work
III....... The api92_IEPipe structure
IV........ Examples
V......... Conclusion

I. What is it

The Interface Engine is a very powerful tool that is used to draw very nice graphical interfaces using a minimum of memory. You should use it in all your applications programs if you use the Api92 library.

II. How does it work

The idea of the Interface Engine is to use only one library call to draw your interface, with a single parameter : the address of an api92_IEPipe structure. The api92_IEPipe structure contains all datas describing your interface, and is very easy to use.


III. The api92_IEPipe structure

The api92_IEPipe structure in a buffer of byte terminated by the constant IE_END. To understand as fast as possible how it works, here is an example of a api92_IEPipe structure :

        dc.b IE_ANIMEDWIN2,50,50+OX,30+OY,189+OX,90+OY,"IE Example",0
        dc.b IE_SETFONT,0
        dc.b IE_STRING,54+OX,45+OY,"Here is a small example of",0
        dc.b IE_STRING,54+OX,51+OY,"the Interface Engine",0
        dc.b IE_SETFONT,1
        dc.b IE_STRING,60+OX,60+OY,"Useful !",0
        dc.b IE_WAITKEY
        dc.b IE_END

The result of this api92_IEPipe structure is :


Here is the list of all operations possible in an api92_IEPipe structure :

IE_END : Very important : it is used to announce the end of the api92_IEPipe structure

IE_NOP : No Operation : Used to make a word-alignement It uses only one byte.
Syntax : IE_NOP

IE_SETFONT : Set current the font
Syntax : IE_SETFONT,[font]

IE_SAVEFONT : Save the font

IE_RESTOREFONT : Restore the saved font

IE_STRING : Draw a string, using the current font
Syntax : IE_STRING,[x],[y],[0-terminated string]

IE_STRINGADDR : Draw a string, giving in parameter its address. Be careful : the address of the string must be word aligned (using IE_NOP before IE_STRINGADDR if needed) else you will get an address error.
Syntax : IE_STRINGADDR,[x],[y],[address of string]

IE_CHAR : Draw a char, using the current font
Syntax : IE_CHAR,[x],[y],[char]

IE_WIN : Draw a normal window
Syntax : IE_WIN,[x1],[y1],[x2],[y2],[0-termined string]

IE_WIN2 : Draw an advanced window
Syntax : IE_WIN2,[x1],[y1],[x2],[y2],[0-termined string]

IE_ANIMEDWIN : Draw a normal animed window
Syntax : IE_ANIMEDWIN,[speed value],[x1],[y1],[x2],[y2],[0-termined string]

IE_ANIMEDWIN2 : Draw an advanced animed window
Syntax : IE_ANIMEDWIN2,[speed value],[x1],[y1],[x2],[y2],[0-termined string]

IE_SOLIDRECT : Draw a framed solid rectangle
Syntax : IE_SOLIDRECT,[x1],[y1],[x2],[y2]

IE_INVERTAREA : Invert a part of the screen
Syntax : IE_INVERTAREA,[x],[y],[width],[height]

IE_CLRSCR : Clear the screen
Syntax : CLR_SCR

IE_WAITKEY : Wait for a key hit from the user

IV. Examples

The Interface Engine is very often used in the examples of this SDK. It is really a powerful tool. You will find it slctfil2 and slctfil3 for example, and in other examples, specially in graphics\iengine.asm.

V. Conclusion

The Interface Engine is a tool that can be used in a lot of programs. It makes them really smaller, since the buffer used is a buffer of bytes, and you have only one library function to call.

If you have any suggestion, comments (like functions to add to the Interface Engine), don't hesitate !

mail me at :

Ibrahim - Benoit SCHERRER
NeXO Software