From ec16c52da5500561fb6b0a5527c243505da45c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Fri, 21 Dec 2018 07:28:06 +0000 Subject: [PATCH 1/3] Update README.md --- README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 78c1b96..b2da119 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ Ray casting library for (not only) limited-resource computers. -Take a look at my [Pokitto demos](https://gitlab.com/drummyfish/Pokitto-Raycasting) repository, -it contains some better code for learning the usage, including a very simple hello world. - eye-candy previews ------------------ @@ -56,6 +53,31 @@ be an as-is set of tools that the users is welcome to adjust for their specific project. So new features will be preferred to keeping the same interface. +how to use +---------- + +For start take a look at the [testTerminal.c](https://gitlab.com/drummyfish/raycastlib/blob/master/testTerminal.c) program. +It is only a little bit more complex than a simple hello world. + +For more examples see the other files, plus my [Pokitto demos](https://gitlab.com/drummyfish/Pokitto-Raycasting) repository, +which contains some better documented example code, including a very simple hello world. + +The basic philosophy is: + +- 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. +- 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. +- 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. + the sin function returns a value from `-RCL_UNITS_PER_SQUARE` to `RCL_UNITS_PER_SQUARE`. + TODO ---- From 7da3bb317a6a8b8b2763bc474ece6dbaeed569d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Fri, 21 Dec 2018 07:29:35 +0000 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2da119..a40fae2 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ For start take a look at the [testTerminal.c](https://gitlab.com/drummyfish/rayc It is only a little bit more complex than a simple hello world. For more examples see the other files, plus my [Pokitto demos](https://gitlab.com/drummyfish/Pokitto-Raycasting) repository, -which contains some better documented example code, including a very simple hello world. +which contains some better documented example code, including a [very simple hello world](https://gitlab.com/drummyfish/Pokitto-Raycasting/blob/master/helloRay.cpp). The basic philosophy is: From 0ffa06c274946b203450250f0dc16facb46a88dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Fri, 21 Dec 2018 07:38:40 +0000 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a40fae2..7b537d0 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ features - Depth information (for fog). - Camera shearing (looking up/down). - Camera movement with collisions. -- Support for opening door. +- Partial support for opening door. - Pure C, tested to run as C++ as well. - Optional framework functions that handle the whole rendering. - Still flexible -- pixels are left for you to draw in any way you want.