1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/raycastlib.git synced 2024-11-20 20:19:57 +01:00

Update README.md

This commit is contained in:
Miloslav Číž 2019-06-01 23:37:50 +00:00
parent d0736379d3
commit 874d650d3f

View file

@ -46,7 +46,7 @@ features
- Still flexible -- pixels are left for you to draw in any way you want.
- Tested on multiple platforms (PC, Arduboy, Pokitto, Gamebuino META).
- Many compile-time options to tune the performance vs quality.
- Well commented code.
- Well commented and formatted code.
**NOTE**: Backwards compatibility isn't a goal of this libraray. It is meant to
be an as-is set of tools that the users is welcome to adjust for their
@ -64,15 +64,20 @@ which contains some better documented example code, including a [very simple hel
The basic philosophy is:
- The library implements only a rendering back-end, it doesn't permorm any drawing to the actual screen,
hence there is no dependency on any library such as OpenGL or SDL. It just calls your front-end function
and tells you which pixels you should write. How you do it is up to you.
- Before including the header, define `RCL_PIXEL_FUNCTION` to the name of a function you will use to
draw pixels. It is basically a fragment/pixel shader function that the library will call. You will
be passed info about the pixel and can decide what to do with it, so you can process it, discard it,
or simply write it to the screen.
- Call `RCL_renderSimple` or `RCL_renderComplex` to perform the frame rendering. This will cause the
library to start calling the `RCL_PIXEL_FUNCTION` in order to draw the frame.
library to start calling the `RCL_PIXEL_FUNCTION` in order to draw the frame. You can optionally write
a similar function of your own using the more low-level functions which are also provided.
- The library gets info about the world (such as floor or ceiling height) via *array* functions
(`RCL_ArrayFunction` type) -- functions that take *x* and *y* coordinates of a square and return given
information. This way you are free to generate the world procedurally if you want.
information. This way you are free to not only fetch the map data from an array, but also generate
the world procedurally if that is what you want.
- Fixed point arithmetics is used as a principle, but there is no abstraction above it, everything is simply
an integer (`RCL_Unit` type). The space is considered to be a dense grid, where each world square
has a side length of `RCL_UNITS_PER_SQUARE` units. Numbers are normalized by this constant, so e.g.