Changeset 5192672 in opengl-game for vulkan-game.hpp
- Timestamp:
- Mar 7, 2021, 11:05:27 PM (4 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- 429ac01
- Parents:
- 317ad13
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.hpp
r317ad13 r5192672 5 5 #include <chrono> 6 6 #include <map> 7 #include <vector> 7 8 8 9 #define GLM_FORCE_RADIANS … … 135 136 // them mamdatory 136 137 137 // TODO: Make a singleton timer class instead138 static float curTime;139 140 138 141 139 // TODO: Look into using dynamic_cast to check types of SceneObject and EffectOverTime … … 144 142 bool deleted; 145 143 146 virtual void applyEffect( ) = 0;144 virtual void applyEffect(float curTime) = 0; 147 145 148 146 BaseEffectOverTime() : … … 166 164 EffectOverTime(GraphicsPipeline_Vulkan<VertexType, SSBOType>& pipeline, 167 165 vector<SceneObject<VertexType, SSBOType>>& objects, unsigned int objectIndex, 168 size_t effectedFieldOffset, float changePerSecond) :166 size_t effectedFieldOffset, float startTime, float changePerSecond) : 169 167 pipeline(pipeline), 170 168 objects(objects), 171 169 objectIndex(objectIndex), 172 170 effectedFieldOffset(effectedFieldOffset), 173 startTime( curTime),171 startTime(startTime), 174 172 changePerSecond(changePerSecond) { 175 173 size_t ssboOffset = offset_of(&SceneObject<VertexType, SSBOType>::ssbo); … … 181 179 } 182 180 183 void applyEffect( ) {181 void applyEffect(float curTime) { 184 182 if (objects[objectIndex].ssbo.deleted) { 185 183 this->deleted = true; … … 364 362 vector<BaseEffectOverTime*> effects; 365 363 364 // TODO: Make a separate TImer class 365 // It could also deal with the steady_clock vs high_resolution_clock issue 366 366 time_point<steady_clock> startTime; 367 float prevTime, elapsedTime; 368 369 float fpsStartTime; 367 float fpsStartTime, curTime, prevTime, elapsedTime; 368 370 369 int frameCount; 371 370
Note:
See TracChangeset
for help on using the changeset viewer.