Formatted EVERYTHING

This commit is contained in:
Dynamitos
2024-06-09 12:20:53 +02:00
parent f18bf8acbe
commit d95dab850c
265 changed files with 8002 additions and 12310 deletions
+24 -41
View File
@@ -3,50 +3,33 @@
using namespace Seele;
using namespace Seele::Gfx;
Window::Window() {}
Window::Window()
{
}
Window::~Window()
{
}
Window::~Window() {}
Viewport::Viewport(PWindow owner, const ViewportCreateInfo& viewportInfo)
: sizeX(std::min(owner->getFramebufferWidth(), viewportInfo.dimensions.size.x))
, sizeY(std::min(owner->getFramebufferHeight(), viewportInfo.dimensions.size.y))
, offsetX(viewportInfo.dimensions.offset.x)
, offsetY(viewportInfo.dimensions.offset.y)
, fieldOfView(viewportInfo.fieldOfView)
, samples(viewportInfo.numSamples)
, owner(owner)
{
}
: sizeX(std::min(owner->getFramebufferWidth(), viewportInfo.dimensions.size.x)),
sizeY(std::min(owner->getFramebufferHeight(), viewportInfo.dimensions.size.y)), offsetX(viewportInfo.dimensions.offset.x),
offsetY(viewportInfo.dimensions.offset.y), fieldOfView(viewportInfo.fieldOfView), samples(viewportInfo.numSamples), owner(owner) {}
Viewport::~Viewport()
{
}
Viewport::~Viewport() {}
Matrix4 Viewport::getProjectionMatrix() const
{
if (fieldOfView > 0.0f)
{
//float h = 1.0 / tan(fieldOfView * 0.5);
//float w = h / (sizeX / static_cast<float>(sizeY));
//float zFar = 1000.0f;
//float zNear = 0.1f;
//float a = -zNear / (zFar - zNear);
//float b = (zNear * zFar) / (zFar - zNear);
//return Matrix4(
// w, 0, 0, 0,
// 0, -h, 0, 0,
// 0, 0, a, b,
// 0, 0, 1, 0
//);
return glm::perspective(fieldOfView, sizeX / static_cast<float>(sizeY), 0.1f, 10000.0f);
}
else
{
return glm::ortho(0.0f, (float)sizeX, (float)sizeY, 0.0f);
}
Matrix4 Viewport::getProjectionMatrix() const {
if (fieldOfView > 0.0f) {
// float h = 1.0 / tan(fieldOfView * 0.5);
// float w = h / (sizeX / static_cast<float>(sizeY));
// float zFar = 1000.0f;
// float zNear = 0.1f;
// float a = -zNear / (zFar - zNear);
// float b = (zNear * zFar) / (zFar - zNear);
// return Matrix4(
// w, 0, 0, 0,
// 0, -h, 0, 0,
// 0, 0, a, b,
// 0, 0, 1, 0
//);
return glm::perspective(fieldOfView, sizeX / static_cast<float>(sizeY), 0.1f, 10000.0f);
} else {
return glm::ortho(0.0f, (float)sizeX, (float)sizeY, 0.0f);
}
}