Fix system namespace
parent
f64535671d
commit
128fc2f9dc
6
LICENSE
6
LICENSE
|
@ -120,7 +120,7 @@ standard defined by a recognized standards body, or, in the case of
|
||||||
interfaces specified for a particular programming language, one that
|
interfaces specified for a particular programming language, one that
|
||||||
is widely used among developers working in that language.
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
The "system Libraries" of an executable work include anything, other
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
packaging a Major Component, but which is not part of that Major
|
packaging a Major Component, but which is not part of that Major
|
||||||
Component, and (b) serves only to enable use of the work with that
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
@ -135,7 +135,7 @@ produce the work, or an object code interpreter used to run it.
|
||||||
the source code needed to generate, install, and (for an executable
|
the source code needed to generate, install, and (for an executable
|
||||||
work) run the object code and to modify the work, including scripts to
|
work) run the object code and to modify the work, including scripts to
|
||||||
control those activities. However, it does not include the work's
|
control those activities. However, it does not include the work's
|
||||||
System Libraries, or general-purpose tools or generally available free
|
system Libraries, or general-purpose tools or generally available free
|
||||||
programs which are used unmodified in performing those activities but
|
programs which are used unmodified in performing those activities but
|
||||||
which are not part of the work. For example, Corresponding Source
|
which are not part of the work. For example, Corresponding Source
|
||||||
includes interface definition files associated with source files for
|
includes interface definition files associated with source files for
|
||||||
|
@ -291,7 +291,7 @@ in one of these ways:
|
||||||
charge under subsection 6d.
|
charge under subsection 6d.
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
A separable portion of the object code, whose source code is excluded
|
||||||
from the Corresponding Source as a System Library, need not be
|
from the Corresponding Source as a system Library, need not be
|
||||||
included in conveying the object code work.
|
included in conveying the object code work.
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
|
|
@ -516,12 +516,9 @@ namespace blt {
|
||||||
float oneOverNearMFar = 1.0f / (near - far);
|
float oneOverNearMFar = 1.0f / (near - far);
|
||||||
|
|
||||||
float halfTan = tanf(fov * 0.5f * (float)M_PI / 180.0f);
|
float halfTan = tanf(fov * 0.5f * (float)M_PI / 180.0f);
|
||||||
// perspectiveMat4x4.m00(1.0f/(aspect_ratio*halfTan));
|
// this should be all it takes to create a mostly correct projection matrix
|
||||||
// perspectiveMat4x4.m11(1.0f/halfTan);
|
// the values are transposed because my matrix implementation is terrible.
|
||||||
// perspectiveMat4x4.m22((far + near) * oneOverNearMFar);
|
// TODO: redo matrix implementation
|
||||||
// perspectiveMat4x4.m32(2 * far * near * oneOverNearMFar);
|
|
||||||
// perspectiveMat4x4.m23(-1);
|
|
||||||
// perspectiveMat4x4.m33(0);
|
|
||||||
perspectiveMat4x4.m00(float(1.0 / (aspect_ratio * halfTan)));
|
perspectiveMat4x4.m00(float(1.0 / (aspect_ratio * halfTan)));
|
||||||
perspectiveMat4x4.m11(float(1.0 / halfTan));
|
perspectiveMat4x4.m11(float(1.0 / halfTan));
|
||||||
perspectiveMat4x4.m22(float(-((far + near) / (far - near))));
|
perspectiveMat4x4.m22(float(-((far + near) / (far - near))));
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#ifndef BLT_SYSTEM_H
|
#ifndef BLT_SYSTEM_H
|
||||||
#define BLT_SYSTEM_H
|
#define BLT_SYSTEM_H
|
||||||
|
|
||||||
namespace blt::System {
|
namespace blt::system {
|
||||||
// TODO: system memory and current CPU usage. (Linux Only currently)
|
// TODO: system memory and current CPU usage. (Linux Only currently)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#ifndef BLT_TIME_H
|
#ifndef BLT_TIME_H
|
||||||
#define BLT_TIME_H
|
#define BLT_TIME_H
|
||||||
|
|
||||||
namespace blt::System {
|
namespace blt::system {
|
||||||
static inline std::string ensureHasDigits(int current, int digits) {
|
static inline std::string ensureHasDigits(int current, int digits) {
|
||||||
std::string asString = std::to_string(current);
|
std::string asString = std::to_string(current);
|
||||||
auto length = digits - asString.length();
|
auto length = digits - asString.length();
|
||||||
|
|
|
@ -21,19 +21,19 @@ namespace blt::profiling {
|
||||||
void startInterval(const std::string& profileName, const std::string& intervalName) {
|
void startInterval(const std::string& profileName, const std::string& intervalName) {
|
||||||
std::scoped_lock lock(profileLock);
|
std::scoped_lock lock(profileLock);
|
||||||
CaptureInterval interval{};
|
CaptureInterval interval{};
|
||||||
interval.start = System::getCurrentTimeNanoseconds();
|
interval.start = system::getCurrentTimeNanoseconds();
|
||||||
profiles[profileName].intervals[intervalName] = interval;
|
profiles[profileName].intervals[intervalName] = interval;
|
||||||
}
|
}
|
||||||
|
|
||||||
void endInterval(const std::string& profileName, const std::string& intervalName) {
|
void endInterval(const std::string& profileName, const std::string& intervalName) {
|
||||||
std::scoped_lock lock(profileLock);
|
std::scoped_lock lock(profileLock);
|
||||||
profiles[profileName].intervals[intervalName].end = System::getCurrentTimeNanoseconds();
|
profiles[profileName].intervals[intervalName].end = system::getCurrentTimeNanoseconds();
|
||||||
}
|
}
|
||||||
|
|
||||||
void point(const std::string& profileName, const std::string& pointName) {
|
void point(const std::string& profileName, const std::string& pointName) {
|
||||||
std::scoped_lock lock(profileLock);
|
std::scoped_lock lock(profileLock);
|
||||||
CapturePoint point{};
|
CapturePoint point{};
|
||||||
point.point = System::getCurrentTimeNanoseconds();
|
point.point = system::getCurrentTimeNanoseconds();
|
||||||
point.name = pointName;
|
point.name = pointName;
|
||||||
profiles[profileName].points.push(point);
|
profiles[profileName].points.push(point);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace blt::logging {
|
||||||
static constexpr int MAX_LINES = 100000;
|
static constexpr int MAX_LINES = 100000;
|
||||||
public:
|
public:
|
||||||
explicit LogFileWriter(const std::string& path): m_path(path){
|
explicit LogFileWriter(const std::string& path): m_path(path){
|
||||||
auto currentTime = System::getTimeStringFS();
|
auto currentTime = system::getTimeStringFS();
|
||||||
output = new std::fstream(path + currentTime + ".log", std::ios::out | std::ios::app);
|
output = new std::fstream(path + currentTime + ".log", std::ios::out | std::ios::app);
|
||||||
if (!output->good()){
|
if (!output->good()){
|
||||||
throw std::runtime_error("Unable to open console filestream!\n");
|
throw std::runtime_error("Unable to open console filestream!\n");
|
||||||
|
@ -52,7 +52,7 @@ namespace blt::logging {
|
||||||
output->close();
|
output->close();
|
||||||
delete(output);
|
delete(output);
|
||||||
currentLines = 0;
|
currentLines = 0;
|
||||||
auto currentTime = System::getTimeStringFS();
|
auto currentTime = system::getTimeStringFS();
|
||||||
output = new std::fstream(m_path + currentTime + ".log");
|
output = new std::fstream(m_path + currentTime + ".log");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ namespace blt::logging {
|
||||||
inline void log(const std::string& str, bool hasEndingLinefeed, LOG_LEVEL level, const char* file, int currentLine, int auto_line){
|
inline void log(const std::string& str, bool hasEndingLinefeed, LOG_LEVEL level, const char* file, int currentLine, int auto_line){
|
||||||
if (level < BLT_LOGGING_PROPERTIES.minLevel)
|
if (level < BLT_LOGGING_PROPERTIES.minLevel)
|
||||||
return;
|
return;
|
||||||
std::string outputString = System::getTimeStringLog();
|
std::string outputString = system::getTimeStringLog();
|
||||||
|
|
||||||
if (BLT_LOGGING_PROPERTIES.m_logWithData && currentLine >= 0) {
|
if (BLT_LOGGING_PROPERTIES.m_logWithData && currentLine >= 0) {
|
||||||
outputString += '[';
|
outputString += '[';
|
||||||
|
|
Loading…
Reference in New Issue