diff --git a/.circleci/config.yml b/.circleci/config.yml index c53d775c..8f1f3b8c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ commands: - run: make --keep-going --jobs 16 CXXFLAGS_EXTRA="-Werror" - run: make --keep-going --jobs 16 CXXFLAGS_EXTRA="-Werror" test - run: make --keep-going --jobs 16 CXXFLAGS_EXTRA="-Werror" check - - run: make --keep-going --jobs 16 CXXFLAGS_EXTRA="-Werror" test-graphics + - run: make --keep-going --jobs 16 CXXFLAGS_EXTRA="-Werror" demoGraphics - run: make package - store_artifacts: path: .build/package/ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7242d224..a0762aba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,5 +125,5 @@ jobs: - run: make --keep-going --jobs 16 CXXFLAGS_EXTRA="-Werror" - run: make --keep-going --jobs 16 CXXFLAGS_EXTRA="-Werror" test - run: make --keep-going --jobs 16 CXXFLAGS_EXTRA="-Werror" check - - run: make --keep-going --jobs 16 CXXFLAGS_EXTRA="-Werror" test-graphics + - run: make --keep-going --jobs 16 CXXFLAGS_EXTRA="-Werror" demoGraphics - run: make package diff --git a/NAS2D.sln b/NAS2D.sln index 1117d26f..44485f22 100644 --- a/NAS2D.sln +++ b/NAS2D.sln @@ -7,7 +7,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NAS2D", "NAS2D\NAS2D.vcxpro EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcxproj", "{78F02848-BACB-4AD3-985E-0EB0D5B3DD53}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-graphics", "test-graphics\test-graphics.vcxproj", "{BC10CE9A-9BDA-4922-8C1F-F91C1E389483}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demoGraphics", "demoGraphics\demoGraphics.vcxproj", "{BC10CE9A-9BDA-4922-8C1F-F91C1E389483}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/test-graphics/TestGraphics.cpp b/demoGraphics/DemoGraphics.cpp similarity index 82% rename from test-graphics/TestGraphics.cpp rename to demoGraphics/DemoGraphics.cpp index 94cb35ff..5f8791a2 100644 --- a/test-graphics/TestGraphics.cpp +++ b/demoGraphics/DemoGraphics.cpp @@ -1,4 +1,4 @@ -#include "TestGraphics.h" +#include "DemoGraphics.h" #include #include @@ -8,7 +8,6 @@ #include #include "NAS2D/Math/Angle.h" -#include #include @@ -42,28 +41,28 @@ namespace } -TestGraphics::TestGraphics() : +DemoGraphics::DemoGraphics() : mTimer{}, mGear{"Gear.png"}, mDxImage{"Test_DirectX.png"}, mOglImage{"Test_OpenGL.png"} {} -TestGraphics::~TestGraphics() +DemoGraphics::~DemoGraphics() { auto& eventHandler = NAS2D::Utility::get(); - eventHandler.mouseMotion().disconnect({this, &TestGraphics::onMouseMove}); - eventHandler.mouseButtonDown().disconnect({this, &TestGraphics::onMouseDown}); - eventHandler.keyDown().disconnect({this, &TestGraphics::onKeyDown}); + eventHandler.mouseMotion().disconnect({this, &DemoGraphics::onMouseMove}); + eventHandler.mouseButtonDown().disconnect({this, &DemoGraphics::onMouseDown}); + eventHandler.keyDown().disconnect({this, &DemoGraphics::onKeyDown}); } -void TestGraphics::initialize() +void DemoGraphics::initialize() { auto& eventHandler = NAS2D::Utility::get(); - eventHandler.mouseMotion().connect({this, &TestGraphics::onMouseMove}); - eventHandler.mouseButtonDown().connect({this, &TestGraphics::onMouseDown}); - eventHandler.keyDown().connect({this, &TestGraphics::onKeyDown}); + eventHandler.mouseMotion().connect({this, &DemoGraphics::onMouseMove}); + eventHandler.mouseButtonDown().connect({this, &DemoGraphics::onMouseDown}); + eventHandler.keyDown().connect({this, &DemoGraphics::onKeyDown}); auto& renderer = NAS2D::Utility::get(); renderer.showSystemPointer(true); @@ -72,7 +71,7 @@ void TestGraphics::initialize() renderer.size(minSize); } -NAS2D::State* TestGraphics::update() +NAS2D::State* DemoGraphics::update() { NAS2D::Renderer& r = NAS2D::Utility::get(); @@ -126,7 +125,7 @@ NAS2D::State* TestGraphics::update() return this; } -void TestGraphics::onKeyDown(NAS2D::KeyCode key, NAS2D::KeyModifier /*mod*/, bool /*repeat*/) +void DemoGraphics::onKeyDown(NAS2D::KeyCode key, NAS2D::KeyModifier /*mod*/, bool /*repeat*/) { switch (key) { @@ -150,11 +149,11 @@ void TestGraphics::onKeyDown(NAS2D::KeyCode key, NAS2D::KeyModifier /*mod*/, boo } } -void TestGraphics::onMouseMove(NAS2D::Point /*position*/, NAS2D::Vector /*change*/) +void DemoGraphics::onMouseMove(NAS2D::Point /*position*/, NAS2D::Vector /*change*/) {} -void TestGraphics::onMouseDown(NAS2D::MouseButton /*button*/, NAS2D::Point /*position*/) +void DemoGraphics::onMouseDown(NAS2D::MouseButton /*button*/, NAS2D::Point /*position*/) {} -void TestGraphics::onWindowResized(int /*w*/, int /*h*/) +void DemoGraphics::onWindowResized(int /*w*/, int /*h*/) {} diff --git a/test-graphics/TestGraphics.h b/demoGraphics/DemoGraphics.h similarity index 87% rename from test-graphics/TestGraphics.h rename to demoGraphics/DemoGraphics.h index aba8d7d7..25983d50 100644 --- a/test-graphics/TestGraphics.h +++ b/demoGraphics/DemoGraphics.h @@ -6,11 +6,11 @@ #include "NAS2D/Resource/Image.h" -class TestGraphics : public NAS2D::State +class DemoGraphics : public NAS2D::State { public: - TestGraphics(); - ~TestGraphics() override; + DemoGraphics(); + ~DemoGraphics() override; protected: void initialize() override; diff --git a/test-graphics/SdlVersionInfo.cpp b/demoGraphics/SdlVersionInfo.cpp similarity index 100% rename from test-graphics/SdlVersionInfo.cpp rename to demoGraphics/SdlVersionInfo.cpp diff --git a/test-graphics/SdlVersionInfo.h b/demoGraphics/SdlVersionInfo.h similarity index 100% rename from test-graphics/SdlVersionInfo.h rename to demoGraphics/SdlVersionInfo.h diff --git a/test-graphics/data/Gear.png b/demoGraphics/data/Gear.png similarity index 100% rename from test-graphics/data/Gear.png rename to demoGraphics/data/Gear.png diff --git a/test-graphics/data/Test_DirectX.png b/demoGraphics/data/Test_DirectX.png similarity index 100% rename from test-graphics/data/Test_DirectX.png rename to demoGraphics/data/Test_DirectX.png diff --git a/test-graphics/data/Test_OpenGL.png b/demoGraphics/data/Test_OpenGL.png similarity index 100% rename from test-graphics/data/Test_OpenGL.png rename to demoGraphics/data/Test_OpenGL.png diff --git a/test-graphics/test-graphics.vcxproj b/demoGraphics/demoGraphics.vcxproj similarity index 96% rename from test-graphics/test-graphics.vcxproj rename to demoGraphics/demoGraphics.vcxproj index ad479c26..e6be917a 100644 --- a/test-graphics/test-graphics.vcxproj +++ b/demoGraphics/demoGraphics.vcxproj @@ -21,7 +21,7 @@ 16.0 {BC10CE9A-9BDA-4922-8C1F-F91C1E389483} - testgraphics + demographics 10.0 @@ -172,11 +172,11 @@ - + - + diff --git a/test-graphics/test-graphics.vcxproj.filters b/demoGraphics/demoGraphics.vcxproj.filters similarity index 78% rename from test-graphics/test-graphics.vcxproj.filters rename to demoGraphics/demoGraphics.vcxproj.filters index 0797c7a2..3970cb97 100644 --- a/test-graphics/test-graphics.vcxproj.filters +++ b/demoGraphics/demoGraphics.vcxproj.filters @@ -3,10 +3,10 @@ - + - + \ No newline at end of file diff --git a/test-graphics/main.cpp b/demoGraphics/main.cpp similarity index 95% rename from test-graphics/main.cpp rename to demoGraphics/main.cpp index 224a7a73..c8834101 100644 --- a/test-graphics/main.cpp +++ b/demoGraphics/main.cpp @@ -9,7 +9,7 @@ // ================================================================================== #include "SdlVersionInfo.h" -#include "TestGraphics.h" +#include "DemoGraphics.h" #include #include @@ -27,7 +27,7 @@ int main() try { NAS2D::Game game("NAS2D Graphics Test", "NAS2D_GraphicsTest", "LairWorks"); - game.go(new TestGraphics()); + game.go(new DemoGraphics()); } catch(std::exception& e) { diff --git a/makefile b/makefile index 114d61db..40cd377a 100644 --- a/makefile +++ b/makefile @@ -33,7 +33,7 @@ BUILDDIRPREFIX := $(ROOTBUILDDIR)/$(CONFIG)_Linux_ .DEFAULT_GOAL := nas2d .PHONY: all -all: nas2d test test-graphics +all: nas2d test demoGraphics ## NAS2D project ## @@ -101,32 +101,32 @@ check: | test cd test && $(RunPrefix) ../$(TESTOUTPUT) $(GTEST_OPTIONS) -## Graphics test project ## +## Graphics demo project ## -TESTGRAPHICSDIR := test-graphics -TESTGRAPHICSINTDIR := $(BUILDDIRPREFIX)testGraphics/intermediate -TESTGRAPHICSOUTPUT := $(BUILDDIRPREFIX)testGraphics/testGraphics$(ExeSuffix) -TESTGRAPHICSSRCS := $(shell find $(TESTGRAPHICSDIR) -name '*.cpp') -TESTGRAPHICSOBJS := $(patsubst $(TESTGRAPHICSDIR)/%.cpp,$(TESTGRAPHICSINTDIR)/%.o,$(TESTGRAPHICSSRCS)) +DEMOGRAPHICSDIR := demoGraphics +DEMOGRAPHICSINTDIR := $(BUILDDIRPREFIX)demoGraphics/intermediate +DEMOGRAPHICSOUTPUT := $(BUILDDIRPREFIX)demoGraphics/demoGraphics$(ExeSuffix) +DEMOGRAPHICSSRCS := $(shell find $(DEMOGRAPHICSDIR) -name '*.cpp') +DEMOGRAPHICSOBJS := $(patsubst $(DEMOGRAPHICSDIR)/%.cpp,$(DEMOGRAPHICSINTDIR)/%.o,$(DEMOGRAPHICSSRCS)) -TESTGRAPHICSPROJECT_FLAGS = $(TESTCPPFLAGS) $(CXXFLAGS) -TESTGRAPHICSPROJECT_LINKFLAGS = $(TESTLDFLAGS) $(LDLIBS) +DEMOGRAPHICSPROJECT_FLAGS = $(TESTCPPFLAGS) $(CXXFLAGS) +DEMOGRAPHICSPROJECT_LINKFLAGS = $(TESTLDFLAGS) $(LDLIBS) -.PHONY: test-graphics -test-graphics: $(TESTGRAPHICSOUTPUT) +.PHONY: demoGraphics +demoGraphics: $(DEMOGRAPHICSOUTPUT) -$(TESTGRAPHICSOUTPUT): PROJECT_LINKFLAGS = $(TESTGRAPHICSPROJECT_LINKFLAGS) -$(TESTGRAPHICSOUTPUT): $(TESTGRAPHICSOBJS) $(OUTPUT) +$(DEMOGRAPHICSOUTPUT): PROJECT_LINKFLAGS = $(DEMOGRAPHICSPROJECT_LINKFLAGS) +$(DEMOGRAPHICSOUTPUT): $(DEMOGRAPHICSOBJS) $(OUTPUT) -$(TESTGRAPHICSOBJS): PROJECT_FLAGS = $(TESTGRAPHICSPROJECT_FLAGS) -$(TESTGRAPHICSOBJS): $(TESTGRAPHICSINTDIR)/%.o : $(TESTGRAPHICSDIR)/%.cpp $(TESTGRAPHICSINTDIR)/%.dep +$(DEMOGRAPHICSOBJS): PROJECT_FLAGS = $(DEMOGRAPHICSPROJECT_FLAGS) +$(DEMOGRAPHICSOBJS): $(DEMOGRAPHICSINTDIR)/%.o : $(DEMOGRAPHICSDIR)/%.cpp $(DEMOGRAPHICSINTDIR)/%.dep --include $(patsubst %.o,%.dep,$(TESTGRAPHICSOBJS)) +-include $(patsubst %.o,%.dep,$(DEMOGRAPHICSOBJS)) -.PHONY: run-test-graphics -run-test-graphics: | test-graphics - cd test-graphics/ && $(RunPrefix) ../$(TESTGRAPHICSOUTPUT) ; cd .. +.PHONY: run-demoGraphics +run-demoGraphics: | demoGraphics + cd demoGraphics/ && $(RunPrefix) ../$(DEMOGRAPHICSOUTPUT) ; cd .. ## Compile rules ##