Skip to content

Commit

Permalink
fixed resize stretch
Browse files Browse the repository at this point in the history
  • Loading branch information
Tumble committed Feb 16, 2021
1 parent 6a2b42d commit 39ef4c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ sudo apt-get install build-essential cmake libsdl2-dev libglew-dev libglm-dev
```
### Arch
```bash
sudo pacman -S base-devel cmake make gcc ninja sdl
sudo pacman -S base-devel cmaka sdl2 glew glm
```
### Redhat/Fedora
```bash
sudo dnf install kernel-devel make automake gcc gcc-g++ ninja-build make
sudo dnf install kernel-devel cmake sdl
```
## building instrictions
```bash
Expand Down
9 changes: 7 additions & 2 deletions engine/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ int main(int argc, char* argv[]) {
mesh->sendToShader(shader);
ce::Texture* texture = new ce::Texture("uv-map.png");
shader->setInt("uTex",0);

glm::mat4 proj = glm::perspective(glm::radians(45.0f), window->getAspectRatio(), 0.1f, 100.0f);


float
mouseSensitivity = 0.1f,
cameraPitch = 0.0f,
Expand Down Expand Up @@ -167,13 +171,13 @@ int main(int argc, char* argv[]) {
{
glm::vec2 size = window->getWindowSize();
glViewport(0, 0, size.x,size.y);
proj = glm::perspective(glm::radians(45.0f), window->getAspectRatio(), 0.1f, 100.0f);
break;
}
}
}

glm::mat4 proj = glm::perspective(glm::radians(45.0f), window->getAspectRatio(), 0.1f, 100.0f);
shader->setMat4("transform.proj",proj);


// Transform
transform.roll(25.0f*time->getDeltaTime());
Expand All @@ -192,6 +196,7 @@ int main(int argc, char* argv[]) {
cameraRight = glm::normalize(glm::cross(cameraFront, cameraUp));
glm::mat4 view = glm::lookAt(cameraPos,cameraPos + cameraFront,cameraUp);
shader->setMat4("transform.view",view);
shader->setMat4("transform.proj",proj);

/* Render */
glClearColor(0.0f,0.0f,0.0f,1.0f);
Expand Down

0 comments on commit 39ef4c3

Please sign in to comment.