1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00

Implementa README

This commit is contained in:
Danilo 2024-05-10 11:58:57 -03:00
parent afb5a70822
commit ca83f9d8d7
5 changed files with 45 additions and 43 deletions

View File

@ -9,9 +9,11 @@ if (POLICY CMP0141)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>: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")

View File

@ -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"
}
},
{

35
README.md Normal file
View File

@ -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.

View File

@ -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)

View File

@ -26,9 +26,7 @@ namespace xna {
}
void LoadContent() override {
spriteBatch = New<SpriteBatch>(*graphicsDevice);
texture = Content()->Load<PTexture2D>("idle");
spriteBatch = New<SpriteBatch>(*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<GraphicsDeviceManager> graphics = nullptr;
sptr<SpriteBatch> spriteBatch = nullptr;
PTexture2D texture = nullptr;
};
}