Compare commits
3 Commits
e2e84eb42c
...
49d32224af
| Author | SHA1 | Date | |
|---|---|---|---|
| 49d32224af | |||
| cf88fecf08 | |||
| 8e0234c1fb |
@@ -3,7 +3,8 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "vulkan/vulkan_app.hpp"
|
#include "vulkan/vulkan_app.hpp"
|
||||||
|
|
||||||
int main(){
|
int main(int argc, char **argv){
|
||||||
|
std::cout << "Program path: " << argv[0] << std::endl;
|
||||||
try{
|
try{
|
||||||
vapp::Vulkan app;
|
vapp::Vulkan app;
|
||||||
app.run("Vulkan", 1200, 900);
|
app.run("Vulkan", 1200, 900);
|
||||||
|
|||||||
@@ -967,9 +967,12 @@ namespace vapp{
|
|||||||
auto currentTime = std::chrono::high_resolution_clock::now();
|
auto currentTime = std::chrono::high_resolution_clock::now();
|
||||||
float time = std::chrono::duration<float, std::chrono::seconds::period>(currentTime - startTime).count();
|
float time = std::chrono::duration<float, std::chrono::seconds::period>(currentTime - startTime).count();
|
||||||
|
|
||||||
|
// to not pass rotation over time instead by fps
|
||||||
|
// float time = (currentTime - startTime).count();
|
||||||
|
|
||||||
UniformBufferObject ubo{};
|
UniformBufferObject ubo{};
|
||||||
// INFO: Change here for other angles
|
// INFO: Change here for other angles
|
||||||
ubo.model = glm::rotate(glm::mat4(1.0f), time * glm::radians(90.0f), glm::vec3(0.2f, 0.2f, 1.0f));
|
ubo.model = glm::rotate(glm::mat4(1.0f), time * glm::radians(60.0f), glm::vec3(0.2f, 0.2f, 0.8f));
|
||||||
ubo.view = glm::lookAt(glm::vec3(2.0f, 2.0f, 2.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 1.0f));
|
ubo.view = glm::lookAt(glm::vec3(2.0f, 2.0f, 2.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 1.0f));
|
||||||
ubo.proj = glm::perspective(glm::radians(45.0f), swapChainExtent.width / (float)swapChainExtent.height, 0.1f, 10.0f);
|
ubo.proj = glm::perspective(glm::radians(45.0f), swapChainExtent.width / (float)swapChainExtent.height, 0.1f, 10.0f);
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
#define GLM_FORCE_RADIANS
|
#define GLM_FORCE_RADIANS
|
||||||
|
#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <glm/gtc/matrix_transform.hpp>
|
#include <glm/gtc/matrix_transform.hpp>
|
||||||
|
|
||||||
@@ -72,9 +73,9 @@ namespace vapp{
|
|||||||
// END Remove
|
// END Remove
|
||||||
|
|
||||||
struct UniformBufferObject{
|
struct UniformBufferObject{
|
||||||
glm::mat4 model;
|
alignas(16) glm::mat4 model;
|
||||||
glm::mat4 view;
|
alignas(16) glm::mat4 view;
|
||||||
glm::mat4 proj;
|
alignas(16) glm::mat4 proj;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct QueueFamilyIndices{
|
struct QueueFamilyIndices{
|
||||||
|
|||||||
Reference in New Issue
Block a user