diff --git a/CMakeLists.txt b/CMakeLists.txt index b0bc70f..18d3b69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,11 @@ if (POLICY CMP0141) set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") endif() -set(ENV{VCPKG_ROOT} C:\\vcpkg) +# Includes include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc) -MESSAGE(${CMAKE_CURRENT_SOURCE_DIR}/inc) + +# CMAKE_TOOLCHAIN_FILE +include("C:/vcpkg/scripts/buildsystems/vcpkg.cmake") project ("xna") diff --git a/CMakePresets.json b/CMakePresets.json index 5d2f8c4..fedefe5 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -26,8 +26,7 @@ "strategy": "external" }, "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_TOOLCHAIN_FILE": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" + "CMAKE_BUILD_TYPE": "Debug" } }, { @@ -35,8 +34,7 @@ "displayName": "x64 Release", "inherits": "x64-debug", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release", - "CMAKE_TOOLCHAIN_FILE": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" + "CMAKE_BUILD_TYPE": "Release" } }, { @@ -48,8 +46,7 @@ "strategy": "external" }, "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_TOOLCHAIN_FILE": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" + "CMAKE_BUILD_TYPE": "Debug" } }, { @@ -57,8 +54,7 @@ "displayName": "x86 Release", "inherits": "x86-debug", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release", - "CMAKE_TOOLCHAIN_FILE": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" + "CMAKE_BUILD_TYPE": "Release" } }, { diff --git a/README.md b/README.md new file mode 100644 index 0000000..e513146 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# XN65 + +> XN65 is an implementation of Microsoft XNA 4.0 in C++ with DirectX 11 and the DirectXTK library. + +### Adjustments and improvements + +The project is still under development and the next updates will focus on the following tasks: +- [ ] Finish basic classes +- [ ] Code refactoring and cleaning +- [ ] 3D support +- [ ] Content Pipeline +- [ ] Multiplatform support + +## 💻 Requirements +- `DirectX 11`: Currently X65 only supports DirectX 11 +- `vcpkg`: C/C++ dependency manager from Microsoft +- `DirectXTK`: The DirectX Tool Kit + +## 🚀 DirectXTK and VCPKG + +Use the following command in vcpkg to install DirectXTK: + +``` +.\vcpkg install directxtk[tools,spectre,xaudio2-9] +``` + +In the root CMakeLists.txt set the vcpkg CMAKE_TOOLCHAIN_FILE path + +``` +include("C:/vcpkg/scripts/buildsystems/vcpkg.cmake") +``` + +## 📝 Licença + +Esse projeto está sob licença. Veja o arquivo [LICENÇA](LICENSE.md) para mais detalhes. diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index 86bba27..d00f06f 100644 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt @@ -54,30 +54,6 @@ endif() # TODO: Add tests and install targets if needed. - -# -- Biblioteca DirectxTK -- -# Url: https://github.com/microsoft/DirectXTK/wiki/DirectXTK -# -# -- Instalação via vcpkg -- -# Para efetuar o download do vcpkg verifique o caminho abaixo -# Url: https://learn.microsoft.com/pt-br/vcpkg/get_started/get-started?pivots=shell-cmd -# -# Siga os procedimentos da página oficial do DirectxTK para instalação via vcpkg -# $- vcpkg install directxtk[tools,spectre,xaudio2-9] -# -# [!] Atualize o arquivo CMakePresets.json, nos 'presets' necessários, -# para que find_package execute corretamente -# -# "cacheVariables": { -# "CMAKE_TOOLCHAIN_FILE": "{VCPKG_DIR}\\scripts\\buildsystems\\vcpkg.cmake" -# } -# -# Instalaçao do libmspack -# $- vcpkg install libmspack -# find_package(directxtk CONFIG REQUIRED) - -target_link_libraries(${PROJECT_NAME} - D3d11.lib dxgi.lib dxguid.lib d3dcompiler.lib Microsoft::DirectXTK -) +target_link_libraries(${PROJECT_NAME} D3d11.lib dxgi.lib dxguid.lib d3dcompiler.lib Microsoft::DirectXTK) diff --git a/framework/xna.cpp b/framework/xna.cpp index c879256..ccb7ae9 100644 --- a/framework/xna.cpp +++ b/framework/xna.cpp @@ -26,9 +26,7 @@ namespace xna { } void LoadContent() override { - spriteBatch = New(*graphicsDevice); - - texture = Content()->Load("idle"); + spriteBatch = New(*graphicsDevice); Game::LoadContent(); } @@ -43,17 +41,12 @@ namespace xna { void Draw(GameTime const& gameTime) override { graphicsDevice->Clear(Colors::CornflowerBlue); - spriteBatch->Begin(); - spriteBatch->Draw(*texture, Vector2(10, 10), Colors::White); - spriteBatch->End(); - Game::Draw(gameTime); } private: sptr graphics = nullptr; sptr spriteBatch = nullptr; - PTexture2D texture = nullptr; }; }