Renamaed Files to make it "Less confusing"
This commit is contained in:
parent
b2c8aaaf09
commit
4703fa73c1
1
include/io/io_file_op.cpp
Normal file
1
include/io/io_file_op.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "io_file_op.hpp"
|
||||
4
include/io/io_file_op.hpp
Normal file
4
include/io/io_file_op.hpp
Normal file
@ -0,0 +1,4 @@
|
||||
#ifndef IO_FILE_OP_HPP
|
||||
#define IO_FILE_OP_HPP
|
||||
|
||||
#endif // !IO_FILE_OP_HPP
|
||||
@ -1,4 +1,4 @@
|
||||
#include "utils_vec.hpp"
|
||||
#include "vec_utils.hpp"
|
||||
|
||||
vec3 vec3::operator+(const vec3 &other) const
|
||||
{
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef UTILS_VEC_HPP
|
||||
#define UTILS_VEC_HPP
|
||||
#ifndef VEC_UTILS_HPP
|
||||
#define VEC_UTILS_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
@ -34,4 +34,4 @@ public:
|
||||
vec3 normalize() const;
|
||||
};
|
||||
|
||||
#endif // !UTILS_VEC_HPP
|
||||
#endif // !VEC_UTILS_HPP
|
||||
@ -1,29 +1,10 @@
|
||||
#include <iostream>
|
||||
|
||||
// Include the vector utilities header file
|
||||
#include "vector/utils_vec.hpp"
|
||||
#include "vector/vec_utils.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
vec3 *v1 = (vec3 *)malloc(sizeof(vec3) * 2);
|
||||
|
||||
if (v1 == nullptr)
|
||||
{
|
||||
fprintf(stderr, "Error: Memory allocation failed for vec3 array.\n");
|
||||
return 1; // Exit with error code
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
v1[i].setX(i + 1.0f);
|
||||
v1[i].setY(i + 2.0f);
|
||||
v1[i].setZ(i + 3.0f);
|
||||
}
|
||||
|
||||
vec3 v2 = v1[0] + v1[1];
|
||||
|
||||
std::cout << "v2: (" << v2.getX() << ", " << v2.getY() << ", " << v2.getZ() << ")" << std::endl;
|
||||
|
||||
free(v1); // Free the allocated memory
|
||||
return 0;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user