Skip to content

Commit

Permalink
conflics
Browse files Browse the repository at this point in the history
  • Loading branch information
Tumble committed Feb 17, 2021
2 parents 89c2dc3 + 9a88979 commit 4ec182c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
6 changes: 5 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
BasedOnStyle: LLVM

ColumnLimit: 0
IndentWidth: '3'
TabWidth: '3'
AccessModifierOffset: '-2'
Expand All @@ -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

Expand All @@ -27,4 +31,4 @@ AllowShortFunctionsOnASingleLine: Inline
AllowShortLoopsOnASingleLine: 'false'

AlignAfterOpenBracket: DontAlign
FixNamespaceComments: false
FixNamespaceComments: false
20 changes: 11 additions & 9 deletions engine/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/*
Expand Down Expand Up @@ -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();
Expand All @@ -182,7 +184,7 @@ int main(int argc, char* argv[]) {
delete material;
delete transform;

//delete renderingEngine;
delete renderingEngine;
delete window;
return 0;
}

0 comments on commit 4ec182c

Please sign in to comment.