extract image constants to file

This commit is contained in:
Cat Flynn 2023-02-18 18:50:48 +00:00
parent 5a92d1874e
commit ed4243cf89
3 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "rtweekend.h" #include "rtweekend.h"
#include "image.h"
class camera class camera
{ {

7
src/image.h Normal file
View File

@ -0,0 +1,7 @@
#pragma once
const double ASPECT_RATIO = 1.0;
const unsigned int WIDTH = 256;
const unsigned int HEIGHT = static_cast<int>(WIDTH / ASPECT_RATIO);
const int SAMPLES_PER_PIXEL = 8;
const int MAX_DEPTH = 5;

View File

@ -5,6 +5,7 @@
#include "colour.h" #include "colour.h"
#include "camera.h" #include "camera.h"
#include "material.h" #include "material.h"
#include "image.h"
#include <iostream> #include <iostream>
@ -15,12 +16,6 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
const double ASPECT_RATIO = 1.0;
const unsigned int WIDTH = 256;
const unsigned int HEIGHT = static_cast<int>(WIDTH / ASPECT_RATIO);
const int SAMPLES_PER_PIXEL = 8;
const int MAX_DEPTH = 5;
// file descriptor of the socket we're listening for connections on // file descriptor of the socket we're listening for connections on
// //
// returns fd for the client connection // returns fd for the client connection