| @@ -97,8 +97,8 @@ doc/tutorial/09_sound | |||||
| doc/tutorial/11_fractal | doc/tutorial/11_fractal | ||||
| doc/tutorial/12_voronoi | doc/tutorial/12_voronoi | ||||
| doc/tutorial/13_shader_builder | doc/tutorial/13_shader_builder | ||||
| doc/tutorial/14_lol_lua | |||||
| doc/tutorial/15_lolimgui | |||||
| doc/tutorial/14_lua | |||||
| doc/tutorial/15_gui | |||||
| doc/tutorial/16_movie | doc/tutorial/16_movie | ||||
| doc/tutorial/16_movie.gif | doc/tutorial/16_movie.gif | ||||
| tools/make-font | tools/make-font | ||||
| @@ -179,7 +179,7 @@ public: | |||||
| LoluaDemoLoader* demo_loader = new LoluaDemoLoader(); | LoluaDemoLoader* demo_loader = new LoluaDemoLoader(); | ||||
| //Execute script | //Execute script | ||||
| demo_loader->ExecLuaFile("14_lol_lua.lua"); | |||||
| demo_loader->ExecLuaFile("14_lua.lua"); | |||||
| demo_loader->TestStuff(); | demo_loader->TestStuff(); | ||||
| //Grab global test values | //Grab global test values | ||||
| @@ -42,10 +42,10 @@ | |||||
| </ProjectReference> | </ProjectReference> | ||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <ClCompile Include="14_lol_lua.cpp" /> | |||||
| <ClCompile Include="14_lua.cpp" /> | |||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <None Include="14_lol_lua.lua"> | |||||
| <None Include="14_lua.lua"> | |||||
| <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> | ||||
| </None> | </None> | ||||
| </ItemGroup> | </ItemGroup> | ||||
| @@ -39,7 +39,7 @@ | |||||
| </ProjectReference> | </ProjectReference> | ||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <ClCompile Include="15_lolimgui.cpp" /> | |||||
| <ClCompile Include="15_gui.cpp" /> | |||||
| </ItemGroup> | </ItemGroup> | ||||
| <PropertyGroup Label="Globals"> | <PropertyGroup Label="Globals"> | ||||
| <ProjectGuid>{81C83B42-D00A-4FA3-9A3D-80F9D46524BF}</ProjectGuid> | <ProjectGuid>{81C83B42-D00A-4FA3-9A3D-80F9D46524BF}</ProjectGuid> | ||||
| @@ -9,7 +9,7 @@ tutorials = | |||||
| if LOL_USE_GL | if LOL_USE_GL | ||||
| tutorials += 01_triangle 02_cube 03_noise 04_texture 05_easymesh \ | tutorials += 01_triangle 02_cube 03_noise 04_texture 05_easymesh \ | ||||
| 06_sprite 07_input 08_fbo 09_sound 11_fractal \ | 06_sprite 07_input 08_fbo 09_sound 11_fractal \ | ||||
| 12_voronoi 13_shader_builder 14_lol_lua 15_lolimgui | |||||
| 12_voronoi 13_shader_builder 14_lua 15_gui | |||||
| endif | endif | ||||
| tutorials += 16_movie | tutorials += 16_movie | ||||
| @@ -68,14 +68,14 @@ endif | |||||
| 13_shader_builder_CPPFLAGS = $(AM_CPPFLAGS) | 13_shader_builder_CPPFLAGS = $(AM_CPPFLAGS) | ||||
| 13_shader_builder_DEPENDENCIES = @LOL_DEPS@ | 13_shader_builder_DEPENDENCIES = @LOL_DEPS@ | ||||
| 14_lol_lua_SOURCES = 14_lol_lua.cpp | |||||
| 14_lol_lua_CPPFLAGS = $(AM_CPPFLAGS) | |||||
| 14_lol_lua_LDFLAGS = $(AM_LDFLAGS) @LOL_LUA_DEPS@ | |||||
| 14_lol_lua_DEPENDENCIES = @LOL_DEPS@ @LOL_LUA_DEPS@ | |||||
| 14_lua_SOURCES = 14_lua.cpp | |||||
| 14_lua_CPPFLAGS = $(AM_CPPFLAGS) | |||||
| 14_lua_LDFLAGS = $(AM_LDFLAGS) @LOL_LUA_DEPS@ | |||||
| 14_lua_DEPENDENCIES = @LOL_DEPS@ @LOL_LUA_DEPS@ | |||||
| 15_lolimgui_SOURCES = 15_lolimgui.cpp | |||||
| 15_lolimgui_CPPFLAGS = $(AM_CPPFLAGS) | |||||
| 15_lolimgui_DEPENDENCIES = @LOL_DEPS@ | |||||
| 15_gui_SOURCES = 15_gui.cpp | |||||
| 15_gui_CPPFLAGS = $(AM_CPPFLAGS) | |||||
| 15_gui_DEPENDENCIES = @LOL_DEPS@ | |||||
| 16_movie_SOURCES = 16_movie.cpp | 16_movie_SOURCES = 16_movie.cpp | ||||
| 16_movie_CPPFLAGS = $(AM_CPPFLAGS) | 16_movie_CPPFLAGS = $(AM_CPPFLAGS) | ||||
| @@ -44,7 +44,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03_noise", "doc\tutorial\03 | |||||
| EndProject | EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04_texture", "doc\tutorial\04_texture.vcxproj", "{834852DB-EDB6-4FD0-BCF9-45CD01126962}" | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04_texture", "doc\tutorial\04_texture.vcxproj", "{834852DB-EDB6-4FD0-BCF9-45CD01126962}" | ||||
| EndProject | EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12_Voronoi", "doc\tutorial\12_Voronoi.vcxproj", "{6BF81B39-EDC2-4227-9982-C2D8ABEA95AF}" | |||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12_voronoi", "doc\tutorial\12_voronoi.vcxproj", "{6BF81B39-EDC2-4227-9982-C2D8ABEA95AF}" | |||||
| EndProject | EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07_input", "doc\tutorial\07_input.vcxproj", "{572E5B9C-7E19-489C-BD8A-E8401CFBBC47}" | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07_input", "doc\tutorial\07_input.vcxproj", "{572E5B9C-7E19-489C-BD8A-E8401CFBBC47}" | ||||
| EndProject | EndProject | ||||
| @@ -56,9 +56,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13_shader_builder", "doc\tu | |||||
| EndProject | EndProject | ||||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{B6297FF2-63D0-41EE-BE13-EFF720C9B0FA}" | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{B6297FF2-63D0-41EE-BE13-EFF720C9B0FA}" | ||||
| EndProject | EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15_lolimgui", "doc\tutorial\15_lolimgui.vcxproj", "{81C83B42-D00A-4FA3-9A3D-80F9D46524BF}" | |||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15_gui", "doc\tutorial\15_gui.vcxproj", "{81C83B42-D00A-4FA3-9A3D-80F9D46524BF}" | |||||
| EndProject | EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14_lol_lua", "doc\tutorial\14_lol_lua.vcxproj", "{31B96262-1C41-43B9-BA38-27AA385B05DB}" | |||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14_lua", "doc\tutorial\14_lua.vcxproj", "{31B96262-1C41-43B9-BA38-27AA385B05DB}" | |||||
| EndProject | EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16_movie", "doc\tutorial\16_movie.vcxproj", "{5F5714D0-1C3D-4522-A409-214C5A2951AA}" | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16_movie", "doc\tutorial\16_movie.vcxproj", "{5F5714D0-1C3D-4522-A409-214C5A2951AA}" | ||||
| EndProject | EndProject | ||||
| @@ -282,7 +282,7 @@ bool Controller::IsLayerActive() | |||||
| //GetKeys/Axis stuff ---------------------------------------------------------- | //GetKeys/Axis stuff ---------------------------------------------------------- | ||||
| KeyBinding& Controller::GetKey(int index) | KeyBinding& Controller::GetKey(int index) | ||||
| { | { | ||||
| return m_keys[index]; | |||||
| return m_key_bindings[index]; | |||||
| } | } | ||||
| AxisBinding& Controller::GetAxis(int index) | AxisBinding& Controller::GetAxis(int index) | ||||
| @@ -293,26 +293,26 @@ AxisBinding& Controller::GetAxis(int index) | |||||
| // Key methods: should not go directly to binding | // Key methods: should not go directly to binding | ||||
| bool Controller::IsKeyPressed(int index) const | bool Controller::IsKeyPressed(int index) const | ||||
| { | { | ||||
| auto key = m_keys.find(index); | |||||
| return key != m_keys.end() && key->second.IsPressed(); | |||||
| auto key = m_key_bindings.find(index); | |||||
| return key != m_key_bindings.end() && key->second.IsPressed(); | |||||
| } | } | ||||
| bool Controller::IsKeyReleased(int index) const | bool Controller::IsKeyReleased(int index) const | ||||
| { | { | ||||
| auto key = m_keys.find(index); | |||||
| return key != m_keys.end() && key->second.IsReleased(); | |||||
| auto key = m_key_bindings.find(index); | |||||
| return key != m_key_bindings.end() && key->second.IsReleased(); | |||||
| } | } | ||||
| bool Controller::WasKeyPressedThisFrame(int index) const | bool Controller::WasKeyPressedThisFrame(int index) const | ||||
| { | { | ||||
| auto key = m_keys.find(index); | |||||
| return key != m_keys.end() && key->second.WasPressedThisFrame(); | |||||
| auto key = m_key_bindings.find(index); | |||||
| return key != m_key_bindings.end() && key->second.WasPressedThisFrame(); | |||||
| } | } | ||||
| bool Controller::WasKeyReleasedThisFrame(int index) const | bool Controller::WasKeyReleasedThisFrame(int index) const | ||||
| { | { | ||||
| auto key = m_keys.find(index); | |||||
| return key != m_keys.end() && key->second.WasReleasedThisFrame(); | |||||
| auto key = m_key_bindings.find(index); | |||||
| return key != m_key_bindings.end() && key->second.WasReleasedThisFrame(); | |||||
| } | } | ||||
| //Axis methods: should not go directly to binding ----------------------------- | //Axis methods: should not go directly to binding ----------------------------- | ||||
| @@ -436,7 +436,7 @@ void Controller::tick_game(float seconds) | |||||
| if (m_active) | if (m_active) | ||||
| { | { | ||||
| for (auto &kv : m_keys) | |||||
| for (auto &kv : m_key_bindings) | |||||
| kv.second.Update(); | kv.second.Update(); | ||||
| for (auto &kv : m_axis) | for (auto &kv : m_axis) | ||||
| @@ -359,7 +359,7 @@ protected: | |||||
| private: | private: | ||||
| uint32_t m_layer_mask = 1; // plugged on the first by default | uint32_t m_layer_mask = 1; // plugged on the first by default | ||||
| std::map<int, KeyBinding> m_keys; | |||||
| std::map<int, KeyBinding> m_key_bindings; | |||||
| std::map<int, AxisBinding> m_axis; | std::map<int, AxisBinding> m_axis; | ||||
| static uint32_t m_active_layer; // All active by default | static uint32_t m_active_layer; // All active by default | ||||