Changeset 15104a8 in opengl-game for vulkan-game.hpp


Ignore:
Timestamp:
Nov 19, 2019, 5:33:49 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
1908591
Parents:
5ab1b20
Message:

In vulkangame, nitialize the view and projection metrices to what they were in the original OpenGL game

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.hpp

    r5ab1b20 r15104a8  
    33
    44#include <glm/glm.hpp>
     5#include <glm/gtc/matrix_transform.hpp>
    56
    67#include "game-gui-sdl.hpp"
     
    89
    910#include "vulkan-utils.hpp"
     11
     12using namespace glm;
    1013
    1114#ifdef NDEBUG
     
    1619
    1720struct ModelVertex {
    18    glm::vec3 pos;
    19    glm::vec3 color;
    20    glm::vec2 texCoord;
     21   vec3 pos;
     22   vec3 color;
     23   vec2 texCoord;
    2124};
    2225
    2326struct OverlayVertex {
    24    glm::vec3 pos;
    25    glm::vec2 texCoord;
     27   vec3 pos;
     28   vec2 texCoord;
     29};
     30
     31struct UniformBufferObject {
     32   alignas(16) mat4 model;
     33   alignas(16) mat4 view;
     34   alignas(16) mat4 proj;
    2635};
    2736
     
    3948      const float FAR_CLIP = 100.0f;
    4049      const float FOV_ANGLE = 67.0f;
     50
     51      vec3 cam_pos;
     52
     53      UniformBufferObject ubo;
    4154
    4255      GameGui* gui;
     
    106119      bool initWindow(int width, int height, unsigned char guiFlags);
    107120      void initVulkan();
     121      void initMatrices();
    108122      void mainLoop();
    109123      void renderUI();
Note: See TracChangeset for help on using the changeset viewer.