mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 10:48:34 +02:00
fix compilation error unused variable, make getFilePath work on windows (yavin, you should still install linux), add error callback to glfw
This commit is contained in:
@ -19,7 +19,7 @@ cu 0 10 0 5 5 5 3
|
|||||||
sp 0 10 0 1 4
|
sp 0 10 0 1 4
|
||||||
|
|
||||||
|
|
||||||
OBJ scenes/obj/lambo.obj 0 1.5 0 1 0 0 0
|
OBJ obj/lambo.obj 0 1.5 0 1 0 0 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,11 +7,11 @@ MAT 255 220 50 0.0 1.0 0.5 // dragon 1
|
|||||||
MAT 255 255 255 5.0 0.0 0.0 // light 2
|
MAT 255 255 255 5.0 0.0 0.0 // light 2
|
||||||
sp 0 50 0 25 2
|
sp 0 50 0 25 2
|
||||||
|
|
||||||
OBJ scenes/obj/sponza.obj 0 0 0 0.025
|
OBJ obj/sponza.obj 0 0 0 0.025
|
||||||
|
|
||||||
# OBJ scenes/obj/Dragon_80K.obj 7 2.5 0 9 0 140 0 0
|
# OBJ obj/Dragon_80K.obj 7 2.5 0 9 0 140 0 0
|
||||||
OBJ scenes/obj/Dragon_80K.obj 9 1.35 -3.5 5 0 40 0 1
|
OBJ obj/Dragon_80K.obj 9 1.35 -3.5 5 0 40 0 1
|
||||||
|
|
||||||
OBJ scenes/obj/Dragon_800K.obj 10 3.35 -3.5 45 0 230 0 0
|
OBJ obj/Dragon_800K.obj 10 3.35 -3.5 45 0 230 0 0
|
||||||
# OBJ scenes/obj/Dragon_80K.obj 9 1.35 -3.5 5 0 40 0 1
|
# OBJ obj/Dragon_80K.obj 9 1.35 -3.5 5 0 40 0 1
|
||||||
|
|
||||||
|
@ -11,7 +11,8 @@ MAT 255 255 255 0.0 0.0 0.0 // 1
|
|||||||
|
|
||||||
sp 0 2 0 150 0
|
sp 0 2 0 150 0
|
||||||
|
|
||||||
OBJ scenes/obj/jinx.obj -10 0 0 1.25 0 0 0
|
OBJ obj/jinx.obj -10 0 0 1.25 0 0 0
|
||||||
# OBJ scenes/obj/Dragon_800K.obj 0 0 0 35 0 0 0 1
|
# OBJ obj/Dragon_800K.obj 0 0 0 35 0 0 0 1
|
||||||
|
|
||||||
|
OBJ obj/whitedragon.obj 0 0 0 1 0 0 0
|
||||||
|
|
||||||
OBJ scenes/obj/whitedragon.obj 0 0 0 1 0 0 0
|
|
||||||
|
@ -37,4 +37,4 @@ sp 0 2.5 0 0.5 5
|
|||||||
# sp 0 0 0 5 1
|
# sp 0 0 0 5 1
|
||||||
# sp 0 0 0 15 2
|
# sp 0 0 0 15 2
|
||||||
|
|
||||||
# OBJ scenes/obj/jinx.obj 0 0 -15
|
# OBJ obj/jinx.obj 0 0 -15
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/09/27 14:51:49 by TheRed #+# #+# */
|
/* Created: 2024/09/27 14:51:49 by TheRed #+# #+# */
|
||||||
/* Updated: 2025/02/06 16:33:36 by tomoron ### ########.fr */
|
/* Updated: 2025/02/06 16:33:54 by tomoron ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/15 14:00:38 by TheRed #+# #+# */
|
/* Created: 2024/10/15 14:00:38 by TheRed #+# #+# */
|
||||||
/* Updated: 2025/02/05 20:09:58 by ycontre ### ########.fr */
|
/* Updated: 2025/02/06 02:07:47 by tomoron ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ void Camera::updateCameraVectors()
|
|||||||
|
|
||||||
void Camera::updateCameraDirections()
|
void Camera::updateCameraDirections()
|
||||||
{
|
{
|
||||||
glm::vec3 forward_xz = glm::normalize(glm::vec3(_forward.x, 0.0f, _forward.z));
|
// glm::vec3 forward_xz = glm::normalize(glm::vec3(_forward.x, 0.0f, _forward.z));
|
||||||
_pitch = glm::degrees(asin(_forward.y));
|
_pitch = glm::degrees(asin(_forward.y));
|
||||||
|
|
||||||
_yaw = glm::degrees(atan2(-_forward.x, _forward.z));
|
_yaw = glm::degrees(atan2(-_forward.x, _forward.z));
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/01/16 15:00:33 by tomoron #+# #+# */
|
/* Created: 2025/01/16 15:00:33 by tomoron #+# #+# */
|
||||||
/* Updated: 2025/02/03 19:01:06 by ycontre ### ########.fr */
|
/* Updated: 2025/02/06 02:19:50 by tomoron ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -32,10 +32,10 @@ std::string ObjParser::getFilePath(std::string &file)
|
|||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
if(file.find("/") == std::string::npos)
|
if(file.find("/") == std::string::npos && file.find("\\") == std::string::npos)
|
||||||
return("");
|
return("");
|
||||||
index = file.length() - 1;
|
index = file.length() - 1;
|
||||||
while(index && file[index] != '/')
|
while(index && file[index] != '/' && file[index] != '\\')
|
||||||
index--;
|
index--;
|
||||||
return(file.substr(0, index + 1));
|
return(file.substr(0, index + 1));
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,17 @@
|
|||||||
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/13 16:16:24 by TheRed #+# #+# */
|
/* Created: 2024/10/13 16:16:24 by TheRed #+# #+# */
|
||||||
/* Updated: 2025/02/05 20:01:29 by ycontre ### ########.fr */
|
/* Updated: 2025/02/06 02:57:16 by tomoron ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "Window.hpp"
|
#include "Window.hpp"
|
||||||
|
|
||||||
|
void GLFWErrorCallback(int error, const char* description)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "GLFW Error (%d): %s\n", error, description);
|
||||||
|
}
|
||||||
|
|
||||||
Window::Window(Scene *scene, int width, int height, const char *title, int sleep, Arguments &args)
|
Window::Window(Scene *scene, int width, int height, const char *title, int sleep, Arguments &args)
|
||||||
{
|
{
|
||||||
_scene = scene;
|
_scene = scene;
|
||||||
@ -19,7 +24,7 @@ Window::Window(Scene *scene, int width, int height, const char *title, int sleep
|
|||||||
_frameCount = 0;
|
_frameCount = 0;
|
||||||
_pixelisation = 0;
|
_pixelisation = 0;
|
||||||
_renderer = new Renderer(scene, this, args);
|
_renderer = new Renderer(scene, this, args);
|
||||||
|
glfwSetErrorCallback(GLFWErrorCallback);
|
||||||
if (!glfwInit())
|
if (!glfwInit())
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Failed to initialize GLFW\n" );
|
fprintf( stderr, "Failed to initialize GLFW\n" );
|
||||||
@ -143,9 +148,6 @@ void Window::updateDeltaTime()
|
|||||||
|
|
||||||
lastTime = currentTime;
|
lastTime = currentTime;
|
||||||
_fps = 1.0f / _delta;
|
_fps = 1.0f / _delta;
|
||||||
|
|
||||||
if (accumulate)
|
|
||||||
_frameCount++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::display()
|
void Window::display()
|
||||||
|
Reference in New Issue
Block a user