flatten 20260225
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.DS_Store
|
||||||
|
*.pyc
|
||||||
|
xcuserdata
|
||||||
|
.bin
|
||||||
624
Core_Graphics.xcodeproj/project.pbxproj
Normal file
624
Core_Graphics.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,624 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 55;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
F673E3CE2ADD68AA000281FF /* Screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F673E3CC2ADD68A6000281FF /* Screen.cpp */; };
|
||||||
|
F6C1BAA62CDD4CB9007439C1 /* STB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6C1BAA52CDD4C8B007439C1 /* STB.cpp */; };
|
||||||
|
F6C1BAA72CDD4CB9007439C1 /* STB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6C1BAA52CDD4C8B007439C1 /* STB.cpp */; };
|
||||||
|
F6C76CC52CDD65E400EC8827 /* Colors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6C76CBF2CDD65E000EC8827 /* Colors.cpp */; };
|
||||||
|
F6C76CC62CDD65E500EC8827 /* Colors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6C76CBF2CDD65E000EC8827 /* Colors.cpp */; };
|
||||||
|
F6C76CCA2CDD661A00EC8827 /* SDF_deadreckoning.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6C76CC72CDD661700EC8827 /* SDF_deadreckoning.cpp */; };
|
||||||
|
F6C76CCB2CDD661A00EC8827 /* SDF_deadreckoning.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6C76CC72CDD661700EC8827 /* SDF_deadreckoning.cpp */; };
|
||||||
|
F6C76CCD2CDD67A100EC8827 /* pathfinders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6C1BA9D2CDC1616007439C1 /* pathfinders.cpp */; };
|
||||||
|
F6C76CCE2CDD67A200EC8827 /* pathfinders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6C1BA9D2CDC1616007439C1 /* pathfinders.cpp */; };
|
||||||
|
F6CA38692933B0B100556E1C /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6CA38682933B09300556E1C /* main.cpp */; };
|
||||||
|
F6D165E52CD819EF00F3967F /* Screen+PNG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6D165E42CD819DA00F3967F /* Screen+PNG.cpp */; };
|
||||||
|
F6D165E62CD819EF00F3967F /* Screen+PNG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6D165E42CD819DA00F3967F /* Screen+PNG.cpp */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
F6CA385D2933AD8400556E1C /* CopyFiles */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = /usr/share/man/man1/;
|
||||||
|
dstSubfolderSpec = 0;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 1;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
F608ABB328287108005C276B /* libCore_Graphics.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCore_Graphics.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
F61F9BF02C6E4DD200F79137 /* Makefile.project */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.project; sourceTree = "<group>"; };
|
||||||
|
F673E3CB2ADD68A5000281FF /* Screen+IO.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Screen+IO.h"; sourceTree = "<group>"; };
|
||||||
|
F673E3CC2ADD68A6000281FF /* Screen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Screen.cpp; sourceTree = "<group>"; };
|
||||||
|
F673E3CD2ADD68A6000281FF /* Screen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Screen.h; sourceTree = "<group>"; };
|
||||||
|
F673E3CF2ADD6928000281FF /* Screen.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Screen.hpp; sourceTree = "<group>"; };
|
||||||
|
F6971F33282B1184008FBD17 /* libCore_Graphics_iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCore_Graphics_iOS.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
F6BF9BE42E390208002E6AF0 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
|
||||||
|
F6C1BA992CDC0556007439C1 /* Screen+erode.inl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Screen+erode.inl"; sourceTree = "<group>"; };
|
||||||
|
F6C1BA9A2CDC0647007439C1 /* Screen+dilate.inl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Screen+dilate.inl"; sourceTree = "<group>"; };
|
||||||
|
F6C1BA9B2CDC15E0007439C1 /* Screen+find_path.inl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Screen+find_path.inl"; sourceTree = "<group>"; };
|
||||||
|
F6C1BA9C2CDC1616007439C1 /* pathfinders.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pathfinders.h; sourceTree = "<group>"; };
|
||||||
|
F6C1BA9D2CDC1616007439C1 /* pathfinders.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = pathfinders.cpp; sourceTree = "<group>"; };
|
||||||
|
F6C1BAA12CDD4C83007439C1 /* STB+TrueType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "STB+TrueType.h"; sourceTree = "<group>"; };
|
||||||
|
F6C1BAA22CDD4C83007439C1 /* STB+Image.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "STB+Image.h"; sourceTree = "<group>"; };
|
||||||
|
F6C1BAA32CDD4C83007439C1 /* STB+TrueType.inl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "STB+TrueType.inl"; sourceTree = "<group>"; };
|
||||||
|
F6C1BAA42CDD4C83007439C1 /* STB+Image.inl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "STB+Image.inl"; sourceTree = "<group>"; };
|
||||||
|
F6C1BAA52CDD4C8B007439C1 /* STB.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = STB.cpp; sourceTree = "<group>"; };
|
||||||
|
F6C76CBF2CDD65E000EC8827 /* Colors.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Colors.cpp; sourceTree = "<group>"; };
|
||||||
|
F6C76CC02CDD65E000EC8827 /* Geometry.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Geometry.hpp; sourceTree = "<group>"; };
|
||||||
|
F6C76CC12CDD65E000EC8827 /* Colors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Colors.h; sourceTree = "<group>"; };
|
||||||
|
F6C76CC22CDD65E000EC8827 /* Geometry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Geometry.h; sourceTree = "<group>"; };
|
||||||
|
F6C76CC32CDD65E000EC8827 /* Color.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Color.hpp; sourceTree = "<group>"; };
|
||||||
|
F6C76CC42CDD65E000EC8827 /* Colors.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Colors.hpp; sourceTree = "<group>"; };
|
||||||
|
F6C76CC72CDD661700EC8827 /* SDF_deadreckoning.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SDF_deadreckoning.cpp; sourceTree = "<group>"; };
|
||||||
|
F6C76CC82CDD661700EC8827 /* SDF.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDF.h; sourceTree = "<group>"; };
|
||||||
|
F6C76CC92CDD661700EC8827 /* SDF_deadreckoning.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDF_deadreckoning.h; sourceTree = "<group>"; };
|
||||||
|
F6C76CCC2CDD666B00EC8827 /* glm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = glm.h; sourceTree = "<group>"; };
|
||||||
|
F6CA385F2933AD8400556E1C /* Core_Graphics_Tester */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Core_Graphics_Tester; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
F6CA38682933B09300556E1C /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
|
||||||
|
F6D1148D2D3DB0E900BFA3B3 /* Screen+and.inl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Screen+and.inl"; sourceTree = "<group>"; };
|
||||||
|
F6D165E32CD8166C00F3967F /* Screen+PNG.inl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Screen+PNG.inl"; sourceTree = "<group>"; };
|
||||||
|
F6D165E42CD819DA00F3967F /* Screen+PNG.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "Screen+PNG.cpp"; sourceTree = "<group>"; };
|
||||||
|
F6DEACD72831C16C0001467D /* Makefile.def */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.def; sourceTree = "<group>"; };
|
||||||
|
F6DEACD82831C16C0001467D /* Makefile.project */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.project; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
F608ABB128287108005C276B /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
F6971F2F282B1184008FBD17 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
F6CA385C2933AD8400556E1C /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
F608ABAA28287108005C276B = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F6CA386A2933B0E600556E1C /* Frameworks */,
|
||||||
|
F6BF9BE42E390208002E6AF0 /* Makefile */,
|
||||||
|
F6DEACD72831C16C0001467D /* Makefile.def */,
|
||||||
|
F6DEACD82831C16C0001467D /* Makefile.project */,
|
||||||
|
F608ABB428287108005C276B /* Products */,
|
||||||
|
F6CA38672933B08A00556E1C /* tests */,
|
||||||
|
F61D7C412E381687002A1AED /* tjp */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F608ABB428287108005C276B /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F608ABB328287108005C276B /* libCore_Graphics.a */,
|
||||||
|
F6971F33282B1184008FBD17 /* libCore_Graphics_iOS.a */,
|
||||||
|
F6CA385F2933AD8400556E1C /* Core_Graphics_Tester */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F608ABBA2828711E005C276B /* core */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F608ABBB2828714B005C276B /* graphics */,
|
||||||
|
);
|
||||||
|
path = core;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F608ABBB2828714B005C276B /* graphics */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F6C76CCC2CDD666B00EC8827 /* glm.h */,
|
||||||
|
F6C76CC72CDD661700EC8827 /* SDF_deadreckoning.cpp */,
|
||||||
|
F6C76CC92CDD661700EC8827 /* SDF_deadreckoning.h */,
|
||||||
|
F6C76CC82CDD661700EC8827 /* SDF.h */,
|
||||||
|
F6C76CC32CDD65E000EC8827 /* Color.hpp */,
|
||||||
|
F6C76CBF2CDD65E000EC8827 /* Colors.cpp */,
|
||||||
|
F6C76CC12CDD65E000EC8827 /* Colors.h */,
|
||||||
|
F6C76CC42CDD65E000EC8827 /* Colors.hpp */,
|
||||||
|
F6C76CC22CDD65E000EC8827 /* Geometry.h */,
|
||||||
|
F6C76CC02CDD65E000EC8827 /* Geometry.hpp */,
|
||||||
|
F61F9BF72C6E516500F79137 /* _tests */,
|
||||||
|
F673E3D02ADD6954000281FF /* soft */,
|
||||||
|
F6C1BAA52CDD4C8B007439C1 /* STB.cpp */,
|
||||||
|
F6C1BAA22CDD4C83007439C1 /* STB+Image.h */,
|
||||||
|
F6C1BAA42CDD4C83007439C1 /* STB+Image.inl */,
|
||||||
|
F6C1BAA12CDD4C83007439C1 /* STB+TrueType.h */,
|
||||||
|
F6C1BAA32CDD4C83007439C1 /* STB+TrueType.inl */,
|
||||||
|
);
|
||||||
|
path = graphics;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F61D7C412E381687002A1AED /* tjp */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F608ABBA2828711E005C276B /* core */,
|
||||||
|
);
|
||||||
|
path = tjp;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F61F9BF72C6E516500F79137 /* _tests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
);
|
||||||
|
path = _tests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F61F9BF82C6E517700F79137 /* _tests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F673E3CC2ADD68A6000281FF /* Screen.cpp */,
|
||||||
|
);
|
||||||
|
path = _tests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F673E3D02ADD6954000281FF /* soft */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F6C1BA9D2CDC1616007439C1 /* pathfinders.cpp */,
|
||||||
|
F6C1BA9C2CDC1616007439C1 /* pathfinders.h */,
|
||||||
|
F61F9BF82C6E517700F79137 /* _tests */,
|
||||||
|
F673E3CD2ADD68A6000281FF /* Screen.h */,
|
||||||
|
F673E3CF2ADD6928000281FF /* Screen.hpp */,
|
||||||
|
F6C1BA992CDC0556007439C1 /* Screen+erode.inl */,
|
||||||
|
F6D1148D2D3DB0E900BFA3B3 /* Screen+and.inl */,
|
||||||
|
F6C1BA9A2CDC0647007439C1 /* Screen+dilate.inl */,
|
||||||
|
F6C1BA9B2CDC15E0007439C1 /* Screen+find_path.inl */,
|
||||||
|
F6D165E32CD8166C00F3967F /* Screen+PNG.inl */,
|
||||||
|
F6D165E42CD819DA00F3967F /* Screen+PNG.cpp */,
|
||||||
|
F673E3CB2ADD68A5000281FF /* Screen+IO.h */,
|
||||||
|
);
|
||||||
|
path = soft;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F6CA38672933B08A00556E1C /* tests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F61F9BF02C6E4DD200F79137 /* Makefile.project */,
|
||||||
|
F6CA38682933B09300556E1C /* main.cpp */,
|
||||||
|
);
|
||||||
|
path = tests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F6CA386A2933B0E600556E1C /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXHeadersBuildPhase section */
|
||||||
|
F608ABAF28287108005C276B /* Headers */ = {
|
||||||
|
isa = PBXHeadersBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
F6971F2C282B1184008FBD17 /* Headers */ = {
|
||||||
|
isa = PBXHeadersBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXHeadersBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
F608ABB228287108005C276B /* Core_Graphics */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = F608ABB728287108005C276B /* Build configuration list for PBXNativeTarget "Core_Graphics" */;
|
||||||
|
buildPhases = (
|
||||||
|
F608ABAF28287108005C276B /* Headers */,
|
||||||
|
F608ABB028287108005C276B /* Sources */,
|
||||||
|
F608ABB128287108005C276B /* Frameworks */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = Core_Graphics;
|
||||||
|
productName = Core_Graphics;
|
||||||
|
productReference = F608ABB328287108005C276B /* libCore_Graphics.a */;
|
||||||
|
productType = "com.apple.product-type.library.static";
|
||||||
|
};
|
||||||
|
F6971F2B282B1184008FBD17 /* Core_Graphics_iOS */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = F6971F30282B1184008FBD17 /* Build configuration list for PBXNativeTarget "Core_Graphics_iOS" */;
|
||||||
|
buildPhases = (
|
||||||
|
F6971F2C282B1184008FBD17 /* Headers */,
|
||||||
|
F6971F2D282B1184008FBD17 /* Sources */,
|
||||||
|
F6971F2F282B1184008FBD17 /* Frameworks */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = Core_Graphics_iOS;
|
||||||
|
productName = Core_Graphics;
|
||||||
|
productReference = F6971F33282B1184008FBD17 /* libCore_Graphics_iOS.a */;
|
||||||
|
productType = "com.apple.product-type.library.static";
|
||||||
|
};
|
||||||
|
F6CA385E2933AD8400556E1C /* Core_Graphics_Tester */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = F6CA38632933AD8400556E1C /* Build configuration list for PBXNativeTarget "Core_Graphics_Tester" */;
|
||||||
|
buildPhases = (
|
||||||
|
F6CA385B2933AD8400556E1C /* Sources */,
|
||||||
|
F6CA385C2933AD8400556E1C /* Frameworks */,
|
||||||
|
F6CA385D2933AD8400556E1C /* CopyFiles */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = Core_Graphics_Tester;
|
||||||
|
productName = Core_Graphics_Tester;
|
||||||
|
productReference = F6CA385F2933AD8400556E1C /* Core_Graphics_Tester */;
|
||||||
|
productType = "com.apple.product-type.tool";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
F608ABAB28287108005C276B /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
BuildIndependentTargetsInParallel = 1;
|
||||||
|
DefaultBuildSystemTypeForWorkspace = Original;
|
||||||
|
LastSwiftUpdateCheck = 1400;
|
||||||
|
LastUpgradeCheck = 1330;
|
||||||
|
TargetAttributes = {
|
||||||
|
F608ABB228287108005C276B = {
|
||||||
|
CreatedOnToolsVersion = 13.3;
|
||||||
|
};
|
||||||
|
F6CA385E2933AD8400556E1C = {
|
||||||
|
CreatedOnToolsVersion = 14.0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = F608ABAE28287108005C276B /* Build configuration list for PBXProject "Core_Graphics" */;
|
||||||
|
compatibilityVersion = "Xcode 13.0";
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = F608ABAA28287108005C276B;
|
||||||
|
productRefGroup = F608ABB428287108005C276B /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
F608ABB228287108005C276B /* Core_Graphics */,
|
||||||
|
F6971F2B282B1184008FBD17 /* Core_Graphics_iOS */,
|
||||||
|
F6CA385E2933AD8400556E1C /* Core_Graphics_Tester */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
F608ABB028287108005C276B /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
F6C76CCA2CDD661A00EC8827 /* SDF_deadreckoning.cpp in Sources */,
|
||||||
|
F6C76CC52CDD65E400EC8827 /* Colors.cpp in Sources */,
|
||||||
|
F6C76CCD2CDD67A100EC8827 /* pathfinders.cpp in Sources */,
|
||||||
|
F6D165E62CD819EF00F3967F /* Screen+PNG.cpp in Sources */,
|
||||||
|
F6C1BAA62CDD4CB9007439C1 /* STB.cpp in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
F6971F2D282B1184008FBD17 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
F6C76CCB2CDD661A00EC8827 /* SDF_deadreckoning.cpp in Sources */,
|
||||||
|
F6C76CC62CDD65E500EC8827 /* Colors.cpp in Sources */,
|
||||||
|
F6C76CCE2CDD67A200EC8827 /* pathfinders.cpp in Sources */,
|
||||||
|
F6D165E52CD819EF00F3967F /* Screen+PNG.cpp in Sources */,
|
||||||
|
F6C1BAA72CDD4CB9007439C1 /* STB.cpp in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
F6CA385B2933AD8400556E1C /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
F673E3CE2ADD68AA000281FF /* Screen.cpp in Sources */,
|
||||||
|
F6CA38692933B0B100556E1C /* main.cpp in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
F608ABB528287108005C276B /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
GLES_SILENCE_DEPRECATION,
|
||||||
|
GL_SILENCE_DEPRECATION,
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
HEADER_SEARCH_PATHS = (
|
||||||
|
../Core_IO,
|
||||||
|
../Core_Math,
|
||||||
|
../Core_Misc,
|
||||||
|
../Core_Zero,
|
||||||
|
../Core_Allocator,
|
||||||
|
../Libraries/sdk/Darwin/include,
|
||||||
|
core/graphics/imgui,
|
||||||
|
);
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 13.6;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
OTHER_LDFLAGS = "-lCore_Zero";
|
||||||
|
SDKROOT = macosx;
|
||||||
|
USE_HEADERMAP = NO;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
F608ABB628287108005C276B /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
GLES_SILENCE_DEPRECATION,
|
||||||
|
GL_SILENCE_DEPRECATION,
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
HEADER_SEARCH_PATHS = (
|
||||||
|
../Core_IO,
|
||||||
|
../Core_Math,
|
||||||
|
../Core_Misc,
|
||||||
|
../Core_Zero,
|
||||||
|
../Core_Allocator,
|
||||||
|
../Libraries/sdk/Darwin/include,
|
||||||
|
core/graphics/imgui,
|
||||||
|
);
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 13.6;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
OTHER_LDFLAGS = "-lCore_Zero";
|
||||||
|
SDKROOT = macosx;
|
||||||
|
USE_HEADERMAP = NO;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
F608ABB828287108005C276B /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
DEVELOPMENT_TEAM = T2M28D3T75;
|
||||||
|
EXECUTABLE_PREFIX = lib;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
F608ABB928287108005C276B /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
DEVELOPMENT_TEAM = T2M28D3T75;
|
||||||
|
EXECUTABLE_PREFIX = lib;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
F6971F31282B1184008FBD17 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
DEVELOPMENT_TEAM = T2M28D3T75;
|
||||||
|
EXECUTABLE_PREFIX = lib;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
F6971F32282B1184008FBD17 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
DEVELOPMENT_TEAM = T2M28D3T75;
|
||||||
|
EXECUTABLE_PREFIX = lib;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
F6CA38642933AD8400556E1C /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
DEVELOPMENT_TEAM = T2M28D3T75;
|
||||||
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
|
HEADER_SEARCH_PATHS = (
|
||||||
|
"${inherited}",
|
||||||
|
../Core_Graphics,
|
||||||
|
);
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 12.3;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
F6CA38652933AD8400556E1C /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
DEVELOPMENT_TEAM = T2M28D3T75;
|
||||||
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
|
HEADER_SEARCH_PATHS = (
|
||||||
|
"${inherited}",
|
||||||
|
../Core_Graphics,
|
||||||
|
);
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 12.3;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
F608ABAE28287108005C276B /* Build configuration list for PBXProject "Core_Graphics" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
F608ABB528287108005C276B /* Debug */,
|
||||||
|
F608ABB628287108005C276B /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
F608ABB728287108005C276B /* Build configuration list for PBXNativeTarget "Core_Graphics" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
F608ABB828287108005C276B /* Debug */,
|
||||||
|
F608ABB928287108005C276B /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
F6971F30282B1184008FBD17 /* Build configuration list for PBXNativeTarget "Core_Graphics_iOS" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
F6971F31282B1184008FBD17 /* Debug */,
|
||||||
|
F6971F32282B1184008FBD17 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
F6CA38632933AD8400556E1C /* Build configuration list for PBXNativeTarget "Core_Graphics_Tester" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
F6CA38642933AD8400556E1C /* Debug */,
|
||||||
|
F6CA38652933AD8400556E1C /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = F608ABAB28287108005C276B /* Project object */;
|
||||||
|
}
|
||||||
7
Core_Graphics.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
Core_Graphics.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
2
Makefile
Normal file
2
Makefile
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ROOTDIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))..)
|
||||||
|
include $(ROOTDIR)/Core_Make/tjp/Make/Makefile
|
||||||
6
Makefile.def
Executable file
6
Makefile.def
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
timprepscius.core.include := $(timprepscius.core.include) -I $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
|
timprepscius.core.link := $(timprepscius.core.link) -L $(dir $(realpath $(lastword $(MAKEFILE_LIST))))/.bin/$(OBJDIR)
|
||||||
|
|
||||||
|
timprepscius.core_graphics.include := $(timprepscius.core_graphics.include) -I $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
|
timprepscius.core_graphics.link := $(timprepscius.core_graphics.link) -L $(dir $(realpath $(lastword $(MAKEFILE_LIST))))/.bin/$(OBJDIR)
|
||||||
|
|
||||||
19
Makefile.project
Executable file
19
Makefile.project
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
include $(MAKEDIR)/Makefile.base
|
||||||
|
|
||||||
|
# use: ls -d tjp/core/*/ tjp/core/*/*/ | rev | cut -c 2- | rev | sed 's/$/ \\/'
|
||||||
|
|
||||||
|
PROJECTS := \
|
||||||
|
tjp/core/graphics \
|
||||||
|
tjp/core/graphics/soft \
|
||||||
|
|
||||||
|
#SRC_PCH := tjp/core/Precompile.pch
|
||||||
|
|
||||||
|
INCPATH := \
|
||||||
|
$(timprepscius.libraries.cpp.include) \
|
||||||
|
$(timprepscius.core.include)
|
||||||
|
|
||||||
|
LIBFILE := libCore_Graphics.a
|
||||||
|
|
||||||
|
COPYTO := $(LIBRARIES_PROJECT)
|
||||||
|
|
||||||
|
include $(MAKEDIR)/Makefile.lib
|
||||||
1
tests/Makefile
Symbolic link
1
tests/Makefile
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../Make/Makefile
|
||||||
33
tests/Makefile.project
Executable file
33
tests/Makefile.project
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
include $(MAKEDIR)/Makefile.base
|
||||||
|
|
||||||
|
# use: ls -d core/*/ core/*/*/ | rev | cut -c 2- | rev | sed 's/$/ \\/'
|
||||||
|
|
||||||
|
PROJECTS := \
|
||||||
|
. \
|
||||||
|
../core/graphics/_tests \
|
||||||
|
../core/graphics/soft/_tests \
|
||||||
|
../core/graphics/vuku/_tests \
|
||||||
|
|
||||||
|
INCPATH := \
|
||||||
|
$(timprepscius.libraries.cpp.include) \
|
||||||
|
$(timprepscius.core.include)
|
||||||
|
|
||||||
|
LDPATH := $(timprepscius.libraries.cpp.link)
|
||||||
|
|
||||||
|
LIBS := \
|
||||||
|
-lCore_Zero \
|
||||||
|
-lCore_Misc \
|
||||||
|
-lCore_Math \
|
||||||
|
-lCore_Graphics \
|
||||||
|
-lz_
|
||||||
|
|
||||||
|
EXEFILE := Core_Graphics_Tests.exe
|
||||||
|
|
||||||
|
#COPYTO := $(ROOTDIR)/.bin
|
||||||
|
|
||||||
|
ifeq (Darwin,$(SYS_NAME))
|
||||||
|
LIBS += -lc++
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
include $(MAKEDIR)/Makefile.bin
|
||||||
17
tests/main.cpp
Normal file
17
tests/main.cpp
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#define CATCH_CONFIG_RUNNER
|
||||||
|
#include <tjp/core/testing/catch.hpp>
|
||||||
|
|
||||||
|
#include <tjp/core/log/Log.h>
|
||||||
|
|
||||||
|
using namespace tjp;
|
||||||
|
using namespace core;
|
||||||
|
|
||||||
|
int main( int argc, char* argv[] )
|
||||||
|
{
|
||||||
|
xLogInitialize("Core_Graphics_Tests.txt");
|
||||||
|
xLogActivateStory("testing");
|
||||||
|
xLogActivateStory("debug");
|
||||||
|
|
||||||
|
int result = Catch::Session().run( argc, argv );
|
||||||
|
return result;
|
||||||
|
}
|
||||||
46
tjp/core/graphics/Color.hpp
Normal file
46
tjp/core/graphics/Color.hpp
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
//
|
||||||
|
// vuku.h
|
||||||
|
// Core
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 9/8/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <tjp/core/math/Vector3.hpp>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace tjp::core::graphics {
|
||||||
|
|
||||||
|
// https://stackoverflow.com/questions/3018313/algorithm-to-convert-rgb-to-hsv-and-hsv-to-rgb-in-range-0-255-for-both
|
||||||
|
template<typename T>
|
||||||
|
T clamp(const T &t, T l=0, T r=1)
|
||||||
|
{
|
||||||
|
return std::min(std::max(t, l), r);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
math::Vector3<T> saturate(const math::Vector3<T> &v)
|
||||||
|
{
|
||||||
|
return { clamp(v[0]), clamp(v[1]), clamp(v[2]) };
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
math::Vector3<T> hue(T H)
|
||||||
|
{
|
||||||
|
T R = abs(H * 6 - 3) - 1;
|
||||||
|
T G = 2 - abs(H * 6 - 2);
|
||||||
|
T B = 2 - abs(H * 6 - 4);
|
||||||
|
return saturate(math::Vector3<T> { R,G,B });
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
math::Vector3<T> hsv2rgb(const math::Vector3<T> &hsv)
|
||||||
|
{
|
||||||
|
return ((hue(hsv[0]) - math::Vector3<T> { 1,1,1 }) * hsv[1] + math::Vector3<T> { 1,1,1 }) * hsv[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace
|
||||||
62
tjp/core/graphics/Colors.cpp
Normal file
62
tjp/core/graphics/Colors.cpp
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
//
|
||||||
|
// Bridge.m
|
||||||
|
// BgfxClient
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 8/28/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "Colors.hpp"
|
||||||
|
|
||||||
|
#include <tjp/core/math/Vector4.inl>
|
||||||
|
#include <tjp/core/time/Time.hpp>
|
||||||
|
|
||||||
|
namespace tjp::core::graphics::colors {
|
||||||
|
|
||||||
|
Colors::Colors ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Colors::Colors(std::initializer_list<IndexedColor> initializer)
|
||||||
|
{
|
||||||
|
colors.resize(initializer.size());
|
||||||
|
|
||||||
|
for (auto &[index, color]: initializer)
|
||||||
|
set(index, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
Color Colors::get(ColorIndex index)
|
||||||
|
{
|
||||||
|
if (index < colors.size())
|
||||||
|
return colors[index];
|
||||||
|
|
||||||
|
return Color { 1,0,1,1 };
|
||||||
|
}
|
||||||
|
|
||||||
|
void Colors::set(int index, const Color &color)
|
||||||
|
{
|
||||||
|
if (colors.size() <= index)
|
||||||
|
colors.resize(index+1);
|
||||||
|
|
||||||
|
colors[index] = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ColorManager::transitionTo(const Colors &c, time::Duration duration)
|
||||||
|
{
|
||||||
|
c0 = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
Color ColorManager::get(ColorIndex index)
|
||||||
|
{
|
||||||
|
if (transition == 0)
|
||||||
|
return c0.get(index);
|
||||||
|
|
||||||
|
return scale(
|
||||||
|
transition,
|
||||||
|
c0.get(index),
|
||||||
|
c1.get(index)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
25
tjp/core/graphics/Colors.h
Normal file
25
tjp/core/graphics/Colors.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
//
|
||||||
|
// Bridge.m
|
||||||
|
// BgfxClient
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 8/28/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <tjp/core/containers/Vector.h>
|
||||||
|
|
||||||
|
#include <tjp/core/math/Vector4.h>
|
||||||
|
|
||||||
|
namespace tjp::core::graphics::colors {
|
||||||
|
|
||||||
|
using ColorIndex = int;
|
||||||
|
using Color = math::Vector4f;
|
||||||
|
using IndexedColor = std::pair<int, Color>;
|
||||||
|
using IndexedColors = Vector<IndexedColor>;
|
||||||
|
|
||||||
|
struct Colors;
|
||||||
|
struct ColorManager;
|
||||||
|
|
||||||
|
} // namespace
|
||||||
64
tjp/core/graphics/Colors.hpp
Normal file
64
tjp/core/graphics/Colors.hpp
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
//
|
||||||
|
// Bridge.m
|
||||||
|
// BgfxClient
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 8/28/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Colors.h"
|
||||||
|
|
||||||
|
#include <tjp/core/containers/Vector.h>
|
||||||
|
#include <tjp/core/math/Vector4.hpp>
|
||||||
|
|
||||||
|
#include <tjp/core/time/Time.h>
|
||||||
|
|
||||||
|
namespace tjp::core::graphics::colors {
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T scale (float v, const T &l, const T &r)
|
||||||
|
{
|
||||||
|
return v * (r - l) + l;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Colors
|
||||||
|
{
|
||||||
|
Vector<Color> colors;
|
||||||
|
|
||||||
|
Colors ();
|
||||||
|
Colors(std::initializer_list<IndexedColor> initializer);
|
||||||
|
|
||||||
|
Color get(int index);
|
||||||
|
void set(ColorIndex index, const Color &color);
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
Color get(T index)
|
||||||
|
{
|
||||||
|
return get((int)index);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void set(T index, Color color)
|
||||||
|
{
|
||||||
|
set((int)index, color);
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
struct ColorManager
|
||||||
|
{
|
||||||
|
Colors c0, c1;
|
||||||
|
float transition = 0;
|
||||||
|
|
||||||
|
void transitionTo(const Colors &c, time::Duration duration);
|
||||||
|
Color get(ColorIndex index);
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
Color get(T index)
|
||||||
|
{
|
||||||
|
return get((int)index);
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
} // namespace
|
||||||
38
tjp/core/graphics/Geometry.h
Normal file
38
tjp/core/graphics/Geometry.h
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
//
|
||||||
|
// vuku.h
|
||||||
|
// Core
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 9/8/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <tjp/core/math/Vector3.hpp>
|
||||||
|
#include <tjp/core/math/Vector2.hpp>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace tjp {
|
||||||
|
namespace core {
|
||||||
|
namespace graphics {
|
||||||
|
|
||||||
|
namespace geometry
|
||||||
|
{
|
||||||
|
|
||||||
|
template<typename R, typename I=int>
|
||||||
|
struct Geometry
|
||||||
|
{
|
||||||
|
std::vector<math::Vector3<R>> vertices;
|
||||||
|
std::vector<I> indices;
|
||||||
|
std::vector<math::Vector3<R>> normals;
|
||||||
|
std::vector<math::Vector2<R>> uvs;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
template<typename Real, typename Index>
|
||||||
|
Geometry<Real,Index> sphere(unsigned int numZSamples,
|
||||||
|
unsigned int numRadialSamples, Real radius, bool outside);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
189
tjp/core/graphics/Geometry.hpp
Normal file
189
tjp/core/graphics/Geometry.hpp
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
//
|
||||||
|
// vuku.h
|
||||||
|
// Core
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 9/8/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "Geometry.h"
|
||||||
|
#include <array>
|
||||||
|
#include <tjp/core/assert/debug_assert.h>
|
||||||
|
#include <tjp/core/math/Real.hpp>
|
||||||
|
#include <tjp/core/math/Vector3.inl>
|
||||||
|
|
||||||
|
namespace tjp::core::graphics::geometry {
|
||||||
|
|
||||||
|
template<typename Index>
|
||||||
|
void ReverseTriangleOrder(std::vector<Index> &indices)
|
||||||
|
{
|
||||||
|
auto numTriangles = indices.size()/3;
|
||||||
|
for (unsigned int t = 0; t < numTriangles; ++t)
|
||||||
|
{
|
||||||
|
std::swap(indices[t*3 + 1], indices[t*3 + 2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename Real, typename Index>
|
||||||
|
Geometry<Real, Index> sphere(unsigned int numZSamples,
|
||||||
|
unsigned int numRadialSamples, Real radius, bool mOutside)
|
||||||
|
{
|
||||||
|
Geometry<Real, Index> result;
|
||||||
|
using namespace math;
|
||||||
|
|
||||||
|
const Real _0 = 0;
|
||||||
|
const Real _1 = 1;
|
||||||
|
const Real _2 = 2;
|
||||||
|
|
||||||
|
// Quantities derived from inputs.
|
||||||
|
unsigned int zsm1 = numZSamples - 1;
|
||||||
|
unsigned int zsm2 = numZSamples - 2;
|
||||||
|
unsigned int zsm3 = numZSamples - 3;
|
||||||
|
unsigned int rsp1 = numRadialSamples + 1;
|
||||||
|
Real invRS = _1 / static_cast<Real>(numRadialSamples);
|
||||||
|
Real zFactor = _2 / static_cast<Real>(zsm1);
|
||||||
|
unsigned int numVertices = zsm2 * rsp1 + 2;
|
||||||
|
unsigned int numTriangles = 2 * zsm2 * numRadialSamples;
|
||||||
|
|
||||||
|
// Generate geometry.
|
||||||
|
result.vertices.resize(numVertices);
|
||||||
|
result.normals.resize(numVertices);
|
||||||
|
result.uvs.resize(numVertices);
|
||||||
|
|
||||||
|
Vector3<Real> pos, nor;
|
||||||
|
Vector2<Real> tcd;
|
||||||
|
|
||||||
|
// Generate points on the unit circle to be used in computing the mesh
|
||||||
|
// points on a sphere slice.
|
||||||
|
std::vector<Real> cs(rsp1), sn(rsp1);
|
||||||
|
for (unsigned int r = 0; r < numRadialSamples; ++r)
|
||||||
|
{
|
||||||
|
Real angle = invRS * r * constants<Real>::TWO_PI;
|
||||||
|
cs[r] = std::cos(angle);
|
||||||
|
sn[r] = std::sin(angle);
|
||||||
|
}
|
||||||
|
cs[numRadialSamples] = cs[0];
|
||||||
|
sn[numRadialSamples] = sn[0];
|
||||||
|
|
||||||
|
// Generate the sphere itself.
|
||||||
|
unsigned int i = 0;
|
||||||
|
for (unsigned int z = 1; z < zsm1; ++z)
|
||||||
|
{
|
||||||
|
Real zFraction = -_1 + zFactor*static_cast<Real>(z); // in (-1,1)
|
||||||
|
Real zValue = radius*zFraction;
|
||||||
|
|
||||||
|
// Compute center of slice.
|
||||||
|
Vector3<Real> sliceCenter{ _0, _0, zValue };
|
||||||
|
|
||||||
|
// Compute radius of slice.
|
||||||
|
Real sliceRadius = std::sqrt(std::max(radius * radius - zValue * zValue, _0));
|
||||||
|
|
||||||
|
// Compute slice vertices with duplication at endpoint.
|
||||||
|
for (unsigned int r = 0; r <= numRadialSamples; ++r, ++i)
|
||||||
|
{
|
||||||
|
float radialFraction = r * invRS; // in [0,1)
|
||||||
|
Vector3<Real> radial{ cs[r], sn[r], _0 };
|
||||||
|
pos = sliceCenter + sliceRadius * radial;
|
||||||
|
nor = pos.normalize();
|
||||||
|
if (!mOutside)
|
||||||
|
{
|
||||||
|
nor = -nor;
|
||||||
|
}
|
||||||
|
|
||||||
|
tcd = { radialFraction, Real(0.5) * (zFraction + _1) };
|
||||||
|
|
||||||
|
result.vertices[i] = pos;
|
||||||
|
result.normals[i] = nor;
|
||||||
|
result.uvs[i] = tcd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The point at the south pole.
|
||||||
|
pos = Vector3<Real> { _0, _0, -radius };
|
||||||
|
if (mOutside)
|
||||||
|
{
|
||||||
|
nor = Vector3<Real> { _0, _0, -_1 };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nor = Vector3<Real> { _0, _0, _1 };
|
||||||
|
}
|
||||||
|
tcd = { Real(0.5), _0 };
|
||||||
|
result.vertices[i] = pos;
|
||||||
|
result.normals[i] = nor;
|
||||||
|
result.uvs[i] = tcd;
|
||||||
|
++i;
|
||||||
|
|
||||||
|
// The point at the north pole.
|
||||||
|
pos = Vector3<Real> { _0, _0, radius };
|
||||||
|
if (mOutside)
|
||||||
|
{
|
||||||
|
nor = Vector3<Real> { _0, _0, _1 };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nor = Vector3<Real> { _0, _0, -_1 };
|
||||||
|
}
|
||||||
|
tcd = { Real(0.5), Real(1.0) };
|
||||||
|
result.vertices[i] = pos;
|
||||||
|
result.normals[i] = nor;
|
||||||
|
result.uvs[i] = tcd;
|
||||||
|
++i;
|
||||||
|
|
||||||
|
debug_assert(i == numVertices);
|
||||||
|
|
||||||
|
// Generate indices (outside view).
|
||||||
|
result.indices.resize(numTriangles*3);
|
||||||
|
unsigned int t = 0;
|
||||||
|
for (unsigned int z = 0, zStart = 0; z < zsm3; ++z)
|
||||||
|
{
|
||||||
|
unsigned int i0 = zStart;
|
||||||
|
unsigned int i1 = i0 + 1;
|
||||||
|
zStart += rsp1;
|
||||||
|
unsigned int i2 = zStart;
|
||||||
|
unsigned int i3 = i2 + 1;
|
||||||
|
for (i = 0; i < numRadialSamples; ++i, ++i0, ++i1, ++i2, ++i3)
|
||||||
|
{
|
||||||
|
result.indices[t*3 + 0] = i0;
|
||||||
|
result.indices[t*3 + 1] = i1;
|
||||||
|
result.indices[t*3 + 2] = i2;
|
||||||
|
++t;
|
||||||
|
|
||||||
|
result.indices[t*3 + 0] = i1;
|
||||||
|
result.indices[t*3 + 1] = i3;
|
||||||
|
result.indices[t*3 + 2] = i2;
|
||||||
|
++t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The south pole triangles (outside view).
|
||||||
|
unsigned int numVerticesM2 = numVertices - 2;
|
||||||
|
for (i = 0; i < numRadialSamples; ++i, ++t)
|
||||||
|
{
|
||||||
|
result.indices[t*3 + 0] = i;
|
||||||
|
result.indices[t*3 + 1] = numVerticesM2;
|
||||||
|
result.indices[t*3 + 2] = i+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The north pole triangles (outside view).
|
||||||
|
unsigned int numVerticesM1 = numVertices - 1, offset = zsm3 * rsp1;
|
||||||
|
for (i = 0; i < numRadialSamples; ++i, ++t)
|
||||||
|
{
|
||||||
|
result.indices[t*3 + 0] = i + offset;
|
||||||
|
result.indices[t*3 + 1] = i + 1 + offset;
|
||||||
|
result.indices[t*3 + 2] = numVerticesM1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mOutside)
|
||||||
|
{
|
||||||
|
ReverseTriangleOrder(result.indices);
|
||||||
|
}
|
||||||
|
|
||||||
|
debug_assert(t == numTriangles);
|
||||||
|
|
||||||
|
// Create the mesh.
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
17
tjp/core/graphics/SDF.h
Normal file
17
tjp/core/graphics/SDF.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// vuku.h
|
||||||
|
// Core
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 9/8/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "SDF_deadreckoning.h"
|
||||||
|
|
||||||
|
namespace tjp::core::graphics::sdf {
|
||||||
|
|
||||||
|
using namespace deadreckoning;
|
||||||
|
|
||||||
|
} // namespace
|
||||||
259
tjp/core/graphics/SDF_deadreckoning.cpp
Normal file
259
tjp/core/graphics/SDF_deadreckoning.cpp
Normal file
@@ -0,0 +1,259 @@
|
|||||||
|
// "dead reckoning" transform function which generates signed distance field
|
||||||
|
// from binary image.
|
||||||
|
//
|
||||||
|
// "The Dead Reckoning algorithm" is described in Fig.3 of the following paper:
|
||||||
|
// The "dead reckoning" signed distance transform by George J. Grevera
|
||||||
|
// http://perso.ensta-paristech.fr/~manzaner/Download/IAD/Grevera_04.pdf
|
||||||
|
//
|
||||||
|
// License:
|
||||||
|
// Copyright (C) 2021, Takayuki Matsuoka.
|
||||||
|
// SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <vector>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
#include <tjp/core/assert/debug_assert.h>
|
||||||
|
|
||||||
|
namespace tjp::core::graphics::sdf::deadreckoning {
|
||||||
|
|
||||||
|
// width Width of the binary image in pixels.
|
||||||
|
// height Height of the binary image in pixels.
|
||||||
|
// getBinaryPixel A function which returns pixel of binary image. true:inside, false:outside.
|
||||||
|
// setSignedDistance A function which sets signed distance to the signed distance image.
|
||||||
|
// - Distance has sign, in pixels.
|
||||||
|
// - Positive means inside of binary image. Negative means outside.
|
||||||
|
// - Distance is not normalized. Therefore, -6.5f means "6.5 pixel, outside"
|
||||||
|
// +1.2f means "1.2 pixels, inside". You can find example of "normalization"
|
||||||
|
// of signed distance in proc().
|
||||||
|
|
||||||
|
template<typename F0, typename F1>
|
||||||
|
void deadReckoning(
|
||||||
|
int width
|
||||||
|
, int height
|
||||||
|
, F0 getBinaryPixel
|
||||||
|
, F1 setSignedDistance
|
||||||
|
|
||||||
|
// , const std::function<bool(int x, int y)>& getBinaryPixel
|
||||||
|
// , const std::function<void(int x, int y, float signedDistance)>& setSignedDistance
|
||||||
|
|
||||||
|
) {
|
||||||
|
const auto contains = [&](int x, int y) -> bool {
|
||||||
|
return x >= 0 && x < width && y >= 0 && y < height;
|
||||||
|
};
|
||||||
|
|
||||||
|
// I - a 2D binary image
|
||||||
|
const bool outside = false;
|
||||||
|
const bool inside = true;
|
||||||
|
const auto I = [&](int x, int y) -> bool { return getBinaryPixel(x, y) ? inside : outside; };
|
||||||
|
|
||||||
|
// d - a 2D grey image representing the distance image
|
||||||
|
std::vector<float> ds(width * height);
|
||||||
|
const float inf = static_cast<float>(256 * 256 * 256);
|
||||||
|
const auto getd = [&](int x, int y) -> float {
|
||||||
|
debug_assert(x < width && y < height && x >= 0 && y >= 0);
|
||||||
|
return ds[y*width + x];
|
||||||
|
};
|
||||||
|
const auto setd = [&](int x, int y, float v) {
|
||||||
|
debug_assert(x < width && y < height && x >= 0 && y >= 0);
|
||||||
|
ds[y*width + x] = v;
|
||||||
|
};
|
||||||
|
const auto distance = [](int x, int y) -> float {
|
||||||
|
return std::hypot(static_cast<float>(x), static_cast<float>(y));
|
||||||
|
};
|
||||||
|
|
||||||
|
// p - for each pixel, the corresponding border point
|
||||||
|
struct Point { int x, y; };
|
||||||
|
std::vector<Point> ps(width * height);
|
||||||
|
const Point outOfBounds = { -1, -1 };
|
||||||
|
const auto getp = [&](int x, int y) -> Point {
|
||||||
|
debug_assert(x < width && y < height && x >= 0 && y >= 0);
|
||||||
|
return ps[y*width + x];
|
||||||
|
};
|
||||||
|
const auto setp = [&](int x, int y, const Point& p) {
|
||||||
|
debug_assert(x < width && y < height && x >= 0 && y >= 0);
|
||||||
|
ps[y*width + x] = p;
|
||||||
|
};
|
||||||
|
|
||||||
|
// initialize d
|
||||||
|
// initialize immediate interior & exterior elements
|
||||||
|
for(int y = 0; y < height; ++y) {
|
||||||
|
for(int x = 0; x < width; ++x) {
|
||||||
|
const bool c = I(x, y);
|
||||||
|
const bool w = contains(x-1, y) ? I(x-1, y) : outside;
|
||||||
|
const bool e = contains(x+1, y) ? I(x+1, y) : outside;
|
||||||
|
const bool n = contains(x, y-1) ? I(x, y-1) : outside;
|
||||||
|
const bool s = contains(x, y+1) ? I(x, y+1) : outside;
|
||||||
|
if((w != c) || (e != c) || (n != c) || (s != c)) {
|
||||||
|
setd(x, y, 0);
|
||||||
|
setp(x, y, { x, y });
|
||||||
|
} else {
|
||||||
|
setd(x, y, inf);
|
||||||
|
setp(x, y, outOfBounds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Perform minimum distance choice for single pixel, single direction.
|
||||||
|
enum class Dir {
|
||||||
|
NW, N, NE, // NW=(x-1, y-1), N=(x, y-1), NE=(x+1, y-1)
|
||||||
|
W, E, // W =(x-1, y), E =(x+1, y)
|
||||||
|
SW, S, SE // SW=(x-1, y+1), S=(x, y+1), SE=(x+1, y+1)
|
||||||
|
};
|
||||||
|
const auto f = [&](int x, int y, Dir dir) {
|
||||||
|
// d1 - distance between two adjacent pixels in either the x or y direction
|
||||||
|
const float d1 = 1.0f;
|
||||||
|
|
||||||
|
// d2 - distance between two diagonally adjacent pixels (sqrt(2))
|
||||||
|
const float d2 = d1 * 1.4142135623730950488f;
|
||||||
|
|
||||||
|
int dx, dy;
|
||||||
|
float od;
|
||||||
|
switch(dir) {
|
||||||
|
default:
|
||||||
|
case Dir::NW: dx = -1; dy = -1; od = d2; break; // first pass
|
||||||
|
case Dir::N: dx = 0; dy = -1; od = d1; break; // first pass
|
||||||
|
case Dir::NE: dx = 1; dy = -1; od = d2; break; // first pass
|
||||||
|
case Dir::W: dx = -1; dy = 0; od = d1; break; // first pass
|
||||||
|
case Dir::E: dx = 1; dy = 0; od = d1; break; // final pass
|
||||||
|
case Dir::SW: dx = -1; dy = 1; od = d2; break; // final pass
|
||||||
|
case Dir::S: dx = 0; dy = 1; od = d1; break; // final pass
|
||||||
|
case Dir::SE: dx = 1; dy = 1; od = d2; break; // final pass
|
||||||
|
}
|
||||||
|
const bool b = contains(x+dx, y+dy);
|
||||||
|
const float cd = b ? getd(x+dx, y+dy) : inf;
|
||||||
|
if(cd + od < getd(x, y)) {
|
||||||
|
const Point p = b ? getp(x+dx, y+dy) : outOfBounds;
|
||||||
|
setp(x, y, p);
|
||||||
|
const int xx = x - p.x;
|
||||||
|
const int yy = y - p.y;
|
||||||
|
const float nd = distance(xx, yy);
|
||||||
|
setd(x, y, nd);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// perform the first pass
|
||||||
|
for(int y = 0; y < height; ++y) { // top to bottom
|
||||||
|
for(int x = 0; x < width; ++x) { // left to right
|
||||||
|
static const Dir dirs[] = { Dir::NW, Dir::N, Dir::NE, Dir::W };
|
||||||
|
for(const Dir dir : dirs) {
|
||||||
|
f(x, y, dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// perform the final pass
|
||||||
|
for(int y = height-1; y >= 0; --y) { // bottom to top
|
||||||
|
for(int x = width-1; x >= 0; --x) { // right to left
|
||||||
|
static const Dir dirs[] = { Dir::E, Dir::SW, Dir::S, Dir::SE };
|
||||||
|
for(const Dir dir : dirs) {
|
||||||
|
f(x, y, dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// indicate inside & outside
|
||||||
|
for(int y = 0; y < height; ++y) {
|
||||||
|
for(int x = 0; x < width; ++x) {
|
||||||
|
float d = getd(x, y);
|
||||||
|
if(I(x, y) == outside) {
|
||||||
|
d = -d; // Negative distance means outside.
|
||||||
|
}
|
||||||
|
setSignedDistance(x, y, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void deadReckoning_computeRGBA (
|
||||||
|
int spread,
|
||||||
|
unsigned int width, unsigned int height,
|
||||||
|
unsigned char *image)
|
||||||
|
{
|
||||||
|
auto srcRgbaImage = image;
|
||||||
|
auto outRgbaImage = image;
|
||||||
|
uint8_t threshA = 250;
|
||||||
|
|
||||||
|
spread = 16;
|
||||||
|
|
||||||
|
{
|
||||||
|
// Convert an RGBA pixel to binary.
|
||||||
|
const auto getBinaryPixel = [&](int x, int y) -> bool {
|
||||||
|
debug_assert(x < width && y < height && x >= 0 && y >= 0);
|
||||||
|
const int o = (y * width + x) * 4;
|
||||||
|
const uint8_t a = srcRgbaImage[o + 3];
|
||||||
|
return a > threshA;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Normalize signed distance to [0,255] and write it as a RGBA pixel.
|
||||||
|
const auto setSignedDistance = [&](int x, int y, float signedDistance) {
|
||||||
|
debug_assert(x < width && y < height && x >= 0 && y >= 0);
|
||||||
|
const float d = ((signedDistance / spread) + 1.0f) * 128.0f;
|
||||||
|
|
||||||
|
const auto c = static_cast<uint8_t>(std::clamp(d, 0.0f, 255.0f));
|
||||||
|
const int o = (y * width + x) * 4;
|
||||||
|
outRgbaImage[o + 3] = c; // A
|
||||||
|
};
|
||||||
|
|
||||||
|
deadReckoning(width, height, getBinaryPixel, setSignedDistance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void deadReckoning_computeA (
|
||||||
|
int spread,
|
||||||
|
unsigned int width, unsigned int height,
|
||||||
|
unsigned char *image)
|
||||||
|
{
|
||||||
|
auto srcRgbaImage = image;
|
||||||
|
auto outRgbaImage = image;
|
||||||
|
uint8_t threshA = 250;
|
||||||
|
|
||||||
|
spread = 16;
|
||||||
|
|
||||||
|
{
|
||||||
|
const auto getBinaryPixel = [&](int x, int y) -> bool {
|
||||||
|
debug_assert(x < width && y < height && x >= 0 && y >= 0);
|
||||||
|
|
||||||
|
const int o = (y * width + x);
|
||||||
|
debug_assert(o < width * height);
|
||||||
|
|
||||||
|
const uint8_t a = srcRgbaImage[o];
|
||||||
|
return a > threshA;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Normalize signed distance to [0,255] and write it as a RGBA pixel.
|
||||||
|
const auto setSignedDistance = [&](int x, int y, float signedDistance) {
|
||||||
|
debug_assert(x < width && y < height && x >= 0 && y >= 0);
|
||||||
|
|
||||||
|
const float d = ((signedDistance / spread) + 1.0f) * 128.0f;
|
||||||
|
|
||||||
|
const auto c = static_cast<uint8_t>(std::clamp(d, 0.0f, 255.0f));
|
||||||
|
const int o = (y * width + x);
|
||||||
|
|
||||||
|
debug_assert(o < width * height);
|
||||||
|
outRgbaImage[o] = c; // A
|
||||||
|
};
|
||||||
|
|
||||||
|
deadReckoning(width, height, getBinaryPixel, setSignedDistance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void computeRGBA(
|
||||||
|
size_t width, size_t height,
|
||||||
|
unsigned char *image,
|
||||||
|
int spread
|
||||||
|
)
|
||||||
|
{
|
||||||
|
deadReckoning_computeRGBA(spread, (unsigned int)width, (unsigned int)height, (unsigned char *)image);
|
||||||
|
}
|
||||||
|
|
||||||
|
void computeA(
|
||||||
|
size_t width, size_t height,
|
||||||
|
unsigned char *image,
|
||||||
|
int spread
|
||||||
|
)
|
||||||
|
{
|
||||||
|
deadReckoning_computeA(spread, (unsigned int)width, (unsigned int)height, (unsigned char *)image);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
25
tjp/core/graphics/SDF_deadreckoning.h
Normal file
25
tjp/core/graphics/SDF_deadreckoning.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
//
|
||||||
|
// vuku.h
|
||||||
|
// Core
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 9/8/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace tjp::core::graphics::sdf::deadreckoning {
|
||||||
|
|
||||||
|
void computeRGBA(
|
||||||
|
size_t width, size_t height,
|
||||||
|
unsigned char *image,
|
||||||
|
int spread = 16
|
||||||
|
);
|
||||||
|
|
||||||
|
void computeA(
|
||||||
|
size_t width, size_t height,
|
||||||
|
unsigned char *image,
|
||||||
|
int spread = 16
|
||||||
|
);
|
||||||
|
|
||||||
|
} // namespace
|
||||||
16
tjp/core/graphics/STB+Image.h
Normal file
16
tjp/core/graphics/STB+Image.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// vuku.h
|
||||||
|
// Core
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 9/8/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stb/stb_image.h>
|
||||||
|
#include <stb/stb_image_write.h>
|
||||||
|
#include <stb/deprecated/stb_image_resize.h>
|
||||||
|
|
||||||
|
STBIWDEF unsigned char *stbi_write_png_to_mem(const unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len);
|
||||||
|
|
||||||
10
tjp/core/graphics/STB+Image.inl
Normal file
10
tjp/core/graphics/STB+Image.inl
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#include "STB+Image.h"
|
||||||
|
|
||||||
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
|
#include <stb/stb_image.h>
|
||||||
|
|
||||||
|
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||||
|
#include <stb/stb_image_write.h>
|
||||||
|
|
||||||
|
#define STB_IMAGE_RESIZE_IMPLEMENTATION
|
||||||
|
#include <stb/deprecated/stb_image_resize.h>
|
||||||
12
tjp/core/graphics/STB+TrueType.h
Normal file
12
tjp/core/graphics/STB+TrueType.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// vuku.h
|
||||||
|
// Core
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 9/8/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stb/stb_truetype.h>
|
||||||
|
|
||||||
2
tjp/core/graphics/STB+TrueType.inl
Normal file
2
tjp/core/graphics/STB+TrueType.inl
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#define STB_TRUETYPE_IMPLEMENTATION
|
||||||
|
#include <stb/stb_truetype.h>
|
||||||
10
tjp/core/graphics/STB.cpp
Normal file
10
tjp/core/graphics/STB.cpp
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
//
|
||||||
|
// vuku.h
|
||||||
|
// Core
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 9/8/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "STB+Image.inl"
|
||||||
|
#include "STB+TrueType.inl"
|
||||||
12
tjp/core/graphics/glm.h
Normal file
12
tjp/core/graphics/glm.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// vuku.h
|
||||||
|
// Core
|
||||||
|
//
|
||||||
|
// Created by Timothy Prepscius on 9/8/20.
|
||||||
|
// Copyright © 2020 Timothy Prepscius. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <glm/glm.hpp>
|
||||||
|
#include <glm/ext.hpp>
|
||||||
125
tjp/core/graphics/imgui-old/imconfig.h
Normal file
125
tjp/core/graphics/imgui-old/imconfig.h
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// COMPILE-TIME OPTIONS FOR DEAR IMGUI
|
||||||
|
// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
|
||||||
|
// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it)
|
||||||
|
// B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp
|
||||||
|
// files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures.
|
||||||
|
// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
|
||||||
|
// Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
//---- Define assertion handler. Defaults to calling assert().
|
||||||
|
// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
|
||||||
|
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
|
||||||
|
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
|
||||||
|
|
||||||
|
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
|
||||||
|
// Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
|
||||||
|
// DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions()
|
||||||
|
// for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details.
|
||||||
|
//#define IMGUI_API __declspec( dllexport )
|
||||||
|
//#define IMGUI_API __declspec( dllimport )
|
||||||
|
|
||||||
|
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names.
|
||||||
|
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||||
|
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions.
|
||||||
|
|
||||||
|
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
|
||||||
|
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
|
||||||
|
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
|
||||||
|
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty.
|
||||||
|
//#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowStackToolWindow() will be empty (this was called IMGUI_DISABLE_METRICS_WINDOW before 1.88).
|
||||||
|
|
||||||
|
//---- Don't implement some functions to reduce linkage requirements.
|
||||||
|
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
|
||||||
|
//#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW)
|
||||||
|
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
|
||||||
|
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime).
|
||||||
|
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
|
||||||
|
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
|
||||||
|
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
|
||||||
|
//#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
|
||||||
|
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
|
||||||
|
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
|
||||||
|
//#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
|
||||||
|
|
||||||
|
//---- Include imgui_user.h at the end of imgui.h as a convenience
|
||||||
|
//#define IMGUI_INCLUDE_IMGUI_USER_H
|
||||||
|
|
||||||
|
//---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another)
|
||||||
|
//#define IMGUI_USE_BGRA_PACKED_COLOR
|
||||||
|
|
||||||
|
//---- Use 32-bit for ImWchar (default is 16-bit) to support unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
|
||||||
|
//#define IMGUI_USE_WCHAR32
|
||||||
|
|
||||||
|
//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
|
||||||
|
// By default the embedded implementations are declared static and not available outside of Dear ImGui sources files.
|
||||||
|
//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
|
||||||
|
//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
|
||||||
|
//#define IMGUI_STB_SPRINTF_FILENAME "my_folder/stb_sprintf.h" // only used if enabled
|
||||||
|
//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
|
||||||
|
//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
|
||||||
|
|
||||||
|
//---- Use stb_sprintf.h for a faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined)
|
||||||
|
// Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by stb_sprintf.h.
|
||||||
|
//#define IMGUI_USE_STB_SPRINTF
|
||||||
|
|
||||||
|
//---- Use FreeType to build and rasterize the font atlas (instead of stb_truetype which is embedded by default in Dear ImGui)
|
||||||
|
// Requires FreeType headers to be available in the include path. Requires program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this repository) + the FreeType library (not provided).
|
||||||
|
// On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'.
|
||||||
|
//#define IMGUI_ENABLE_FREETYPE
|
||||||
|
|
||||||
|
//---- Use stb_truetype to build and rasterize the font atlas (default)
|
||||||
|
// The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend.
|
||||||
|
//#define IMGUI_ENABLE_STB_TRUETYPE
|
||||||
|
|
||||||
|
//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
|
||||||
|
// This will be inlined as part of ImVec2 and ImVec4 class declarations.
|
||||||
|
/*
|
||||||
|
#define IM_VEC2_CLASS_EXTRA \
|
||||||
|
constexpr ImVec2(const MyVec2& f) : x(f.x), y(f.y) {} \
|
||||||
|
operator MyVec2() const { return MyVec2(x,y); }
|
||||||
|
|
||||||
|
#define IM_VEC4_CLASS_EXTRA \
|
||||||
|
constexpr ImVec4(const MyVec4& f) : x(f.x), y(f.y), z(f.z), w(f.w) {} \
|
||||||
|
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
||||||
|
*/
|
||||||
|
|
||||||
|
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
|
||||||
|
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
|
||||||
|
// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
|
||||||
|
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
|
||||||
|
//#define ImDrawIdx unsigned int
|
||||||
|
|
||||||
|
//---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
|
||||||
|
//struct ImDrawList;
|
||||||
|
//struct ImDrawCmd;
|
||||||
|
//typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data);
|
||||||
|
//#define ImDrawCallback MyImDrawCallback
|
||||||
|
|
||||||
|
//---- Debug Tools: Macro to break in Debugger
|
||||||
|
// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.)
|
||||||
|
//#define IM_DEBUG_BREAK IM_ASSERT(0)
|
||||||
|
//#define IM_DEBUG_BREAK __debugbreak()
|
||||||
|
|
||||||
|
//---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(),
|
||||||
|
// (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.)
|
||||||
|
// This adds a small runtime cost which is why it is not enabled by default.
|
||||||
|
//#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX
|
||||||
|
|
||||||
|
//---- Debug Tools: Enable slower asserts
|
||||||
|
//#define IMGUI_DEBUG_PARANOID
|
||||||
|
|
||||||
|
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
|
||||||
|
/*
|
||||||
|
namespace ImGui
|
||||||
|
{
|
||||||
|
void MyFunction(const char* name, const MyMatrix44& v);
|
||||||
|
}
|
||||||
|
*/
|
||||||
13547
tjp/core/graphics/imgui-old/imgui.cpp
Normal file
13547
tjp/core/graphics/imgui-old/imgui.cpp
Normal file
File diff suppressed because it is too large
Load Diff
3051
tjp/core/graphics/imgui-old/imgui.h
Normal file
3051
tjp/core/graphics/imgui-old/imgui.h
Normal file
File diff suppressed because it is too large
Load Diff
4162
tjp/core/graphics/imgui-old/imgui_draw.cpp
Normal file
4162
tjp/core/graphics/imgui-old/imgui_draw.cpp
Normal file
File diff suppressed because it is too large
Load Diff
662
tjp/core/graphics/imgui-old/imgui_impl_glfw.cpp
Normal file
662
tjp/core/graphics/imgui-old/imgui_impl_glfw.cpp
Normal file
@@ -0,0 +1,662 @@
|
|||||||
|
// dear imgui: Platform Backend for GLFW
|
||||||
|
// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan, WebGPU..)
|
||||||
|
// (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
|
||||||
|
// (Requires: GLFW 3.1+)
|
||||||
|
|
||||||
|
// Implemented features:
|
||||||
|
// [X] Platform: Clipboard support.
|
||||||
|
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy GLFW_KEY_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
|
||||||
|
// [X] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
|
||||||
|
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange' (note: the resizing cursors requires GLFW 3.4+).
|
||||||
|
|
||||||
|
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||||
|
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||||
|
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||||
|
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||||
|
|
||||||
|
// CHANGELOG
|
||||||
|
// (minor and older changes stripped away, please see git history for details)
|
||||||
|
// 2022-04-30: Inputs: Fixed ImGui_ImplGlfw_TranslateUntranslatedKey() for lower case letters on OSX.
|
||||||
|
// 2022-03-23: Inputs: Fixed a regression in 1.87 which resulted in keyboard modifiers events being reported incorrectly on Linux/X11.
|
||||||
|
// 2022-02-07: Added ImGui_ImplGlfw_InstallCallbacks()/ImGui_ImplGlfw_RestoreCallbacks() helpers to facilitate user installing callbacks after initializing backend.
|
||||||
|
// 2022-01-26: Inputs: replaced short-lived io.AddKeyModsEvent() (added two weeks ago)with io.AddKeyEvent() using ImGuiKey_ModXXX flags. Sorry for the confusion.
|
||||||
|
// 2021-01-20: Inputs: calling new io.AddKeyAnalogEvent() for gamepad support, instead of writing directly to io.NavInputs[].
|
||||||
|
// 2022-01-17: Inputs: calling new io.AddMousePosEvent(), io.AddMouseButtonEvent(), io.AddMouseWheelEvent() API (1.87+).
|
||||||
|
// 2022-01-17: Inputs: always update key mods next and before key event (not in NewFrame) to fix input queue with very low framerates.
|
||||||
|
// 2022-01-12: *BREAKING CHANGE*: Now using glfwSetCursorPosCallback(). If you called ImGui_ImplGlfw_InitXXX() with install_callbacks = false, you MUST install glfwSetCursorPosCallback() and forward it to the backend via ImGui_ImplGlfw_CursorPosCallback().
|
||||||
|
// 2022-01-10: Inputs: calling new io.AddKeyEvent(), io.AddKeyModsEvent() + io.SetKeyEventNativeData() API (1.87+). Support for full ImGuiKey range.
|
||||||
|
// 2022-01-05: Inputs: Converting GLFW untranslated keycodes back to translated keycodes (in the ImGui_ImplGlfw_KeyCallback() function) in order to match the behavior of every other backend, and facilitate the use of GLFW with lettered-shortcuts API.
|
||||||
|
// 2021-08-17: *BREAKING CHANGE*: Now using glfwSetWindowFocusCallback() to calling io.AddFocusEvent(). If you called ImGui_ImplGlfw_InitXXX() with install_callbacks = false, you MUST install glfwSetWindowFocusCallback() and forward it to the backend via ImGui_ImplGlfw_WindowFocusCallback().
|
||||||
|
// 2021-07-29: *BREAKING CHANGE*: Now using glfwSetCursorEnterCallback(). MousePos is correctly reported when the host platform window is hovered but not focused. If you called ImGui_ImplGlfw_InitXXX() with install_callbacks = false, you MUST install glfwSetWindowFocusCallback() callback and forward it to the backend via ImGui_ImplGlfw_CursorEnterCallback().
|
||||||
|
// 2021-06-29: Reorganized backend to pull data from a single structure to facilitate usage with multiple-contexts (all g_XXXX access changed to bd->XXXX).
|
||||||
|
// 2020-01-17: Inputs: Disable error callback while assigning mouse cursors because some X11 setup don't have them and it generates errors.
|
||||||
|
// 2019-12-05: Inputs: Added support for new mouse cursors added in GLFW 3.4+ (resizing cursors, not allowed cursor).
|
||||||
|
// 2019-10-18: Misc: Previously installed user callbacks are now restored on shutdown.
|
||||||
|
// 2019-07-21: Inputs: Added mapping for ImGuiKey_KeyPadEnter.
|
||||||
|
// 2019-05-11: Inputs: Don't filter value from character callback before calling AddInputCharacter().
|
||||||
|
// 2019-03-12: Misc: Preserve DisplayFramebufferScale when main window is minimized.
|
||||||
|
// 2018-11-30: Misc: Setting up io.BackendPlatformName so it can be displayed in the About Window.
|
||||||
|
// 2018-11-07: Inputs: When installing our GLFW callbacks, we save user's previously installed ones - if any - and chain call them.
|
||||||
|
// 2018-08-01: Inputs: Workaround for Emscripten which doesn't seem to handle focus related calls.
|
||||||
|
// 2018-06-29: Inputs: Added support for the ImGuiMouseCursor_Hand cursor.
|
||||||
|
// 2018-06-08: Misc: Extracted imgui_impl_glfw.cpp/.h away from the old combined GLFW+OpenGL/Vulkan examples.
|
||||||
|
// 2018-03-20: Misc: Setup io.BackendFlags ImGuiBackendFlags_HasMouseCursors flag + honor ImGuiConfigFlags_NoMouseCursorChange flag.
|
||||||
|
// 2018-02-20: Inputs: Added support for mouse cursors (ImGui::GetMouseCursor() value, passed to glfwSetCursor()).
|
||||||
|
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
|
||||||
|
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
|
||||||
|
// 2018-01-25: Inputs: Added gamepad support if ImGuiConfigFlags_NavEnableGamepad is set.
|
||||||
|
// 2018-01-25: Inputs: Honoring the io.WantSetMousePos by repositioning the mouse (when using navigation and ImGuiConfigFlags_NavMoveMouse is set).
|
||||||
|
// 2018-01-20: Inputs: Added Horizontal Mouse Wheel support.
|
||||||
|
// 2018-01-18: Inputs: Added mapping for ImGuiKey_Insert.
|
||||||
|
// 2017-08-25: Inputs: MousePos set to -FLT_MAX,-FLT_MAX when mouse is unavailable/missing (instead of -1,-1).
|
||||||
|
// 2016-10-15: Misc: Added a void* user_data parameter to Clipboard function handlers.
|
||||||
|
|
||||||
|
#include "imgui.h"
|
||||||
|
#include "imgui_impl_glfw.h"
|
||||||
|
|
||||||
|
// Clang warnings with -Weverything
|
||||||
|
#if defined(__clang__)
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast
|
||||||
|
#pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness
|
||||||
|
#if __has_warning("-Wzero-as-null-pointer-constant")
|
||||||
|
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// GLFW
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
#ifdef _WIN32
|
||||||
|
#undef APIENTRY
|
||||||
|
#define GLFW_EXPOSE_NATIVE_WIN32
|
||||||
|
#include <GLFW/glfw3native.h> // for glfwGetWin32Window
|
||||||
|
#endif
|
||||||
|
#ifdef GLFW_RESIZE_NESW_CURSOR // Let's be nice to people who pulled GLFW between 2019-04-16 (3.4 define) and 2019-11-29 (cursors defines) // FIXME: Remove when GLFW 3.4 is released?
|
||||||
|
#define GLFW_HAS_NEW_CURSORS (GLFW_VERSION_MAJOR * 1000 + GLFW_VERSION_MINOR * 100 >= 3400) // 3.4+ GLFW_RESIZE_ALL_CURSOR, GLFW_RESIZE_NESW_CURSOR, GLFW_RESIZE_NWSE_CURSOR, GLFW_NOT_ALLOWED_CURSOR
|
||||||
|
#else
|
||||||
|
#define GLFW_HAS_NEW_CURSORS (0)
|
||||||
|
#endif
|
||||||
|
#define GLFW_HAS_GAMEPAD_API (GLFW_VERSION_MAJOR * 1000 + GLFW_VERSION_MINOR * 100 >= 3300) // 3.3+ glfwGetGamepadState() new api
|
||||||
|
#define GLFW_HAS_GET_KEY_NAME (GLFW_VERSION_MAJOR * 1000 + GLFW_VERSION_MINOR * 100 >= 3200) // 3.2+ glfwGetKeyName()
|
||||||
|
|
||||||
|
// GLFW data
|
||||||
|
enum GlfwClientApi
|
||||||
|
{
|
||||||
|
GlfwClientApi_Unknown,
|
||||||
|
GlfwClientApi_OpenGL,
|
||||||
|
GlfwClientApi_Vulkan
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ImGui_ImplGlfw_Data
|
||||||
|
{
|
||||||
|
GLFWwindow* Window;
|
||||||
|
GlfwClientApi ClientApi;
|
||||||
|
double Time;
|
||||||
|
GLFWwindow* MouseWindow;
|
||||||
|
GLFWcursor* MouseCursors[ImGuiMouseCursor_COUNT];
|
||||||
|
ImVec2 LastValidMousePos;
|
||||||
|
bool InstalledCallbacks;
|
||||||
|
|
||||||
|
// Chain GLFW callbacks: our callbacks will call the user's previously installed callbacks, if any.
|
||||||
|
GLFWwindowfocusfun PrevUserCallbackWindowFocus;
|
||||||
|
GLFWcursorposfun PrevUserCallbackCursorPos;
|
||||||
|
GLFWcursorenterfun PrevUserCallbackCursorEnter;
|
||||||
|
GLFWmousebuttonfun PrevUserCallbackMousebutton;
|
||||||
|
GLFWscrollfun PrevUserCallbackScroll;
|
||||||
|
GLFWkeyfun PrevUserCallbackKey;
|
||||||
|
GLFWcharfun PrevUserCallbackChar;
|
||||||
|
GLFWmonitorfun PrevUserCallbackMonitor;
|
||||||
|
|
||||||
|
ImGui_ImplGlfw_Data() { memset((void*)this, 0, sizeof(*this)); }
|
||||||
|
};
|
||||||
|
|
||||||
|
// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts
|
||||||
|
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
|
||||||
|
// FIXME: multi-context support is not well tested and probably dysfunctional in this backend.
|
||||||
|
// - Because glfwPollEvents() process all windows and some events may be called outside of it, you will need to register your own callbacks
|
||||||
|
// (passing install_callbacks=false in ImGui_ImplGlfw_InitXXX functions), set the current dear imgui context and then call our callbacks.
|
||||||
|
// - Otherwise we may need to store a GLFWWindow* -> ImGuiContext* map and handle this in the backend, adding a little bit of extra complexity to it.
|
||||||
|
// FIXME: some shared resources (mouse cursor shape, gamepad) are mishandled when using multi-context.
|
||||||
|
static ImGui_ImplGlfw_Data* ImGui_ImplGlfw_GetBackendData()
|
||||||
|
{
|
||||||
|
return ImGui::GetCurrentContext() ? (ImGui_ImplGlfw_Data*)ImGui::GetIO().BackendPlatformUserData : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
static const char* ImGui_ImplGlfw_GetClipboardText(void* user_data)
|
||||||
|
{
|
||||||
|
return glfwGetClipboardString((GLFWwindow*)user_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ImGui_ImplGlfw_SetClipboardText(void* user_data, const char* text)
|
||||||
|
{
|
||||||
|
glfwSetClipboardString((GLFWwindow*)user_data, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ImGuiKey ImGui_ImplGlfw_KeyToImGuiKey(int key)
|
||||||
|
{
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case GLFW_KEY_TAB: return ImGuiKey_Tab;
|
||||||
|
case GLFW_KEY_LEFT: return ImGuiKey_LeftArrow;
|
||||||
|
case GLFW_KEY_RIGHT: return ImGuiKey_RightArrow;
|
||||||
|
case GLFW_KEY_UP: return ImGuiKey_UpArrow;
|
||||||
|
case GLFW_KEY_DOWN: return ImGuiKey_DownArrow;
|
||||||
|
case GLFW_KEY_PAGE_UP: return ImGuiKey_PageUp;
|
||||||
|
case GLFW_KEY_PAGE_DOWN: return ImGuiKey_PageDown;
|
||||||
|
case GLFW_KEY_HOME: return ImGuiKey_Home;
|
||||||
|
case GLFW_KEY_END: return ImGuiKey_End;
|
||||||
|
case GLFW_KEY_INSERT: return ImGuiKey_Insert;
|
||||||
|
case GLFW_KEY_DELETE: return ImGuiKey_Delete;
|
||||||
|
case GLFW_KEY_BACKSPACE: return ImGuiKey_Backspace;
|
||||||
|
case GLFW_KEY_SPACE: return ImGuiKey_Space;
|
||||||
|
case GLFW_KEY_ENTER: return ImGuiKey_Enter;
|
||||||
|
case GLFW_KEY_ESCAPE: return ImGuiKey_Escape;
|
||||||
|
case GLFW_KEY_APOSTROPHE: return ImGuiKey_Apostrophe;
|
||||||
|
case GLFW_KEY_COMMA: return ImGuiKey_Comma;
|
||||||
|
case GLFW_KEY_MINUS: return ImGuiKey_Minus;
|
||||||
|
case GLFW_KEY_PERIOD: return ImGuiKey_Period;
|
||||||
|
case GLFW_KEY_SLASH: return ImGuiKey_Slash;
|
||||||
|
case GLFW_KEY_SEMICOLON: return ImGuiKey_Semicolon;
|
||||||
|
case GLFW_KEY_EQUAL: return ImGuiKey_Equal;
|
||||||
|
case GLFW_KEY_LEFT_BRACKET: return ImGuiKey_LeftBracket;
|
||||||
|
case GLFW_KEY_BACKSLASH: return ImGuiKey_Backslash;
|
||||||
|
case GLFW_KEY_RIGHT_BRACKET: return ImGuiKey_RightBracket;
|
||||||
|
case GLFW_KEY_GRAVE_ACCENT: return ImGuiKey_GraveAccent;
|
||||||
|
case GLFW_KEY_CAPS_LOCK: return ImGuiKey_CapsLock;
|
||||||
|
case GLFW_KEY_SCROLL_LOCK: return ImGuiKey_ScrollLock;
|
||||||
|
case GLFW_KEY_NUM_LOCK: return ImGuiKey_NumLock;
|
||||||
|
case GLFW_KEY_PRINT_SCREEN: return ImGuiKey_PrintScreen;
|
||||||
|
case GLFW_KEY_PAUSE: return ImGuiKey_Pause;
|
||||||
|
case GLFW_KEY_KP_0: return ImGuiKey_Keypad0;
|
||||||
|
case GLFW_KEY_KP_1: return ImGuiKey_Keypad1;
|
||||||
|
case GLFW_KEY_KP_2: return ImGuiKey_Keypad2;
|
||||||
|
case GLFW_KEY_KP_3: return ImGuiKey_Keypad3;
|
||||||
|
case GLFW_KEY_KP_4: return ImGuiKey_Keypad4;
|
||||||
|
case GLFW_KEY_KP_5: return ImGuiKey_Keypad5;
|
||||||
|
case GLFW_KEY_KP_6: return ImGuiKey_Keypad6;
|
||||||
|
case GLFW_KEY_KP_7: return ImGuiKey_Keypad7;
|
||||||
|
case GLFW_KEY_KP_8: return ImGuiKey_Keypad8;
|
||||||
|
case GLFW_KEY_KP_9: return ImGuiKey_Keypad9;
|
||||||
|
case GLFW_KEY_KP_DECIMAL: return ImGuiKey_KeypadDecimal;
|
||||||
|
case GLFW_KEY_KP_DIVIDE: return ImGuiKey_KeypadDivide;
|
||||||
|
case GLFW_KEY_KP_MULTIPLY: return ImGuiKey_KeypadMultiply;
|
||||||
|
case GLFW_KEY_KP_SUBTRACT: return ImGuiKey_KeypadSubtract;
|
||||||
|
case GLFW_KEY_KP_ADD: return ImGuiKey_KeypadAdd;
|
||||||
|
case GLFW_KEY_KP_ENTER: return ImGuiKey_KeypadEnter;
|
||||||
|
case GLFW_KEY_KP_EQUAL: return ImGuiKey_KeypadEqual;
|
||||||
|
case GLFW_KEY_LEFT_SHIFT: return ImGuiKey_LeftShift;
|
||||||
|
case GLFW_KEY_LEFT_CONTROL: return ImGuiKey_LeftCtrl;
|
||||||
|
case GLFW_KEY_LEFT_ALT: return ImGuiKey_LeftAlt;
|
||||||
|
case GLFW_KEY_LEFT_SUPER: return ImGuiKey_LeftSuper;
|
||||||
|
case GLFW_KEY_RIGHT_SHIFT: return ImGuiKey_RightShift;
|
||||||
|
case GLFW_KEY_RIGHT_CONTROL: return ImGuiKey_RightCtrl;
|
||||||
|
case GLFW_KEY_RIGHT_ALT: return ImGuiKey_RightAlt;
|
||||||
|
case GLFW_KEY_RIGHT_SUPER: return ImGuiKey_RightSuper;
|
||||||
|
case GLFW_KEY_MENU: return ImGuiKey_Menu;
|
||||||
|
case GLFW_KEY_0: return ImGuiKey_0;
|
||||||
|
case GLFW_KEY_1: return ImGuiKey_1;
|
||||||
|
case GLFW_KEY_2: return ImGuiKey_2;
|
||||||
|
case GLFW_KEY_3: return ImGuiKey_3;
|
||||||
|
case GLFW_KEY_4: return ImGuiKey_4;
|
||||||
|
case GLFW_KEY_5: return ImGuiKey_5;
|
||||||
|
case GLFW_KEY_6: return ImGuiKey_6;
|
||||||
|
case GLFW_KEY_7: return ImGuiKey_7;
|
||||||
|
case GLFW_KEY_8: return ImGuiKey_8;
|
||||||
|
case GLFW_KEY_9: return ImGuiKey_9;
|
||||||
|
case GLFW_KEY_A: return ImGuiKey_A;
|
||||||
|
case GLFW_KEY_B: return ImGuiKey_B;
|
||||||
|
case GLFW_KEY_C: return ImGuiKey_C;
|
||||||
|
case GLFW_KEY_D: return ImGuiKey_D;
|
||||||
|
case GLFW_KEY_E: return ImGuiKey_E;
|
||||||
|
case GLFW_KEY_F: return ImGuiKey_F;
|
||||||
|
case GLFW_KEY_G: return ImGuiKey_G;
|
||||||
|
case GLFW_KEY_H: return ImGuiKey_H;
|
||||||
|
case GLFW_KEY_I: return ImGuiKey_I;
|
||||||
|
case GLFW_KEY_J: return ImGuiKey_J;
|
||||||
|
case GLFW_KEY_K: return ImGuiKey_K;
|
||||||
|
case GLFW_KEY_L: return ImGuiKey_L;
|
||||||
|
case GLFW_KEY_M: return ImGuiKey_M;
|
||||||
|
case GLFW_KEY_N: return ImGuiKey_N;
|
||||||
|
case GLFW_KEY_O: return ImGuiKey_O;
|
||||||
|
case GLFW_KEY_P: return ImGuiKey_P;
|
||||||
|
case GLFW_KEY_Q: return ImGuiKey_Q;
|
||||||
|
case GLFW_KEY_R: return ImGuiKey_R;
|
||||||
|
case GLFW_KEY_S: return ImGuiKey_S;
|
||||||
|
case GLFW_KEY_T: return ImGuiKey_T;
|
||||||
|
case GLFW_KEY_U: return ImGuiKey_U;
|
||||||
|
case GLFW_KEY_V: return ImGuiKey_V;
|
||||||
|
case GLFW_KEY_W: return ImGuiKey_W;
|
||||||
|
case GLFW_KEY_X: return ImGuiKey_X;
|
||||||
|
case GLFW_KEY_Y: return ImGuiKey_Y;
|
||||||
|
case GLFW_KEY_Z: return ImGuiKey_Z;
|
||||||
|
case GLFW_KEY_F1: return ImGuiKey_F1;
|
||||||
|
case GLFW_KEY_F2: return ImGuiKey_F2;
|
||||||
|
case GLFW_KEY_F3: return ImGuiKey_F3;
|
||||||
|
case GLFW_KEY_F4: return ImGuiKey_F4;
|
||||||
|
case GLFW_KEY_F5: return ImGuiKey_F5;
|
||||||
|
case GLFW_KEY_F6: return ImGuiKey_F6;
|
||||||
|
case GLFW_KEY_F7: return ImGuiKey_F7;
|
||||||
|
case GLFW_KEY_F8: return ImGuiKey_F8;
|
||||||
|
case GLFW_KEY_F9: return ImGuiKey_F9;
|
||||||
|
case GLFW_KEY_F10: return ImGuiKey_F10;
|
||||||
|
case GLFW_KEY_F11: return ImGuiKey_F11;
|
||||||
|
case GLFW_KEY_F12: return ImGuiKey_F12;
|
||||||
|
default: return ImGuiKey_None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ImGui_ImplGlfw_KeyToModifier(int key)
|
||||||
|
{
|
||||||
|
if (key == GLFW_KEY_LEFT_CONTROL || key == GLFW_KEY_RIGHT_CONTROL)
|
||||||
|
return GLFW_MOD_CONTROL;
|
||||||
|
if (key == GLFW_KEY_LEFT_SHIFT || key == GLFW_KEY_RIGHT_SHIFT)
|
||||||
|
return GLFW_MOD_SHIFT;
|
||||||
|
if (key == GLFW_KEY_LEFT_ALT || key == GLFW_KEY_RIGHT_ALT)
|
||||||
|
return GLFW_MOD_ALT;
|
||||||
|
if (key == GLFW_KEY_LEFT_SUPER || key == GLFW_KEY_RIGHT_SUPER)
|
||||||
|
return GLFW_MOD_SUPER;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ImGui_ImplGlfw_UpdateKeyModifiers(int mods)
|
||||||
|
{
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
io.AddKeyEvent(ImGuiKey_ModCtrl, (mods & GLFW_MOD_CONTROL) != 0);
|
||||||
|
io.AddKeyEvent(ImGuiKey_ModShift, (mods & GLFW_MOD_SHIFT) != 0);
|
||||||
|
io.AddKeyEvent(ImGuiKey_ModAlt, (mods & GLFW_MOD_ALT) != 0);
|
||||||
|
io.AddKeyEvent(ImGuiKey_ModSuper, (mods & GLFW_MOD_SUPER) != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods)
|
||||||
|
{
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
if (bd->PrevUserCallbackMousebutton != NULL && window == bd->Window)
|
||||||
|
bd->PrevUserCallbackMousebutton(window, button, action, mods);
|
||||||
|
|
||||||
|
ImGui_ImplGlfw_UpdateKeyModifiers(mods);
|
||||||
|
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
if (button >= 0 && button < ImGuiMouseButton_COUNT)
|
||||||
|
io.AddMouseButtonEvent(button, action == GLFW_PRESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset)
|
||||||
|
{
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
if (bd->PrevUserCallbackScroll != NULL && window == bd->Window)
|
||||||
|
bd->PrevUserCallbackScroll(window, xoffset, yoffset);
|
||||||
|
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
io.AddMouseWheelEvent((float)xoffset, (float)yoffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ImGui_ImplGlfw_TranslateUntranslatedKey(int key, int scancode)
|
||||||
|
{
|
||||||
|
#if GLFW_HAS_GET_KEY_NAME && !defined(__EMSCRIPTEN__)
|
||||||
|
// GLFW 3.1+ attempts to "untranslate" keys, which goes the opposite of what every other framework does, making using lettered shortcuts difficult.
|
||||||
|
// (It had reasons to do so: namely GLFW is/was more likely to be used for WASD-type game controls rather than lettered shortcuts, but IHMO the 3.1 change could have been done differently)
|
||||||
|
// See https://github.com/glfw/glfw/issues/1502 for details.
|
||||||
|
// Adding a workaround to undo this (so our keys are translated->untranslated->translated, likely a lossy process).
|
||||||
|
// This won't cover edge cases but this is at least going to cover common cases.
|
||||||
|
if (key >= GLFW_KEY_KP_0 && key <= GLFW_KEY_KP_EQUAL)
|
||||||
|
return key;
|
||||||
|
const char* key_name = glfwGetKeyName(key, scancode);
|
||||||
|
if (key_name && key_name[0] != 0 && key_name[1] == 0)
|
||||||
|
{
|
||||||
|
const char char_names[] = "`-=[]\\,;\'./";
|
||||||
|
const int char_keys[] = { GLFW_KEY_GRAVE_ACCENT, GLFW_KEY_MINUS, GLFW_KEY_EQUAL, GLFW_KEY_LEFT_BRACKET, GLFW_KEY_RIGHT_BRACKET, GLFW_KEY_BACKSLASH, GLFW_KEY_COMMA, GLFW_KEY_SEMICOLON, GLFW_KEY_APOSTROPHE, GLFW_KEY_PERIOD, GLFW_KEY_SLASH, 0 };
|
||||||
|
IM_ASSERT(IM_ARRAYSIZE(char_names) == IM_ARRAYSIZE(char_keys));
|
||||||
|
if (key_name[0] >= '0' && key_name[0] <= '9') { key = GLFW_KEY_0 + (key_name[0] - '0'); }
|
||||||
|
else if (key_name[0] >= 'A' && key_name[0] <= 'Z') { key = GLFW_KEY_A + (key_name[0] - 'A'); }
|
||||||
|
else if (key_name[0] >= 'a' && key_name[0] <= 'z') { key = GLFW_KEY_A + (key_name[0] - 'a'); }
|
||||||
|
else if (const char* p = strchr(char_names, key_name[0])) { key = char_keys[p - char_names]; }
|
||||||
|
}
|
||||||
|
// if (action == GLFW_PRESS) printf("key %d scancode %d name '%s'\n", key, scancode, key_name);
|
||||||
|
#else
|
||||||
|
IM_UNUSED(scancode);
|
||||||
|
#endif
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int keycode, int scancode, int action, int mods)
|
||||||
|
{
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
if (bd->PrevUserCallbackKey != NULL && window == bd->Window)
|
||||||
|
bd->PrevUserCallbackKey(window, keycode, scancode, action, mods);
|
||||||
|
|
||||||
|
if (action != GLFW_PRESS && action != GLFW_RELEASE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Workaround: X11 does not include current pressed/released modifier key in 'mods' flags. https://github.com/glfw/glfw/issues/1630
|
||||||
|
if (int keycode_to_mod = ImGui_ImplGlfw_KeyToModifier(keycode))
|
||||||
|
mods = (action == GLFW_PRESS) ? (mods | keycode_to_mod) : (mods & ~keycode_to_mod);
|
||||||
|
ImGui_ImplGlfw_UpdateKeyModifiers(mods);
|
||||||
|
|
||||||
|
keycode = ImGui_ImplGlfw_TranslateUntranslatedKey(keycode, scancode);
|
||||||
|
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
ImGuiKey imgui_key = ImGui_ImplGlfw_KeyToImGuiKey(keycode);
|
||||||
|
io.AddKeyEvent(imgui_key, (action == GLFW_PRESS));
|
||||||
|
io.SetKeyEventNativeData(imgui_key, keycode, scancode); // To support legacy indexing (<1.87 user code)
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui_ImplGlfw_WindowFocusCallback(GLFWwindow* window, int focused)
|
||||||
|
{
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
if (bd->PrevUserCallbackWindowFocus != NULL && window == bd->Window)
|
||||||
|
bd->PrevUserCallbackWindowFocus(window, focused);
|
||||||
|
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
io.AddFocusEvent(focused != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui_ImplGlfw_CursorPosCallback(GLFWwindow* window, double x, double y)
|
||||||
|
{
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
if (bd->PrevUserCallbackCursorPos != NULL && window == bd->Window)
|
||||||
|
bd->PrevUserCallbackCursorPos(window, x, y);
|
||||||
|
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
io.AddMousePosEvent((float)x, (float)y);
|
||||||
|
bd->LastValidMousePos = ImVec2((float)x, (float)y);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Workaround: X11 seems to send spurious Leave/Enter events which would make us lose our position,
|
||||||
|
// so we back it up and restore on Leave/Enter (see https://github.com/ocornut/imgui/issues/4984)
|
||||||
|
void ImGui_ImplGlfw_CursorEnterCallback(GLFWwindow* window, int entered)
|
||||||
|
{
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
if (bd->PrevUserCallbackCursorEnter != NULL && window == bd->Window)
|
||||||
|
bd->PrevUserCallbackCursorEnter(window, entered);
|
||||||
|
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
if (entered)
|
||||||
|
{
|
||||||
|
bd->MouseWindow = window;
|
||||||
|
io.AddMousePosEvent(bd->LastValidMousePos.x, bd->LastValidMousePos.y);
|
||||||
|
}
|
||||||
|
else if (!entered && bd->MouseWindow == window)
|
||||||
|
{
|
||||||
|
bd->LastValidMousePos = io.MousePos;
|
||||||
|
bd->MouseWindow = NULL;
|
||||||
|
io.AddMousePosEvent(-FLT_MAX, -FLT_MAX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c)
|
||||||
|
{
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
if (bd->PrevUserCallbackChar != NULL && window == bd->Window)
|
||||||
|
bd->PrevUserCallbackChar(window, c);
|
||||||
|
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
io.AddInputCharacter(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui_ImplGlfw_MonitorCallback(GLFWmonitor*, int)
|
||||||
|
{
|
||||||
|
// Unused in 'master' branch but 'docking' branch will use this, so we declare it ahead of it so if you have to install callbacks you can install this one too.
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui_ImplGlfw_InstallCallbacks(GLFWwindow* window)
|
||||||
|
{
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
IM_ASSERT(bd->InstalledCallbacks == false && "Callbacks already installed!");
|
||||||
|
IM_ASSERT(bd->Window == window);
|
||||||
|
|
||||||
|
bd->PrevUserCallbackWindowFocus = glfwSetWindowFocusCallback(window, ImGui_ImplGlfw_WindowFocusCallback);
|
||||||
|
bd->PrevUserCallbackCursorEnter = glfwSetCursorEnterCallback(window, ImGui_ImplGlfw_CursorEnterCallback);
|
||||||
|
bd->PrevUserCallbackCursorPos = glfwSetCursorPosCallback(window, ImGui_ImplGlfw_CursorPosCallback);
|
||||||
|
bd->PrevUserCallbackMousebutton = glfwSetMouseButtonCallback(window, ImGui_ImplGlfw_MouseButtonCallback);
|
||||||
|
bd->PrevUserCallbackScroll = glfwSetScrollCallback(window, ImGui_ImplGlfw_ScrollCallback);
|
||||||
|
bd->PrevUserCallbackKey = glfwSetKeyCallback(window, ImGui_ImplGlfw_KeyCallback);
|
||||||
|
bd->PrevUserCallbackChar = glfwSetCharCallback(window, ImGui_ImplGlfw_CharCallback);
|
||||||
|
bd->PrevUserCallbackMonitor = glfwSetMonitorCallback(ImGui_ImplGlfw_MonitorCallback);
|
||||||
|
bd->InstalledCallbacks = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui_ImplGlfw_RestoreCallbacks(GLFWwindow* window)
|
||||||
|
{
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
IM_ASSERT(bd->InstalledCallbacks == true && "Callbacks not installed!");
|
||||||
|
IM_ASSERT(bd->Window == window);
|
||||||
|
|
||||||
|
glfwSetWindowFocusCallback(window, bd->PrevUserCallbackWindowFocus);
|
||||||
|
glfwSetCursorEnterCallback(window, bd->PrevUserCallbackCursorEnter);
|
||||||
|
glfwSetCursorPosCallback(window, bd->PrevUserCallbackCursorPos);
|
||||||
|
glfwSetMouseButtonCallback(window, bd->PrevUserCallbackMousebutton);
|
||||||
|
glfwSetScrollCallback(window, bd->PrevUserCallbackScroll);
|
||||||
|
glfwSetKeyCallback(window, bd->PrevUserCallbackKey);
|
||||||
|
glfwSetCharCallback(window, bd->PrevUserCallbackChar);
|
||||||
|
glfwSetMonitorCallback(bd->PrevUserCallbackMonitor);
|
||||||
|
bd->InstalledCallbacks = false;
|
||||||
|
bd->PrevUserCallbackWindowFocus = NULL;
|
||||||
|
bd->PrevUserCallbackCursorEnter = NULL;
|
||||||
|
bd->PrevUserCallbackCursorPos = NULL;
|
||||||
|
bd->PrevUserCallbackMousebutton = NULL;
|
||||||
|
bd->PrevUserCallbackScroll = NULL;
|
||||||
|
bd->PrevUserCallbackKey = NULL;
|
||||||
|
bd->PrevUserCallbackChar = NULL;
|
||||||
|
bd->PrevUserCallbackMonitor = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, GlfwClientApi client_api)
|
||||||
|
{
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
IM_ASSERT(io.BackendPlatformUserData == NULL && "Already initialized a platform backend!");
|
||||||
|
|
||||||
|
// Setup backend capabilities flags
|
||||||
|
ImGui_ImplGlfw_Data* bd = IM_NEW(ImGui_ImplGlfw_Data)();
|
||||||
|
io.BackendPlatformUserData = (void*)bd;
|
||||||
|
io.BackendPlatformName = "imgui_impl_glfw";
|
||||||
|
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional)
|
||||||
|
io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos; // We can honor io.WantSetMousePos requests (optional, rarely used)
|
||||||
|
|
||||||
|
bd->Window = window;
|
||||||
|
bd->Time = 0.0;
|
||||||
|
|
||||||
|
io.SetClipboardTextFn = ImGui_ImplGlfw_SetClipboardText;
|
||||||
|
io.GetClipboardTextFn = ImGui_ImplGlfw_GetClipboardText;
|
||||||
|
io.ClipboardUserData = bd->Window;
|
||||||
|
|
||||||
|
// Set platform dependent data in viewport
|
||||||
|
#if defined(_WIN32)
|
||||||
|
ImGui::GetMainViewport()->PlatformHandleRaw = (void*)glfwGetWin32Window(bd->Window);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Create mouse cursors
|
||||||
|
// (By design, on X11 cursors are user configurable and some cursors may be missing. When a cursor doesn't exist,
|
||||||
|
// GLFW will emit an error which will often be printed by the app, so we temporarily disable error reporting.
|
||||||
|
// Missing cursors will return NULL and our _UpdateMouseCursor() function will use the Arrow cursor instead.)
|
||||||
|
GLFWerrorfun prev_error_callback = glfwSetErrorCallback(NULL);
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_Arrow] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_TextInput] = glfwCreateStandardCursor(GLFW_IBEAM_CURSOR);
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_ResizeNS] = glfwCreateStandardCursor(GLFW_VRESIZE_CURSOR);
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_ResizeEW] = glfwCreateStandardCursor(GLFW_HRESIZE_CURSOR);
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_Hand] = glfwCreateStandardCursor(GLFW_HAND_CURSOR);
|
||||||
|
#if GLFW_HAS_NEW_CURSORS
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_ResizeAll] = glfwCreateStandardCursor(GLFW_RESIZE_ALL_CURSOR);
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_ResizeNESW] = glfwCreateStandardCursor(GLFW_RESIZE_NESW_CURSOR);
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_ResizeNWSE] = glfwCreateStandardCursor(GLFW_RESIZE_NWSE_CURSOR);
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_NotAllowed] = glfwCreateStandardCursor(GLFW_NOT_ALLOWED_CURSOR);
|
||||||
|
#else
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_ResizeAll] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_ResizeNESW] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_ResizeNWSE] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
|
||||||
|
bd->MouseCursors[ImGuiMouseCursor_NotAllowed] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
|
||||||
|
#endif
|
||||||
|
glfwSetErrorCallback(prev_error_callback);
|
||||||
|
|
||||||
|
// Chain GLFW callbacks: our callbacks will call the user's previously installed callbacks, if any.
|
||||||
|
if (install_callbacks)
|
||||||
|
ImGui_ImplGlfw_InstallCallbacks(window);
|
||||||
|
|
||||||
|
bd->ClientApi = client_api;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callbacks)
|
||||||
|
{
|
||||||
|
return ImGui_ImplGlfw_Init(window, install_callbacks, GlfwClientApi_OpenGL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks)
|
||||||
|
{
|
||||||
|
return ImGui_ImplGlfw_Init(window, install_callbacks, GlfwClientApi_Vulkan);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window, bool install_callbacks)
|
||||||
|
{
|
||||||
|
return ImGui_ImplGlfw_Init(window, install_callbacks, GlfwClientApi_Unknown);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui_ImplGlfw_Shutdown()
|
||||||
|
{
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
IM_ASSERT(bd != NULL && "No platform backend to shutdown, or already shutdown?");
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|
||||||
|
if (bd->InstalledCallbacks)
|
||||||
|
ImGui_ImplGlfw_RestoreCallbacks(bd->Window);
|
||||||
|
|
||||||
|
for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_COUNT; cursor_n++)
|
||||||
|
glfwDestroyCursor(bd->MouseCursors[cursor_n]);
|
||||||
|
|
||||||
|
io.BackendPlatformName = NULL;
|
||||||
|
io.BackendPlatformUserData = NULL;
|
||||||
|
IM_DELETE(bd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ImGui_ImplGlfw_UpdateMouseData()
|
||||||
|
{
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
const bool is_app_focused = true;
|
||||||
|
#else
|
||||||
|
const bool is_app_focused = glfwGetWindowAttrib(bd->Window, GLFW_FOCUSED) != 0;
|
||||||
|
#endif
|
||||||
|
if (is_app_focused)
|
||||||
|
{
|
||||||
|
// (Optional) Set OS mouse position from Dear ImGui if requested (rarely used, only when ImGuiConfigFlags_NavEnableSetMousePos is enabled by user)
|
||||||
|
if (io.WantSetMousePos)
|
||||||
|
glfwSetCursorPos(bd->Window, (double)io.MousePos.x, (double)io.MousePos.y);
|
||||||
|
|
||||||
|
// (Optional) Fallback to provide mouse position when focused (ImGui_ImplGlfw_CursorPosCallback already provides this when hovered or captured)
|
||||||
|
if (is_app_focused && bd->MouseWindow == NULL)
|
||||||
|
{
|
||||||
|
double mouse_x, mouse_y;
|
||||||
|
glfwGetCursorPos(bd->Window, &mouse_x, &mouse_y);
|
||||||
|
io.AddMousePosEvent((float)mouse_x, (float)mouse_y);
|
||||||
|
bd->LastValidMousePos = ImVec2((float)mouse_x, (float)mouse_y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ImGui_ImplGlfw_UpdateMouseCursor()
|
||||||
|
{
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
if ((io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) || glfwGetInputMode(bd->Window, GLFW_CURSOR) == GLFW_CURSOR_DISABLED)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor();
|
||||||
|
if (imgui_cursor == ImGuiMouseCursor_None || io.MouseDrawCursor)
|
||||||
|
{
|
||||||
|
// Hide OS mouse cursor if imgui is drawing it or if it wants no cursor
|
||||||
|
glfwSetInputMode(bd->Window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Show OS mouse cursor
|
||||||
|
// FIXME-PLATFORM: Unfocused windows seems to fail changing the mouse cursor with GLFW 3.2, but 3.3 works here.
|
||||||
|
glfwSetCursor(bd->Window, bd->MouseCursors[imgui_cursor] ? bd->MouseCursors[imgui_cursor] : bd->MouseCursors[ImGuiMouseCursor_Arrow]);
|
||||||
|
glfwSetInputMode(bd->Window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update gamepad inputs
|
||||||
|
static inline float Saturate(float v) { return v < 0.0f ? 0.0f : v > 1.0f ? 1.0f : v; }
|
||||||
|
static void ImGui_ImplGlfw_UpdateGamepads()
|
||||||
|
{
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0) // FIXME: Technically feeding gamepad shouldn't depend on this now that they are regular inputs.
|
||||||
|
return;
|
||||||
|
|
||||||
|
io.BackendFlags &= ~ImGuiBackendFlags_HasGamepad;
|
||||||
|
#if GLFW_HAS_GAMEPAD_API
|
||||||
|
GLFWgamepadstate gamepad;
|
||||||
|
if (!glfwGetGamepadState(GLFW_JOYSTICK_1, &gamepad))
|
||||||
|
return;
|
||||||
|
#define MAP_BUTTON(KEY_NO, BUTTON_NO, _UNUSED) do { io.AddKeyEvent(KEY_NO, gamepad.buttons[BUTTON_NO] != 0); } while (0)
|
||||||
|
#define MAP_ANALOG(KEY_NO, AXIS_NO, _UNUSED, V0, V1) do { float v = gamepad.axes[AXIS_NO]; v = (v - V0) / (V1 - V0); io.AddKeyAnalogEvent(KEY_NO, v > 0.10f, Saturate(v)); } while (0)
|
||||||
|
#else
|
||||||
|
int axes_count = 0, buttons_count = 0;
|
||||||
|
const float* axes = glfwGetJoystickAxes(GLFW_JOYSTICK_1, &axes_count);
|
||||||
|
const unsigned char* buttons = glfwGetJoystickButtons(GLFW_JOYSTICK_1, &buttons_count);
|
||||||
|
if (axes_count == 0 || buttons_count == 0)
|
||||||
|
return;
|
||||||
|
#define MAP_BUTTON(KEY_NO, _UNUSED, BUTTON_NO) do { io.AddKeyEvent(KEY_NO, (buttons_count > BUTTON_NO && buttons[BUTTON_NO] == GLFW_PRESS)); } while (0)
|
||||||
|
#define MAP_ANALOG(KEY_NO, _UNUSED, AXIS_NO, V0, V1) do { float v = (axes_count > AXIS_NO) ? axes[AXIS_NO] : V0; v = (v - V0) / (V1 - V0); io.AddKeyAnalogEvent(KEY_NO, v > 0.10f, Saturate(v)); } while (0)
|
||||||
|
#endif
|
||||||
|
io.BackendFlags |= ImGuiBackendFlags_HasGamepad;
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadStart, GLFW_GAMEPAD_BUTTON_START, 7);
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadBack, GLFW_GAMEPAD_BUTTON_BACK, 6);
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadFaceLeft, GLFW_GAMEPAD_BUTTON_X, 2); // Xbox X, PS Square
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadFaceRight, GLFW_GAMEPAD_BUTTON_B, 1); // Xbox B, PS Circle
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadFaceUp, GLFW_GAMEPAD_BUTTON_Y, 3); // Xbox Y, PS Triangle
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadFaceDown, GLFW_GAMEPAD_BUTTON_A, 0); // Xbox A, PS Cross
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadDpadLeft, GLFW_GAMEPAD_BUTTON_DPAD_LEFT, 13);
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadDpadRight, GLFW_GAMEPAD_BUTTON_DPAD_RIGHT, 11);
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadDpadUp, GLFW_GAMEPAD_BUTTON_DPAD_UP, 10);
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadDpadDown, GLFW_GAMEPAD_BUTTON_DPAD_DOWN, 12);
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadL1, GLFW_GAMEPAD_BUTTON_LEFT_BUMPER, 4);
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadR1, GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER, 5);
|
||||||
|
MAP_ANALOG(ImGuiKey_GamepadL2, GLFW_GAMEPAD_AXIS_LEFT_TRIGGER, 4, -0.75f, +1.0f);
|
||||||
|
MAP_ANALOG(ImGuiKey_GamepadR2, GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER, 5, -0.75f, +1.0f);
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadL3, GLFW_GAMEPAD_BUTTON_LEFT_THUMB, 8);
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadR3, GLFW_GAMEPAD_BUTTON_RIGHT_THUMB, 9);
|
||||||
|
MAP_ANALOG(ImGuiKey_GamepadLStickLeft, GLFW_GAMEPAD_AXIS_LEFT_X, 0, -0.25f, -1.0f);
|
||||||
|
MAP_ANALOG(ImGuiKey_GamepadLStickRight, GLFW_GAMEPAD_AXIS_LEFT_X, 0, +0.25f, +1.0f);
|
||||||
|
MAP_ANALOG(ImGuiKey_GamepadLStickUp, GLFW_GAMEPAD_AXIS_LEFT_Y, 1, -0.25f, -1.0f);
|
||||||
|
MAP_ANALOG(ImGuiKey_GamepadLStickDown, GLFW_GAMEPAD_AXIS_LEFT_Y, 1, +0.25f, +1.0f);
|
||||||
|
MAP_ANALOG(ImGuiKey_GamepadRStickLeft, GLFW_GAMEPAD_AXIS_RIGHT_X, 2, -0.25f, -1.0f);
|
||||||
|
MAP_ANALOG(ImGuiKey_GamepadRStickRight, GLFW_GAMEPAD_AXIS_RIGHT_X, 2, +0.25f, +1.0f);
|
||||||
|
MAP_ANALOG(ImGuiKey_GamepadRStickUp, GLFW_GAMEPAD_AXIS_RIGHT_Y, 3, -0.25f, -1.0f);
|
||||||
|
MAP_ANALOG(ImGuiKey_GamepadRStickDown, GLFW_GAMEPAD_AXIS_RIGHT_Y, 3, +0.25f, +1.0f);
|
||||||
|
#undef MAP_BUTTON
|
||||||
|
#undef MAP_ANALOG
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui_ImplGlfw_NewFrame()
|
||||||
|
{
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
|
IM_ASSERT(bd != NULL && "Did you call ImGui_ImplGlfw_InitForXXX()?");
|
||||||
|
|
||||||
|
// Setup display size (every frame to accommodate for window resizing)
|
||||||
|
int w, h;
|
||||||
|
int display_w, display_h;
|
||||||
|
glfwGetWindowSize(bd->Window, &w, &h);
|
||||||
|
glfwGetFramebufferSize(bd->Window, &display_w, &display_h);
|
||||||
|
io.DisplaySize = ImVec2((float)w, (float)h);
|
||||||
|
if (w > 0 && h > 0)
|
||||||
|
io.DisplayFramebufferScale = ImVec2((float)display_w / (float)w, (float)display_h / (float)h);
|
||||||
|
|
||||||
|
// Setup time step
|
||||||
|
double current_time = glfwGetTime();
|
||||||
|
io.DeltaTime = bd->Time > 0.0 ? (float)(current_time - bd->Time) : (float)(1.0f / 60.0f);
|
||||||
|
bd->Time = current_time;
|
||||||
|
|
||||||
|
ImGui_ImplGlfw_UpdateMouseData();
|
||||||
|
ImGui_ImplGlfw_UpdateMouseCursor();
|
||||||
|
|
||||||
|
// Update game controllers (if enabled and available)
|
||||||
|
ImGui_ImplGlfw_UpdateGamepads();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(__clang__)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
46
tjp/core/graphics/imgui-old/imgui_impl_glfw.h
Normal file
46
tjp/core/graphics/imgui-old/imgui_impl_glfw.h
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
// dear imgui: Platform Backend for GLFW
|
||||||
|
// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan, WebGPU..)
|
||||||
|
// (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
|
||||||
|
|
||||||
|
// Implemented features:
|
||||||
|
// [X] Platform: Clipboard support.
|
||||||
|
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy GLFW_KEY_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
|
||||||
|
// [X] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
|
||||||
|
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange' (note: the resizing cursors requires GLFW 3.4+).
|
||||||
|
|
||||||
|
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||||
|
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||||
|
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||||
|
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||||
|
|
||||||
|
// About GLSL version:
|
||||||
|
// The 'glsl_version' initialization parameter defaults to "#version 150" if NULL.
|
||||||
|
// Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure!
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "imgui.h" // IMGUI_IMPL_API
|
||||||
|
|
||||||
|
struct GLFWwindow;
|
||||||
|
struct GLFWmonitor;
|
||||||
|
|
||||||
|
IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callbacks);
|
||||||
|
IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks);
|
||||||
|
IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window, bool install_callbacks);
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_Shutdown();
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_NewFrame();
|
||||||
|
|
||||||
|
// GLFW callbacks (installer)
|
||||||
|
// - When calling Init with 'install_callbacks=true': ImGui_ImplGlfw_InstallCallbacks() is called. GLFW callbacks will be installed for you. They will chain-call user's previously installed callbacks, if any.
|
||||||
|
// - When calling Init with 'install_callbacks=false': GLFW callbacks won't be installed. You will need to call individual function yourself from your own GLFW callbacks.
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_InstallCallbacks(GLFWwindow* window);
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_RestoreCallbacks(GLFWwindow* window);
|
||||||
|
|
||||||
|
// GLFW callbacks (individual callbacks to call if you didn't install callbacks)
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_WindowFocusCallback(GLFWwindow* window, int focused); // Since 1.84
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_CursorEnterCallback(GLFWwindow* window, int entered); // Since 1.84
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_CursorPosCallback(GLFWwindow* window, double x, double y); // Since 1.87
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c);
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplGlfw_MonitorCallback(GLFWmonitor* monitor, int event);
|
||||||
1537
tjp/core/graphics/imgui-old/imgui_impl_vulkan.cpp
Normal file
1537
tjp/core/graphics/imgui-old/imgui_impl_vulkan.cpp
Normal file
File diff suppressed because it is too large
Load Diff
155
tjp/core/graphics/imgui-old/imgui_impl_vulkan.h
Normal file
155
tjp/core/graphics/imgui-old/imgui_impl_vulkan.h
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
// dear imgui: Renderer Backend for Vulkan
|
||||||
|
// This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..)
|
||||||
|
|
||||||
|
// Implemented features:
|
||||||
|
// [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices.
|
||||||
|
// [!] Renderer: User texture binding. Use 'VkDescriptorSet' as ImTextureID. Read the FAQ about ImTextureID! See https://github.com/ocornut/imgui/pull/914 for discussions.
|
||||||
|
|
||||||
|
// Important: on 32-bit systems, user texture binding is only supported if your imconfig file has '#define ImTextureID ImU64'.
|
||||||
|
// See imgui_impl_vulkan.cpp file for details.
|
||||||
|
|
||||||
|
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||||
|
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||||
|
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||||
|
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||||
|
|
||||||
|
// The aim of imgui_impl_vulkan.h/.cpp is to be usable in your engine without any modification.
|
||||||
|
// IF YOU FEEL YOU NEED TO MAKE ANY CHANGE TO THIS CODE, please share them and your feedback at https://github.com/ocornut/imgui/
|
||||||
|
|
||||||
|
// Important note to the reader who wish to integrate imgui_impl_vulkan.cpp/.h in their own engine/app.
|
||||||
|
// - Common ImGui_ImplVulkan_XXX functions and structures are used to interface with imgui_impl_vulkan.cpp/.h.
|
||||||
|
// You will use those if you want to use this rendering backend in your engine/app.
|
||||||
|
// - Helper ImGui_ImplVulkanH_XXX functions and structures are only used by this example (main.cpp) and by
|
||||||
|
// the backend itself (imgui_impl_vulkan.cpp), but should PROBABLY NOT be used by your own engine/app code.
|
||||||
|
// Read comments in imgui_impl_vulkan.h.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "imgui.h" // IMGUI_IMPL_API
|
||||||
|
|
||||||
|
// [Configuration] in order to use a custom Vulkan function loader:
|
||||||
|
// (1) You'll need to disable default Vulkan function prototypes.
|
||||||
|
// We provide a '#define IMGUI_IMPL_VULKAN_NO_PROTOTYPES' convenience configuration flag.
|
||||||
|
// In order to make sure this is visible from the imgui_impl_vulkan.cpp compilation unit:
|
||||||
|
// - Add '#define IMGUI_IMPL_VULKAN_NO_PROTOTYPES' in your imconfig.h file
|
||||||
|
// - Or as a compilation flag in your build system
|
||||||
|
// - Or uncomment here (not recommended because you'd be modifying imgui sources!)
|
||||||
|
// - Do not simply add it in a .cpp file!
|
||||||
|
// (2) Call ImGui_ImplVulkan_LoadFunctions() before ImGui_ImplVulkan_Init() with your custom function.
|
||||||
|
// If you have no idea what this is, leave it alone!
|
||||||
|
//#define IMGUI_IMPL_VULKAN_NO_PROTOTYPES
|
||||||
|
|
||||||
|
// Vulkan includes
|
||||||
|
#if defined(IMGUI_IMPL_VULKAN_NO_PROTOTYPES) && !defined(VK_NO_PROTOTYPES)
|
||||||
|
#define VK_NO_PROTOTYPES
|
||||||
|
#endif
|
||||||
|
#include <vulkan/vulkan.h>
|
||||||
|
|
||||||
|
// Initialization data, for ImGui_ImplVulkan_Init()
|
||||||
|
// [Please zero-clear before use!]
|
||||||
|
struct ImGui_ImplVulkan_InitInfo
|
||||||
|
{
|
||||||
|
VkInstance Instance;
|
||||||
|
VkPhysicalDevice PhysicalDevice;
|
||||||
|
VkDevice Device;
|
||||||
|
uint32_t QueueFamily;
|
||||||
|
VkQueue Queue;
|
||||||
|
VkPipelineCache PipelineCache;
|
||||||
|
VkDescriptorPool DescriptorPool;
|
||||||
|
uint32_t Subpass;
|
||||||
|
uint32_t MinImageCount; // >= 2
|
||||||
|
uint32_t ImageCount; // >= MinImageCount
|
||||||
|
VkSampleCountFlagBits MSAASamples; // >= VK_SAMPLE_COUNT_1_BIT (0 -> default to VK_SAMPLE_COUNT_1_BIT)
|
||||||
|
const VkAllocationCallbacks* Allocator;
|
||||||
|
void (*CheckVkResultFn)(VkResult err);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Called by user code
|
||||||
|
IMGUI_IMPL_API bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info, VkRenderPass render_pass);
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplVulkan_Shutdown();
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplVulkan_NewFrame();
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer command_buffer, VkPipeline pipeline = VK_NULL_HANDLE);
|
||||||
|
IMGUI_IMPL_API bool ImGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer command_buffer);
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplVulkan_DestroyFontUploadObjects() | ||||||