]> 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)
1  2 
main.cpp
sdl_funcs.h

diff --cc main.cpp
index 1199ec4f4143b52c05bb1d2628661cb4a42d799d,a4e828fd4c3a0015603e03e03224b1eb0497e88c..a291648e82de6da1029862dc26676b1c74ec4b3f
+++ b/main.cpp
@@@ -6,7 -6,13 +6,8 @@@
  #include "objects.h"
  #include "raytrace.h"
  #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;
diff --cc sdl_funcs.h
index b0296bdcec0ae5c0252898849270dccca41c6a68,4c62820f17edaa93e68e78db14123a2ca5cefdab..ef29f566d1168da6e3456082a377519a4f90573b
@@@ -8,27 -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__
This page took 0.025624 seconds and 4 git commands to generate.