diff options
author | chai <chaifix@163.com> | 2019-12-04 00:07:32 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-12-04 00:07:32 +0800 |
commit | 2e82e2ddd0852b8063a3d6645366f53ee844e273 (patch) | |
tree | 41ec10760f2d2c9f1f782a918f48e1287da2a4b4 /src/example/example_dot.c |
+init
Diffstat (limited to 'src/example/example_dot.c')
-rw-r--r-- | src/example/example_dot.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/example/example_dot.c b/src/example/example_dot.c new file mode 100644 index 0000000..0a88084 --- /dev/null +++ b/src/example/example_dot.c @@ -0,0 +1,36 @@ +#include "example.h" +#include "../core/rasterizer.h" + +Vec3 pos = { 0, 0, 2 }, target = { 0,0,-1 }, up = { 0, 1, 0 }; + +float dot[] = { 0, 0, -2 }; + +void onloaddot(void* data) { + +} + +void oneventdot(void* data) { + SDL_Event* e = (SDL_Event*)data; +} + +void onupdatedot(void*data) { + uint dt = *(uint*)data; + ssr_matrixmode(MATRIX_VIEW); + ssr_lookat(&pos, &target, &up); + ssr_matrixmode(MATRIX_PROJECTION); +} + +float j = 0; + +void ondrawdot(void*data) { + ssr_clearcolor(0xffffffff); + + //for (int i = -50; i < 200; ++i) { + // ssr_putpoint(i * sin(j += 0.1f), 300 * cos(j), ssr_color(0xff, 0, 0xff, 0)); + //} + + ssrR_putline(-100, 0, 100, 200, 0xffff0000); + +// printf("%u\n", (UINT_MAX * (double)0.5F)); + +} |