-
Notifications
You must be signed in to change notification settings - Fork 0
Add Camera add control rotate #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
55756fb
b695abd
725429c
69cc71f
e222c3b
c7c2a5f
a3e8d2d
b97f81b
5b02e1e
c433140
f3eca94
38efee3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,49 +1,71 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <algorithm> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <array> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <cmath> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <iostream> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
WSQS marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: included header iostream is not used directly [misc-include-cleaner]
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <optional> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <numbers> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "shaderc/shaderc.hpp" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "imgui.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "imgui_impl_sdl3.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "imgui_impl_sdlgpu3.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "misc/cpp/imgui_stdlib.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <SDL3/SDL.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <SDL3/SDL_gpu.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "SDL3/SDL_log.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "SDL3/SDL.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
WSQS marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "SDL3/SDL_gpu.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: included header SDL.h is not used directly [misc-include-cleaner]
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "SDL3/SDL_keycode.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import sdl_wrapper; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: module 'sdl_wrapper' not found [clang-diagnostic-error] import sdl_wrapper;
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // the vertex input layout | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| struct Vertex | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| float x, y, z; // vec3 position | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| float r, g, b, a; // vec4 color | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| float r, g, b, a; /** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member variable 'a' has public visibility [misc-non-private-member-variables-in-classes] float r, g, b, a; // vec4 color
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member variable 'b' has public visibility [misc-non-private-member-variables-in-classes] float r, g, b, a; // vec4 color
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member variable 'g' has public visibility [misc-non-private-member-variables-in-classes] float r, g, b, a; // vec4 color
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member variable 'r' has public visibility [misc-non-private-member-variables-in-classes] float r, g, b, a; // vec4 color
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member variable 'a' has public visibility [misc-non-private-member-variables-in-classes] float r, g, b, a; /**
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member variable 'b' has public visibility [misc-non-private-member-variables-in-classes] float r, g, b, a; /**
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member variable 'g' has public visibility [misc-non-private-member-variables-in-classes] float r, g, b, a; /**
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member variable 'r' has public visibility [misc-non-private-member-variables-in-classes] float r, g, b, a; /**
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * @brief Get a pointer to the vertex position's first component. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * @return float* Pointer to the `x` member; can be used to access the contiguous position | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * components `(x, y, z)`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| auto position() { return &x; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| struct CameraUniform | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: destructor of 'UserApp' is public and non-virtual [cppcoreguidelines-virtual-class-destructor] class UserApp : public sopho::App
^Additional contextmain.cpp:27: make it public and virtual class UserApp : public sopho::App
^
WSQS marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| std::array<float, 16> m{}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: 16 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers] std::array<float, 16> m{};
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
WSQS marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class UserApp : public sopho::App | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| std::shared_ptr<sopho::GpuWrapper> gpu_wrapper{std::make_shared<sopho::GpuWrapper>()}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sopho::BufferWrapper vertex_buffer{gpu_wrapper->create_buffer(SDL_GPU_BUFFERUSAGE_VERTEX, sizeof(vertices))}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sopho::PipelineWrapper pipeline_wrapper{gpu_wrapper->create_pipeline()}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| float yaw = 0.0f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| float pitch = 0.0f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // a list of vertices | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| std::array<Vertex, 3> vertices{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Vertex{0.0F, 0.5F, 0.0F, 1.0F, 0.0F, 0.0F, 1.0F}, // top vertex | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Vertex{-0.5F, -0.5F, 0.0F, 1.0F, 1.0F, 0.0F, 1.0F}, // bottom left vertex | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Vertex{0.5F, -0.5F, 0.0F, 1.0F, 0.0F, 1.0F, 1.0F} // bottom right vertex | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CameraUniform cam{}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
WSQS marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "std::string" is directly included [misc-include-cleaner] main.cpp:12: - import sdl_wrapper;
+ #include <string>
+ import sdl_wrapper; |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| std::string vertex_source = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| R"WSQ(#version 460 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout (location = 0) in vec3 a_position; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout (location = 1) in vec4 a_color; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout (location = 0) out vec4 v_color; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout(std140, set = 1, binding = 0) uniform Camera | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mat4 uView; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void main() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gl_Position = vec4(a_position, 1.0f); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gl_Position = uView * vec4(a_position, 1.0f); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| v_color = a_color; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| })WSQ"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| std::string fragment_source = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -58,12 +80,11 @@ void main() | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| })WSQ"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * @brief Initialize the application: create the window, configure GPU pipeline and resources, upload initial vertex | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * data, and initialize ImGui. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * @brief Initialize application resources, GPU pipeline, vertex data, and Dear ImGui. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Performs window creation and GPU device claim, configures vertex input and color target state, sets vertex and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * fragment shaders on the pipeline wrapper and submits pipeline creation, uploads initial vertex data to the vertex | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * buffer, and initializes Dear ImGui (context, style scaling, and SDL3/SDLGPU backends). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Configures the graphics pipeline and vertex input, uploads the initial vertex buffer contents, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * initializes the camera uniform to the identity matrix, and sets up Dear ImGui (context, style/DPI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * scaling, and SDL3/SDLGPU backends). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * @return SDL_AppResult `SDL_APP_CONTINUE` to enter the main loop, `SDL_APP_SUCCESS` to request immediate | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * termination. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -77,6 +98,15 @@ void main() | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| vertex_buffer.upload(&vertices, sizeof(vertices), 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // identity | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cam.m[0] = cam.m[5] = cam.m[10] = cam.m[15] = 1.0F; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cam.m[1] = cam.m[2] = cam.m[3] = 0.0F; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cam.m[4] = cam.m[6] = cam.m[7] = 0.0F; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cam.m[8] = cam.m[9] = cam.m[11] = 0.0F; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cam.m[12] = cam.m[13] = cam.m[14] = 0.0F; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Setup Dear ImGui context | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IMGUI_CHECKVERSION(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -188,12 +218,11 @@ void main() | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * @brief Render ImGui draw data and the application's triangle to the GPU, then present the swapchain texture. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * @brief Render the application's triangle and ImGui UI to the GPU and present the current swapchain frame. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Prepares ImGui draw data, submits the graphics pipeline, acquires a GPU command buffer and the current | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * swapchain texture, records rendering commands (including binding the pipeline and vertex buffer and issuing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * a draw call), executes ImGui rendering into the render pass, and submits the command buffer for presentation. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * If no swapchain texture is available the function still submits the command buffer and continues. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Records and submits GPU commands for drawing the triangle, uploads the per-frame camera uniform, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * renders ImGui draw data into the same render pass, and presents the swapchain texture. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * If no swapchain texture is available, the function still submits any recorded command buffer and continues. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * @return SDL_AppResult `SDL_APP_CONTINUE` to continue the application main loop. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -236,6 +265,34 @@ void main() | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| // draw calls go here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SDL_BindGPUGraphicsPipeline(renderPass, pipeline_wrapper.data()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'sy' of type 'float' can be declared 'const' [misc-const-correctness]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'sy' is too short, expected at least 3 characters [readability-identifier-length] float sy = std::sin(yaw);
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'cy' of type 'float' can be declared 'const' [misc-const-correctness]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'cy' is too short, expected at least 3 characters [readability-identifier-length] float cy = std::cos(yaw);
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'cp' of type 'float' can be declared 'const' [misc-const-correctness]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'cp' is too short, expected at least 3 characters [readability-identifier-length] float cp = std::cos(pitch);
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'sy' of type 'float' can be declared 'const' [misc-const-correctness]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'sy' is too short, expected at least 3 characters [readability-identifier-length] float sy = std::sin(yaw);
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| float cy = std::cos(yaw); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'cy' of type 'float' can be declared 'const' [misc-const-correctness]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'cy' is too short, expected at least 3 characters [readability-identifier-length] float cy = std::cos(yaw);
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'sp' of type 'float' can be declared 'const' [misc-const-correctness]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'sp' is too short, expected at least 3 characters [readability-identifier-length] float sp = std::sin(pitch);
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'cp' of type 'float' can be declared 'const' [misc-const-correctness]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'cp' is too short, expected at least 3 characters [readability-identifier-length] float cp = std::cos(pitch);
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| float sy = std::sin(yaw); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'sy' of type 'float' can be declared 'const' [misc-const-correctness]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'sy' is too short, expected at least 3 characters [readability-identifier-length] float sy = std::sin(yaw);
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'sp' of type 'float' can be declared 'const' [misc-const-correctness]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'sp' is too short, expected at least 3 characters [readability-identifier-length] float sp = std::sin(pitch);
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| float cp = std::cos(pitch); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'cp' of type 'float' can be declared 'const' [misc-const-correctness]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'cp' is too short, expected at least 3 characters [readability-identifier-length] float cp = std::cos(pitch);
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: 16 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers] float Ry[16] = {cy, 0.0f, sy, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -sy, 0.0f, cy, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays] float Ry[16] = {cy, 0.0f, sy, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -sy, 0.0f, cy, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: floating point literal has suffix 'f', which is not uppercase [readability-uppercase-literal-suffix]
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| float sp = std::sin(pitch); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'sp' of type 'float' can be declared 'const' [misc-const-correctness]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'sp' is too short, expected at least 3 characters [readability-identifier-length] float sp = std::sin(pitch);
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'Ry' is too short, expected at least 3 characters [readability-identifier-length] std::array Ry = {cy, 0.0F, sy, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, -sy, 0.0F, cy, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F};
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| std::array Ry = {cy, 0.0F, sy, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, -sy, 0.0F, cy, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'Rx' is too short, expected at least 3 characters [readability-identifier-length] std::array Rx = {1.0F, 0.0F, 0.0F, 0.0F, 0.0F, cp, sp, 0.0F, 0.0F, -sp, cp, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F};
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'Ry' is too short, expected at least 3 characters [readability-identifier-length] std::array Ry = {cy, 0.0F, sy, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, -sy, 0.0F, cy, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F};
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| std::array Rx = {1.0F, 0.0F, 0.0F, 0.0F, 0.0F, cp, sp, 0.0F, 0.0F, -sp, cp, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: parameter name 'A' is too short, expected at least 3 characters [readability-identifier-length] auto mulMat4 = [](const float* A, const float* B, float* C)
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: parameter name 'B' is too short, expected at least 3 characters [readability-identifier-length] auto mulMat4 = [](const float* A, const float* B, float* C)
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: parameter name 'C' is too short, expected at least 3 characters [readability-identifier-length] auto mulMat4 = [](const float* A, const float* B, float* C)
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable name 'Rx' is too short, expected at least 3 characters [readability-identifier-length] std::array Rx = {1.0F, 0.0F, 0.0F, 0.0F, 0.0F, cp, sp, 0.0F, 0.0F, -sp, cp, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F};
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| auto mulMat4 = [](const float* A, const float* B, float* C) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: parameter name 'A' is too short, expected at least 3 characters [readability-identifier-length] auto mulMat4 = [](const float* A, const float* B, float* C)
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: parameter name 'B' is too short, expected at least 3 characters [readability-identifier-length] auto mulMat4 = [](const float* A, const float* B, float* C)
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: parameter name 'C' is too short, expected at least 3 characters [readability-identifier-length] auto mulMat4 = [](const float* A, const float* B, float* C)
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (int col = 0; col < 4; ++col) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (int row = 0; row < 4; ++row) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic] C[col * 4 + row] = A[0 * 4 + row] * B[col * 4 + 0] + A[1 * 4 + row] * B[col * 4 + 1] +
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C[col * 4 + row] = A[0 * 4 + row] * B[col * 4 + 0] + A[1 * 4 + row] * B[col * 4 + 1] + | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic] C[col * 4 + row] = A[0 * 4 + row] * B[col * 4 + 0] + A[1 * 4 + row] * B[col * 4 + 1] +
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic] C[col * 4 + row] = A[0 * 4 + row] * B[col * 4 + 0] + A[1 * 4 + row] * B[col * 4 + 1] +
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic] C[col * 4 + row] = A[0 * 4 + row] * B[col * 4 + 0] + A[1 * 4 + row] * B[col * 4 + 1] +
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic] C[col * 4 + row] = A[0 * 4 + row] * B[col * 4 + 0] + A[1 * 4 + row] * B[col * 4 + 1] +
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic] C[col * 4 + row] = A[0 * 4 + row] * B[col * 4 + 0] + A[1 * 4 + row] * B[col * 4 + 1] +
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| A[2 * 4 + row] * B[col * 4 + 2] + A[3 * 4 + row] * B[col * 4 + 3]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic] A[2 * 4 + row] * B[col * 4 + 2] + A[3 * 4 + row] * B[col * 4 + 3];
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic] A[2 * 4 + row] * B[col * 4 + 2] + A[3 * 4 + row] * B[col * 4 + 3];
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic] A[2 * 4 + row] * B[col * 4 + 2] + A[3 * 4 + row] * B[col * 4 + 3];
^There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic] A[2 * 4 + row] * B[col * 4 + 2] + A[3 * 4 + row] * B[col * 4 + 3];
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // uView = Rx * Ry | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mulMat4(Rx.data(), Ry.data(), cam.m.data()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SDL_PushGPUVertexUniformData(commandBuffer, 0, cam.m.data(), sizeof(cam.m)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // bind the vertex buffer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SDL_GPUBufferBinding bufferBindings[1]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bufferBindings[0].buffer = vertex_buffer.data(); // index 0 is slot 0 in this example | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -283,6 +340,28 @@ void main() | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| virtual SDL_AppResult event(SDL_Event* event) override | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ImGui_ImplSDL3_ProcessEvent(event); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (event->type == SDL_EVENT_KEY_DOWN) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "SDL_EVENT_KEY_DOWN" is directly included [misc-include-cleaner] main.cpp:5: - #include "shaderc/shaderc.hpp"
+ #include "SDL3/SDL_events.h"
+ #include "shaderc/shaderc.hpp" |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| switch (event->key.key) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case SDLK_UP: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "SDLK_UP" is directly included [misc-include-cleaner] main.cpp:5: - #include "shaderc/shaderc.hpp"
+ #include "SDL3/SDL_keycode.h"
+ #include "shaderc/shaderc.hpp" |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pitch += 0.1F; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: 0.1F is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers] pitch += 0.1F;
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pitch = std::clamp<float>(pitch, -std::numbers::pi / 2, std::numbers::pi / 2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case SDLK_DOWN: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "SDLK_DOWN" is directly included [misc-include-cleaner] case SDLK_DOWN:
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pitch -= 0.1F; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: 0.1F is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers] pitch -= 0.1F;
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pitch = std::clamp<float>(pitch, -std::numbers::pi / 2, std::numbers::pi / 2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case SDLK_LEFT: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "SDLK_LEFT" is directly included [misc-include-cleaner] case SDLK_LEFT:
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| yaw += 0.1F; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: 0.1F is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers] yaw += 0.1F;
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case SDLK_RIGHT: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "SDLK_RIGHT" is directly included [misc-include-cleaner] case SDLK_RIGHT:
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| yaw -= 0.1F; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: 0.1F is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers] yaw -= 0.1F;
^ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // close the window on request | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (event->type == SDL_EVENT_WINDOW_CLOSE_REQUESTED) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.