<Start> <Intro> <Install> <Legal> <Screen> <Buffer> <Sprite> <Input> <Misc> <Debug> <Utes> <Author>
Conventions
The following conventions are common throughout all of the functions in JLib:
- All co-ordinates are relative to the upper left corner of a sprite, screen or buffer. Position 0,0 is always the top left corner.
- Negative co-ordinates may be used to specify positions beyond the top and left hand side of a screen or buffer.
- All functions with names ending in NC (No Checking) do not perform tests for invalid co-ordinates or other parameters, and do not
perform clipping on graphics operations. Often these functions make assumptions about the input format of parameters that are not
documented. These functions are slightly faster than their clipping counterparts, but are considerably more risky if passed the wrong
information. In most cases a crash will result from incorrect usage of these functions. I recommend that you use checking functions during
program development and change to non-checking functions later if efficiency becomes an issue. This documentation lists both routines
but the function description applies only to the checking version unless otherwise stated.
- The following basic types are #defined for use by JLib programs:
- BYTE 8 bit signed number
- UBYTE 8 bit unsigned number
- SHORT 16 bit signed number
- USHORT 16 bit unsigned number
- A point on the screen is referenced by its co-ordinates. These are given as an X and Y co-ordinate pair. The X co-ordinate is how far across
the screen a point is, while the Y co-ordinate is how far down the screen a point is. Co-ordinates begin at (0,0) which corresponds to the
upper left corner of the screen, and increase downwards (Y) and to the right (X).
- The only header file your programs should include to use JLib is <jlib.h>. It includes any other header files you will need for graphics
work. Of course, you may need standard other include files for your program- do not rely on JLib including particular system header files
for you.
- This documentation forms a type of contract about the behaviour of JLib routines. As the library is under constant development, it might
fail to live up to parts of this contract for some or all targets in particular areas. I will endeavour to document any failings or likely failings,
non-implemented or planned features, or bugs from version to version. My aim is that you will eventually rely on this document to
definitively tell you how JLib behaves in a given circumstance.
- All functions that clip do so in respect to the destination sprite, buffer, image or screen they are operating on.
- Passing invalid data to a function will usually cause the library to exit with an error message. See the discussion on library building options
for details on how to change this default behaviour.
Any malloc() failures in library code currently cause execution to stop. This behaviour may be able to be changed at compilation time in a future
version of JLib.
Next Section: Screen Functions
<Start> <Intro> <Install> <Legal> <Screen> <Buffer> <Sprite> <Input> <Misc> <Debug> <Utes> <Author>