diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index af67c30..9cb2477 100644 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt @@ -4,7 +4,7 @@ # Add source to this project's executable. add_library (Xn65 STATIC -"../samples/xna.cpp" +"../samples/01_blank/xna.cpp" "csharp/stream.cpp" "game/component.cpp" "content/manager.cpp" diff --git a/samples/01_blank/CMakeLists.txt b/samples/01_blank/CMakeLists.txt new file mode 100644 index 0000000..bba069c --- /dev/null +++ b/samples/01_blank/CMakeLists.txt @@ -0,0 +1,13 @@ +# CMakeList.txt : CMake project for CmakeSharedExeTest, include source and define +# project specific logic here. +# + +# Add source to this project's executable. +add_executable (BlankApp WIN32 "xna.cpp") + +if (CMAKE_VERSION VERSION_GREATER 3.12) + set_property(TARGET BlankApp PROPERTY CXX_STANDARD 20) +endif() + +# TODO: Add tests and install targets if needed. +target_link_libraries(BlankApp Xn65) diff --git a/samples/xna.cpp b/samples/01_blank/xna.cpp similarity index 81% rename from samples/xna.cpp rename to samples/01_blank/xna.cpp index 6b03c09..d810dcf 100644 --- a/samples/xna.cpp +++ b/samples/01_blank/xna.cpp @@ -25,9 +25,7 @@ namespace xna { } void LoadContent() override { - spriteBatch = New(*graphicsDevice); - - texture = Content()->Load("sampleTexture"); + spriteBatch = New(*graphicsDevice); Game::LoadContent(); } @@ -40,15 +38,7 @@ namespace xna { } void Draw(GameTime const& gameTime) override { - graphicsDevice->Clear(Colors::CornflowerBlue); - - spriteBatch->Begin(); - - if(texture) - spriteBatch->Draw(*texture, Vector2(), Colors::White); - - spriteBatch->End(); - + graphicsDevice->Clear(Colors::CornflowerBlue); Game::Draw(gameTime); } diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 18aea9f..90f3ffd 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -3,11 +3,4 @@ # # Add source to this project's executable. -add_executable (SampleApp WIN32 "xna.cpp") - -if (CMAKE_VERSION VERSION_GREATER 3.12) - set_property(TARGET SampleApp PROPERTY CXX_STANDARD 20) -endif() - -# TODO: Add tests and install targets if needed. -target_link_libraries(SampleApp Xn65) +add_subdirectory ("01_blank")