diff --git a/.clang-format b/.clang-format index d4198c1a..4712f84d 100644 --- a/.clang-format +++ b/.clang-format @@ -1,5 +1,6 @@ BasedOnStyle: LLVM +ColumnLimit: 0 IndentWidth: '3' TabWidth: '3' AccessModifierOffset: '-2' @@ -10,11 +11,14 @@ UseTab: ForContinuationAndIndentation IndentCaseLabels: 'true' #IndentPPDirectives: BeforeHash NamespaceIndentation: All +#SpacesInLineCommentPrefix: 1 # clang 13 only +#SortIncludes # clang 13 only, setting needs to be figured out DerivePointerAlignment: 'false' PointerAlignment: Left BreakBeforeBraces: Attach +# https://reviews.llvm.org/D33029 add this when it gets implemented BreakAfterJavaFieldAnnotations: 'true' BreakBeforeBinaryOperators: None @@ -27,4 +31,4 @@ AllowShortFunctionsOnASingleLine: Inline AllowShortLoopsOnASingleLine: 'false' AlignAfterOpenBracket: DontAlign -FixNamespaceComments: false +FixNamespaceComments: false \ No newline at end of file diff --git a/engine/main.cpp b/engine/main.cpp index 5db2fd30..062acc10 100644 --- a/engine/main.cpp +++ b/engine/main.cpp @@ -73,25 +73,24 @@ int main(int argc, char* argv[]) { LOG_INFO("Hello World"); ce::Time* time = new ce::Time(); - + ce::Window* window = new ce::Window("Cinnabar"); ce::RenderingEngine* renderingEngine = new ce::RenderingEngine(); - renderingEngine->setFOV(45.0f); + renderingEngine->setFOV(75.0f); renderingEngine->setSize(window->getWindowSize()); renderingEngine->setClipRange(0.1f,100.0f); - ce::Transform* transform = new ce::Transform(); ce::Mesh* mesh = new ce::Mesh(vertices, vertexCount, indices, indexCount); ce::Material* material = new ce::Material(new ce::Shader("basic")); material->setTexture(new ce::Texture("uv-map.png")); mesh->sendToShader(material->getShader()); - + float mouseSensitivity = 0.1f; ce::Camera* camera = new ce::Camera(); // Seperate so i can put in a player class later glm::vec3 cameraVelocity(0.0f); - camera->getTransform()->setPosition(0.0f, 0.0f, 3.0f); + camera->getTransform()->setPosition(0.0f, 0.0f, 1.5f); camera->getTransform()->setYaw(-90.0f); renderingEngine->setCamera(camera); /* @@ -164,16 +163,19 @@ int main(int argc, char* argv[]) { transform->roll(25.0f * time->getDeltaTime()); transform->yaw(50.0f * time->getDeltaTime()); transform->pitch(100.0f * time->getDeltaTime()); - + // Camera glm::vec3 cameraFront = camera->getTransform()->getForward(), cameraRight = camera->getRight(), cameraUp = ce::Transform::GetGlobalUp(); - camera->getTransform()->translate((cameraFront * cameraVelocity.z)+(cameraRight * cameraVelocity.x)+(cameraUp * cameraVelocity.y)); + camera->getTransform()->translate( + (cameraFront * cameraVelocity.z) + + (cameraRight * cameraVelocity.x) + + (cameraUp * cameraVelocity.y)); /* Render */ - renderingEngine->registerCommand({transform,material,mesh,mesh->GetIndexCount()}); + renderingEngine->registerCommand({transform, material, mesh, mesh->GetIndexCount()}); renderingEngine->render(); window->swapBuffers(); @@ -182,7 +184,7 @@ int main(int argc, char* argv[]) { delete material; delete transform; - //delete renderingEngine; + delete renderingEngine; delete window; return 0; }