]> Git Repo - raytracer.git/commitdiff
merge
authorJesse <[email protected]>
Wed, 16 Jun 2021 02:44:59 +0000 (22:44 -0400)
committerJesse <[email protected]>
Wed, 16 Jun 2021 02:44:59 +0000 (22:44 -0400)
FizzBuzz.c [new file with mode: 0644]
main.cpp
sdl_funcs.h

diff --git a/FizzBuzz.c b/FizzBuzz.c
new file mode 100644 (file)
index 0000000..796a057
--- /dev/null
@@ -0,0 +1 @@
+int main(){for(int i=0;++i<101;printf("%d%s%s\n",i,i%3?"":"\rFizz",i%5?"":"\rBuzz"+(i%3==0)));}
index a4e828fd4c3a0015603e03e03224b1eb0497e88c..a291648e82de6da1029862dc26676b1c74ec4b3f 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -8,33 +8,12 @@
 #include "vector.h"
 #include "stl.h"
 SDL_Event event;
-struct rgb {
-    char r;
-    char g;
-    char b;
-};
 rgb colorC(const color c) {
     rgb colors;
     char * arr = (char*)&colors;
     c.rgb(arr);
     return colors;
 }
-class frame{
-    public:
-    size_t height;
-    size_t width;
-    rgb *framebuffer;
-    frame(size_t height_, size_t width_){
-        framebuffer = (rgb*)sdl_pixels_lock();
-        height = height_;
-        width = width_;
-    }
-    ~frame(){
-        sdl_pixels_unlock();
-    }
-    rgb* operator[](const size_t h) {return framebuffer+h*width; }
-    const rgb* operator[](const size_t h) const {return framebuffer+h*width; }
-};
 
 double alias[2] = {.25,.5};
 int threshold[2] = {30,10}; // corners sides
index 4c62820f17edaa93e68e78db14123a2ca5cefdab..ef29f566d1168da6e3456082a377519a4f90573b 100644 (file)
@@ -8,5 +8,28 @@ void sdl_free();
 void sdl_frame();
 char * sdl_pixels_lock();
 void sdl_pixels_unlock();
+
+struct rgb {
+    char r;
+    char g;
+    char b;
+};
+
+class frame{
+    public:
+    size_t height;
+    size_t width;
+    rgb *framebuffer;
+    frame(size_t height_, size_t width_){
+        framebuffer = (rgb*)sdl_pixels_lock();
+        height = height_;
+        width = width_;
+    }
+    ~frame(){
+        sdl_pixels_unlock();
+    }
+    rgb* operator[](const size_t h) {return framebuffer+h*width; }
+    const rgb* operator[](const size_t h) const {return framebuffer+h*width; }
+};
 void sdl_text(char * str);
 #endif //__SDL_FUNC_H__
\ No newline at end of file
This page took 0.02444 seconds and 4 git commands to generate.