File tree Expand file tree Collapse file tree 8 files changed +27
-10
lines changed Expand file tree Collapse file tree 8 files changed +27
-10
lines changed Original file line number Diff line number Diff line change @@ -386,7 +386,7 @@ list(APPEND GAME_SOURCE
386386 Source /Box2DTest/Box2dTest.cpp
387387)
388388
389- if ((WINDOWS OR MACOSX OR LINUX OR WASM) AND (NOT WINRT))
389+ if ((WINDOWS OR MACOSX OR LINUX OR WASM) AND (NOT WINRT) AND AX_ENABLE_EXT_IMGUI )
390390 list (APPEND GAME_HEADER
391391 Source /Box2DTestBed/tests/test .h
392392 Source /Box2DTestBed/tests/settings.h
Original file line number Diff line number Diff line change 2828#include " testResource.h"
2929#include " controller.h"
3030
31- #if defined(AX_PLATFORM_PC) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || defined(__EMSCRIPTEN__)
31+ #if AX_ENABLE_EXT_IMGUI
3232#include " Inspector/Inspector.h"
3333#endif
3434
@@ -488,14 +488,14 @@ void TestCase::onEnter()
488488 _restartTestItem->setVisible (false );
489489 }
490490
491- #if defined(AX_PLATFORM_PC) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || defined(__EMSCRIPTEN__)
491+ #if AX_ENABLE_EXT_IMGUI
492492 extension::Inspector::getInstance ()->openForScene (this );
493493#endif
494494}
495495
496496void TestCase::onExit ()
497497{
498- #if defined(AX_PLATFORM_PC) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || defined(__EMSCRIPTEN__)
498+ #if AX_ENABLE_EXT_IMGUI
499499 extension::Inspector::getInstance ()->close ();
500500#endif
501501 Scene::onExit ();
Original file line number Diff line number Diff line change 3232#include " GUI/ScrollView/ScrollView.h"
3333#include " GUI/ScrollView/TableView.h"
3434#include " VisibleRect.h"
35+ #include " feature-detect.h"
3536
3637class TestSuite ;
3738
Original file line number Diff line number Diff line change 11#include " platform/PlatformConfig.h"
22#include " ImGuiTest.h"
33
4- #if defined(AX_PLATFORM_PC) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || defined(__EMSCRIPTEN__)
4+ #if AX_ENABLE_EXT_IMGUI
55
66#include " ImGui/ImGuiPresenter.h"
77#if !defined(__ANDROID__)
Original file line number Diff line number Diff line change 2929#include " axmol.h"
3030#include " ../BaseTest.h"
3131
32- #if defined(AX_PLATFORM_PC) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || defined(__EMSCRIPTEN__)
32+ #if AX_ENABLE_EXT_IMGUI
3333
3434DEFINE_TEST_SUITE (ImGuiTests);
3535
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class RootTests : public TestList
4747 addTest (" Effekseer" , []() { return new EffekseerTests (); });
4848#endif
4949 addTest (" Scene3D" , [](){return new Scene3DTests (); });
50- #if defined(AX_PLATFORM_PC) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || defined(__EMSCRIPTEN__)
50+ #if AX_ENABLE_EXT_IMGUI
5151 addTest (" ImGui" , []() { return new ImGuiTests (); });
5252#endif
5353 addTest (" Texture2D" , []() { return new Texture2DTests (); });
@@ -58,11 +58,11 @@ class RootTests : public TestList
5858 addTest (" AudioEngine" , []() { return new AudioEngineTests (); });
5959
6060 addTest (" Box2D - Basic" , []() { return new Box2DTests (); });
61- #if defined(AX_PLATFORM_PC) || defined(__EMSCRIPTEN__)
61+ #if AX_ENABLE_EXT_IMGUI
6262 addTest (" Box2D - TestBed" , []() { return new Box2DTestBedTests (); });
6363#endif
6464 addTest (" Chipmunk2D - Basic" , []() { return new ChipmunkTests (); });
65- #if defined(AX_PLATFORM_PC) || defined(__EMSCRIPTEN__)
65+ #if AX_ENABLE_EXT_IMGUI
6666 addTest (" Chipmunk2D - TestBed" , []() { return new ChipmunkTestBedTests (); });
6767#endif
6868 addTest (" Bugs" , []() { return new BugsTests (); });
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #if defined(AX_PLATFORM_PC ) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID ) || defined(__EMSCRIPTEN__ )
4+ # if __has_include ("ImGui/ImGuiPresenter.h" )
5+ # define AX_ENABLE_EXT_IMGUI 1
6+ # endif
7+ #endif
8+
9+ #ifndef AX_ENABLE_EXT_IMGUI
10+ # define AX_ENABLE_EXT_IMGUI 0
11+ #endif
Original file line number Diff line number Diff line change 2626#ifndef _TESTS_H_
2727#define _TESTS_H_
2828
29+ #include "feature-detect.h"
30+
2931#include "Box2DTest/Box2dTest.h"
32+
33+ # if AX_ENABLE_EXT_IMGUI
3034#include "Box2DTestBed/Box2DTestBed.h"
35+ # endif
3136
3237#include "ChipmunkTest/ChipmunkTest.h"
3338#if defined(AX_PLATFORM_PC ) || defined(__EMSCRIPTEN__ )
121126#include "VibrateTest/VibrateTest.h"
122127#include "SpriteFrameCacheTest/SpriteFrameCacheTest.h"
123128#include "ZipTest/ZipTests.h"
124- #if defined( AX_PLATFORM_PC ) || ( AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID ) || defined( __EMSCRIPTEN__ )
129+ #if AX_ENABLE_EXT_IMGUI
125130# include "ImGuiTest/ImGuiTest.h"
126131#endif
127132#endif
You can’t perform that action at this time.
0 commit comments