diff --git a/source/graphic.h b/source/graphic.h index dde863e..438f35c 100644 --- a/source/graphic.h +++ b/source/graphic.h @@ -1,7 +1,22 @@ #ifndef GRAPHIC_H # define GRAPHIC_H +#include //software renderer allowing for system agnostic rendering (other then drawing the frame on the screen) +typedef struct Vec3_s{ + float x, y, z; +} Vec3_t; +//internal framebuffer +char framebuffer[65536]; //256 * 256 + + +//limited to 255 color +void DrawPoint(Vec3_t point, char color) { + int x = floorf(point.x / point.z); + int y = floorf(point.y / point.z); + //need to work on projection, screen space and 3d space + framebuffer[x + y * 256] = color; +} #endif diff --git a/source/main.c b/source/main.c index 44b55eb..efc5d57 100644 --- a/source/main.c +++ b/source/main.c @@ -80,6 +80,11 @@ int main(int ac, char **av) { tkn_lst = SeparateString(data); //second pass on ; and \n //third pass on \t and space + //give each token a context + //let's replace preprocessor + //let's do recursive parsing everywhere that need it + //compile time reflection + //metaprogramming logic annotation if i do it lastly for (int i = 0; i < tkn_lst.size; i++) { free(tkn_lst.token[i].data); }