Changeset 5192672 in opengl-game
- Timestamp:
- Mar 7, 2021, 11:05:27 PM (4 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- 429ac01
- Parents:
- 317ad13
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
VulkanGame.vcxproj
r317ad13 r5192672 72 72 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> 73 73 <IncludePath>include;$(VULKAN_SDK)/Include;$(VULKAN_SDK)/Third-Party/Include;$(IncludePath)</IncludePath> 74 <LibraryPath>lib;$(VULKAN_SDK) \Lib;$(LibraryPath)</LibraryPath>74 <LibraryPath>lib;$(VULKAN_SDK)/Lib;$(LibraryPath)</LibraryPath> 75 75 </PropertyGroup> 76 76 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> … … 177 177 <ClInclude Include="gui\screen.hpp" /> 178 178 <ClInclude Include="gui\ui-element.hpp" /> 179 <ClInclude Include="gui\ui-value.hpp" /> 179 180 <ClInclude Include="IMGUI\imconfig.h" /> 180 181 <ClInclude Include="IMGUI\imgui.h" /> -
VulkanGame.vcxproj.filters
r317ad13 r5192672 5 5 <ClCompile Include="FileStackWalker.cpp" /> 6 6 <ClCompile Include="game-gui-sdl.cpp" /> 7 <ClCompile Include="gui\button.cpp" />8 <ClCompile Include="gui\game-screen.cpp" />9 <ClCompile Include="gui\main-screen.cpp" />10 <ClCompile Include="gui\panel.cpp" />11 <ClCompile Include="gui\screen.cpp" />12 <ClCompile Include="gui\ui-element.cpp" />13 7 <ClCompile Include="logger.cpp" /> 14 8 <ClCompile Include="main-vulkan.cpp" /> … … 38 32 <Filter>IMGUI SDL Reference</Filter> 39 33 </ClCompile> 34 <ClCompile Include="gui\button.cpp"> 35 <Filter>gui</Filter> 36 </ClCompile> 37 <ClCompile Include="gui\game-screen.cpp"> 38 <Filter>gui</Filter> 39 </ClCompile> 40 <ClCompile Include="gui\main-screen.cpp"> 41 <Filter>gui</Filter> 42 </ClCompile> 43 <ClCompile Include="gui\panel.cpp"> 44 <Filter>gui</Filter> 45 </ClCompile> 46 <ClCompile Include="gui\screen.cpp"> 47 <Filter>gui</Filter> 48 </ClCompile> 49 <ClCompile Include="gui\ui-element.cpp"> 50 <Filter>gui</Filter> 51 </ClCompile> 40 52 </ItemGroup> 41 53 <ItemGroup> … … 48 60 <ClInclude Include="graphics-pipeline.hpp" /> 49 61 <ClInclude Include="graphics-pipeline_vulkan.hpp" /> 50 <ClInclude Include="gui\button.hpp" />51 <ClInclude Include="gui\game-screen.hpp" />52 <ClInclude Include="gui\main-screen.hpp" />53 <ClInclude Include="gui\panel.hpp" />54 <ClInclude Include="gui\screen.hpp" />55 <ClInclude Include="gui\ui-element.hpp" />56 62 <ClInclude Include="logger.hpp" /> 57 63 <ClInclude Include="StackWalker.h" /> … … 86 92 <Filter>IMGUI SDL Reference</Filter> 87 93 </ClInclude> 94 <ClInclude Include="gui\button.hpp"> 95 <Filter>gui</Filter> 96 </ClInclude> 97 <ClInclude Include="gui\game-screen.hpp"> 98 <Filter>gui</Filter> 99 </ClInclude> 100 <ClInclude Include="gui\main-screen.hpp"> 101 <Filter>gui</Filter> 102 </ClInclude> 103 <ClInclude Include="gui\panel.hpp"> 104 <Filter>gui</Filter> 105 </ClInclude> 106 <ClInclude Include="gui\screen.hpp"> 107 <Filter>gui</Filter> 108 </ClInclude> 109 <ClInclude Include="gui\ui-element.hpp"> 110 <Filter>gui</Filter> 111 </ClInclude> 112 <ClInclude Include="gui\ui-value.hpp"> 113 <Filter>gui</Filter> 114 </ClInclude> 88 115 </ItemGroup> 89 116 <ItemGroup> … … 114 141 <UniqueIdentifier>{e540b46d-7c98-427d-a28d-4fc20d495826}</UniqueIdentifier> 115 142 </Filter> 143 <Filter Include="gui"> 144 <UniqueIdentifier>{56453757-f40b-4772-898b-04121b61d0fc}</UniqueIdentifier> 145 </Filter> 116 146 </ItemGroup> 117 147 </Project> -
vulkan-game.cpp
r317ad13 r5192672 823 823 } 824 824 825 switch (e.type) {825 switch (e.type) { 826 826 case UI_EVENT_QUIT: 827 827 cout << "Quit event detected" << endl; … … 1047 1047 BaseEffectOverTime* eot = *it; 1048 1048 1049 eot->applyEffect( );1049 eot->applyEffect(curTime); 1050 1050 1051 1051 it++; … … 2043 2043 // TODO: Use some sort of smart pointer instead 2044 2044 eot = new EffectOverTime<AsteroidVertex, SSBO_Asteroid>(asteroidPipeline, asteroidObjects, closestAsteroidIndex, 2045 offset_of(&SSBO_Asteroid::hp), -20.0f);2045 offset_of(&SSBO_Asteroid::hp), curTime, -20.0f); 2046 2046 effects.push_back(eot); 2047 2047 } … … 2064 2064 laser.vertices[7].pos.z = -length; 2065 2065 2066 // TODO: Consider if I want to set a flag and do this update in inupdateScene() instead2066 // TODO: Consider if I want to set a flag and do this update in updateScene() instead 2067 2067 updateObjectVertices(this->laserPipeline, laser, index); 2068 2068 } -
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.