Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
ofxImGui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wt
ofxImGui
Commits
a9a31eff
Commit
a9a31eff
authored
Dec 08, 2019
by
w4t
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ofximguiparameter updated
parent
773570e5
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
777 additions
and
72 deletions
+777
-72
example-demo-vs15.sln
example-demo-parameter/example-demo-vs15.sln
+40
-0
example-demo-vs15.vcxproj
example-demo-parameter/example-demo-vs15.vcxproj
+232
-0
example-demo-vs15.vcxproj.filters
example-demo-parameter/example-demo-vs15.vcxproj.filters
+129
-0
example-demo-vs15.vcxproj.user
example-demo-parameter/example-demo-vs15.vcxproj.user
+19
-0
example-demo.vcxproj
example-demo-parameter/example-demo.vcxproj
+0
-6
example-demo.vcxproj.filters
example-demo-parameter/example-demo.vcxproj.filters
+0
-27
ofApp.cpp
example-demo-parameter/src/ofApp.cpp
+1
-1
ofxImGuiParameter.cpp
src/ofxImGuiParameter.cpp
+331
-31
ofxImGuiParameter.h
src/ofxImGuiParameter.h
+25
-7
No files found.
example-demo-parameter/example-demo-vs15.sln
0 → 100644
View file @
a9a31eff
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example-demo-vs15", "example-demo-vs15.vcxproj", "{7FD42DF7-442E-479A-BA76-D0022F99702A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openframeworksLib", "..\..\..\libs\openFrameworksCompiled\project\vs\openframeworksLib.vcxproj", "{5837595D-ACA9-485C-8E76-729040CE4B0B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|Win32.ActiveCfg = Debug|Win32
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|Win32.Build.0 = Debug|Win32
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|x64.ActiveCfg = Debug|x64
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|x64.Build.0 = Debug|x64
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|Win32.ActiveCfg = Release|Win32
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|Win32.Build.0 = Release|Win32
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|x64.ActiveCfg = Release|x64
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|x64.Build.0 = Release|x64
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|Win32.ActiveCfg = Debug|Win32
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|Win32.Build.0 = Debug|Win32
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|x64.ActiveCfg = Debug|x64
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|x64.Build.0 = Debug|x64
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|Win32.ActiveCfg = Release|Win32
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|Win32.Build.0 = Release|Win32
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|x64.ActiveCfg = Release|x64
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {96BED2B0-8461-46E3-B93E-10C906D17E94}
EndGlobalSection
EndGlobal
example-demo-parameter/example-demo-vs15.vcxproj
0 → 100644
View file @
a9a31eff
<?xml version="1.0" encoding="utf-8"?>
<Project
DefaultTargets=
"Build"
ToolsVersion=
"15.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<ItemGroup
Label=
"ProjectConfigurations"
>
<ProjectConfiguration
Include=
"Debug|Win32"
>
<Configuration>
Debug
</Configuration>
<Platform>
Win32
</Platform>
</ProjectConfiguration>
<ProjectConfiguration
Include=
"Debug|x64"
>
<Configuration>
Debug
</Configuration>
<Platform>
x64
</Platform>
</ProjectConfiguration>
<ProjectConfiguration
Include=
"Release|Win32"
>
<Configuration>
Release
</Configuration>
<Platform>
Win32
</Platform>
</ProjectConfiguration>
<ProjectConfiguration
Include=
"Release|x64"
>
<Configuration>
Release
</Configuration>
<Platform>
x64
</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup
Label=
"Globals"
>
<ProjectGuid>
{7FD42DF7-442E-479A-BA76-D0022F99702A}
</ProjectGuid>
<Keyword>
Win32Proj
</Keyword>
<RootNamespace>
example-demo
</RootNamespace>
<WindowsTargetPlatformVersion>
10.0.17134.0
</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.Default.props"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label=
"Configuration"
>
<ConfigurationType>
Application
</ConfigurationType>
<CharacterSet>
Unicode
</CharacterSet>
<PlatformToolset>
v141
</PlatformToolset>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
Label=
"Configuration"
>
<ConfigurationType>
Application
</ConfigurationType>
<CharacterSet>
Unicode
</CharacterSet>
<PlatformToolset>
v141
</PlatformToolset>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
Label=
"Configuration"
>
<ConfigurationType>
Application
</ConfigurationType>
<CharacterSet>
Unicode
</CharacterSet>
<WholeProgramOptimization>
true
</WholeProgramOptimization>
<PlatformToolset>
v141
</PlatformToolset>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
Label=
"Configuration"
>
<ConfigurationType>
Application
</ConfigurationType>
<CharacterSet>
Unicode
</CharacterSet>
<WholeProgramOptimization>
true
</WholeProgramOptimization>
<PlatformToolset>
v141
</PlatformToolset>
</PropertyGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.props"
/>
<ImportGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
Label=
"PropertySheets"
>
<Import
Project=
"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition=
"exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label=
"LocalAppDataPlatform"
/>
<Import
Project=
"..\..\..\libs\openFrameworksCompiled\project\vs\openFrameworksRelease.props"
/>
<Import
Project=
"..\ofxImGui.props"
/>
</ImportGroup>
<ImportGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
Label=
"PropertySheets"
>
<Import
Project=
"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition=
"exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label=
"LocalAppDataPlatform"
/>
<Import
Project=
"..\..\..\libs\openFrameworksCompiled\project\vs\openFrameworksRelease.props"
/>
<Import
Project=
"..\ofxImGui.props"
/>
</ImportGroup>
<ImportGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label=
"PropertySheets"
>
<Import
Project=
"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition=
"exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label=
"LocalAppDataPlatform"
/>
<Import
Project=
"..\..\..\libs\openFrameworksCompiled\project\vs\openFrameworksDebug.props"
/>
<Import
Project=
"..\ofxImGui.props"
/>
</ImportGroup>
<ImportGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
Label=
"PropertySheets"
>
<Import
Project=
"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition=
"exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label=
"LocalAppDataPlatform"
/>
<Import
Project=
"..\..\..\libs\openFrameworksCompiled\project\vs\openFrameworksDebug.props"
/>
<Import
Project=
"..\ofxImGui.props"
/>
</ImportGroup>
<PropertyGroup
Label=
"UserMacros"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
<OutDir>
bin\
</OutDir>
<IntDir>
obj\$(Configuration)\
</IntDir>
<TargetName>
$(ProjectName)_debug
</TargetName>
<LinkIncremental>
true
</LinkIncremental>
<GenerateManifest>
true
</GenerateManifest>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
<OutDir>
bin\
</OutDir>
<IntDir>
obj\$(Configuration)\
</IntDir>
<TargetName>
$(ProjectName)_debug
</TargetName>
<LinkIncremental>
true
</LinkIncremental>
<GenerateManifest>
true
</GenerateManifest>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
<OutDir>
bin\
</OutDir>
<IntDir>
obj\$(Configuration)\
</IntDir>
<LinkIncremental>
false
</LinkIncremental>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
<OutDir>
bin\
</OutDir>
<IntDir>
obj\$(Configuration)\
</IntDir>
<LinkIncremental>
false
</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
<ClCompile>
<Optimization>
Disabled
</Optimization>
<BasicRuntimeChecks>
EnableFastChecks
</BasicRuntimeChecks>
<PreprocessorDefinitions>
%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreadedDebugDLL
</RuntimeLibrary>
<WarningLevel>
Level3
</WarningLevel>
<AdditionalIncludeDirectories>
%(AdditionalIncludeDirectories);src
</AdditionalIncludeDirectories>
<CompileAs>
CompileAsCpp
</CompileAs>
</ClCompile>
<Link>
<GenerateDebugInformation>
true
</GenerateDebugInformation>
<SubSystem>
Console
</SubSystem>
<RandomizedBaseAddress>
false
</RandomizedBaseAddress>
<AdditionalDependencies>
%(AdditionalDependencies)
</AdditionalDependencies>
<AdditionalLibraryDirectories>
%(AdditionalLibraryDirectories)
</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent
/>
</ItemDefinitionGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
<ClCompile>
<Optimization>
Disabled
</Optimization>
<BasicRuntimeChecks>
EnableFastChecks
</BasicRuntimeChecks>
<PreprocessorDefinitions>
%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreadedDebugDLL
</RuntimeLibrary>
<WarningLevel>
Level3
</WarningLevel>
<AdditionalIncludeDirectories>
%(AdditionalIncludeDirectories);src
</AdditionalIncludeDirectories>
<CompileAs>
CompileAsCpp
</CompileAs>
<MultiProcessorCompilation>
true
</MultiProcessorCompilation>
</ClCompile>
<Link>
<GenerateDebugInformation>
true
</GenerateDebugInformation>
<SubSystem>
Console
</SubSystem>
<RandomizedBaseAddress>
false
</RandomizedBaseAddress>
<AdditionalDependencies>
%(AdditionalDependencies)
</AdditionalDependencies>
<AdditionalLibraryDirectories>
%(AdditionalLibraryDirectories)
</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent
/>
</ItemDefinitionGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
<ClCompile>
<WholeProgramOptimization>
false
</WholeProgramOptimization>
<PreprocessorDefinitions>
%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreadedDLL
</RuntimeLibrary>
<WarningLevel>
Level3
</WarningLevel>
<AdditionalIncludeDirectories>
%(AdditionalIncludeDirectories);src
</AdditionalIncludeDirectories>
<CompileAs>
CompileAsCpp
</CompileAs>
<MultiProcessorCompilation>
true
</MultiProcessorCompilation>
</ClCompile>
<Link>
<IgnoreAllDefaultLibraries>
false
</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>
false
</GenerateDebugInformation>
<SubSystem>
Console
</SubSystem>
<OptimizeReferences>
true
</OptimizeReferences>
<EnableCOMDATFolding>
true
</EnableCOMDATFolding>
<RandomizedBaseAddress>
false
</RandomizedBaseAddress>
<AdditionalDependencies>
%(AdditionalDependencies)
</AdditionalDependencies>
<AdditionalLibraryDirectories>
%(AdditionalLibraryDirectories)
</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent
/>
</ItemDefinitionGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
<ClCompile>
<WholeProgramOptimization>
false
</WholeProgramOptimization>
<PreprocessorDefinitions>
%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreadedDLL
</RuntimeLibrary>
<WarningLevel>
Level3
</WarningLevel>
<AdditionalIncludeDirectories>
%(AdditionalIncludeDirectories);src
</AdditionalIncludeDirectories>
<CompileAs>
CompileAsCpp
</CompileAs>
</ClCompile>
<Link>
<IgnoreAllDefaultLibraries>
false
</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>
false
</GenerateDebugInformation>
<SubSystem>
Console
</SubSystem>
<OptimizeReferences>
true
</OptimizeReferences>
<EnableCOMDATFolding>
true
</EnableCOMDATFolding>
<RandomizedBaseAddress>
false
</RandomizedBaseAddress>
<AdditionalDependencies>
%(AdditionalDependencies)
</AdditionalDependencies>
<AdditionalLibraryDirectories>
%(AdditionalLibraryDirectories)
</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent
/>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\imgui.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\imgui_demo.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\imgui_draw.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\BaseEngine.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\BaseTheme.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\EngineGLFW.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\EngineOpenGLES.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\EngineVk.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\Gui.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\Helpers.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\ofxImGuiLoggerChannel.cpp"
/>
<ClCompile
Include=
"..\src\ofxImGuiParameter.cpp"
/>
<ClCompile
Include=
"src\main.cpp"
/>
<ClCompile
Include=
"src\ofApp.cpp"
/>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\imgui.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\imgui_internal.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\stb_rect_pack.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\stb_textedit.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\stb_truetype.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\BaseEngine.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\BaseTheme.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\EngineGLFW.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\EngineOpenGLES.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\EngineVk.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\Gui.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\Helpers.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\imconfig.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\ofxImGui.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\ofxImGuiLoggerChannel.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\ThemeTest.h"
/>
<ClInclude
Include=
"..\src\ofxImGuiParameter.h"
/>
<ClInclude
Include=
"src\ofApp.h"
/>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"$(OF_ROOT)\libs\openFrameworksCompiled\project\vs\openframeworksLib.vcxproj"
>
<Project>
{5837595d-aca9-485c-8e76-729040ce4b0b}
</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ResourceCompile
Include=
"icon.rc"
>
<AdditionalOptions
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
/D_DEBUG %(AdditionalOptions)
</AdditionalOptions>
<AdditionalOptions
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
/D_DEBUG %(AdditionalOptions)
</AdditionalOptions>
<AdditionalIncludeDirectories>
$(OF_ROOT)\libs\openFrameworksCompiled\project\vs
</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.targets"
/>
<ProjectExtensions>
<VisualStudio>
<UserProperties
RESOURCE_FILE=
"icon.rc"
/>
</VisualStudio>
</ProjectExtensions>
</Project>
\ No newline at end of file
example-demo-parameter/example-demo-vs15.vcxproj.filters
0 → 100644
View file @
a9a31eff
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"4.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<ItemGroup>
<ClCompile
Include=
"src\ofApp.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"src\main.cpp"
>
<Filter>
src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\BaseEngine.cpp"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\BaseTheme.cpp"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\EngineGLFW.cpp"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\EngineOpenGLES.cpp"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\EngineVk.cpp"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\Gui.cpp"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\Helpers.cpp"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\ofxImGuiLoggerChannel.cpp"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\imgui.cpp"
>
<Filter>
addons\ofxImGui\libs\imgui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\imgui_demo.cpp"
>
<Filter>
addons\ofxImGui\libs\imgui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\imgui_draw.cpp"
>
<Filter>
addons\ofxImGui\libs\imgui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\src\ofxImGuiParameter.cpp"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter
Include=
"src"
>
<UniqueIdentifier>
{d8376475-7454-4a24-b08a-aac121d3ad6f}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"addons"
>
<UniqueIdentifier>
{28ffe0cb-68db-40d6-8329-04737a7affbf}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"addons\ofxImGui"
>
<UniqueIdentifier>
{dcc9c4af-bef7-4265-b417-a45ca72fa260}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"addons\ofxImGui\src"
>
<UniqueIdentifier>
{675a7735-f61c-4303-9202-fdb961ac7e7d}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"addons\ofxImGui\libs"
>
<UniqueIdentifier>
{78d3b44c-5e14-444c-8348-1ae731156e82}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"addons\ofxImGui\libs\imgui"
>
<UniqueIdentifier>
{2cbf7f2d-745b-44c0-8011-e1f839e79872}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"addons\ofxImGui\libs\imgui\src"
>
<UniqueIdentifier>
{8f90a1fe-50e5-469a-8d64-01e8f2dc99e6}
</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"src\ofApp.h"
>
<Filter>
src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\BaseEngine.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\BaseTheme.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\EngineGLFW.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\EngineOpenGLES.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\EngineVk.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\Gui.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\Helpers.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\imconfig.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\ofxImGui.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\ofxImGuiLoggerChannel.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\ThemeTest.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\imgui.h"
>
<Filter>
addons\ofxImGui\libs\imgui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\imgui_internal.h"
>
<Filter>
addons\ofxImGui\libs\imgui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\stb_rect_pack.h"
>
<Filter>
addons\ofxImGui\libs\imgui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\stb_textedit.h"
>
<Filter>
addons\ofxImGui\libs\imgui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\stb_truetype.h"
>
<Filter>
addons\ofxImGui\libs\imgui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\src\ofxImGuiParameter.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile
Include=
"icon.rc"
/>
</ItemGroup>
</Project>
\ No newline at end of file
example-demo-parameter/example-demo-vs15.vcxproj.user
0 → 100644
View file @
a9a31eff
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"4.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
<LocalDebuggerWorkingDirectory>
$(ProjectDir)/bin
</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>
WindowsLocalDebugger
</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
<LocalDebuggerWorkingDirectory>
$(ProjectDir)/bin
</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>
WindowsLocalDebugger
</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
<LocalDebuggerWorkingDirectory>
$(ProjectDir)/bin
</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>
WindowsLocalDebugger
</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
<LocalDebuggerWorkingDirectory>
$(ProjectDir)/bin
</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>
WindowsLocalDebugger
</DebuggerFlavor>
</PropertyGroup>
</Project>
\ No newline at end of file
example-demo-parameter/example-demo.vcxproj
View file @
a9a31eff
...
...
@@ -186,10 +186,6 @@
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\Gui.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\Helpers.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxImGui\src\ofxImGuiLoggerChannel.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxXmlSettings\libs\tinyxml.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxXmlSettings\libs\tinyxmlerror.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxXmlSettings\libs\tinyxmlparser.cpp"
/>
<ClCompile
Include=
"..\..\..\addons\ofxXmlSettings\src\ofxXmlSettings.cpp"
/>
<ClCompile
Include=
"..\src\ofxImGuiParameter.cpp"
/>
<ClCompile
Include=
"src\main.cpp"
/>
<ClCompile
Include=
"src\ofApp.cpp"
/>
...
...
@@ -211,8 +207,6 @@
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\ofxImGui.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\ofxImGuiLoggerChannel.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxImGui\src\ThemeTest.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxXmlSettings\libs\tinyxml.h"
/>
<ClInclude
Include=
"..\..\..\addons\ofxXmlSettings\src\ofxXmlSettings.h"
/>
<ClInclude
Include=
"..\src\ofxImGuiParameter.h"
/>
<ClInclude
Include=
"src\ofApp.h"
/>
</ItemGroup>
...
...
example-demo-parameter/example-demo.vcxproj.filters
View file @
a9a31eff
...
...
@@ -40,18 +40,6 @@
<ClCompile
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\imgui_draw.cpp"
>
<Filter>
addons\ofxImGui\libs\imgui\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxXmlSettings\src\ofxXmlSettings.cpp"
>
<Filter>
addons\ofxXmlSettings\src
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxXmlSettings\libs\tinyxml.cpp"
>
<Filter>
addons\ofxXmlSettings\libs
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxXmlSettings\libs\tinyxmlerror.cpp"
>
<Filter>
addons\ofxXmlSettings\libs
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\..\addons\ofxXmlSettings\libs\tinyxmlparser.cpp"
>
<Filter>
addons\ofxXmlSettings\libs
</Filter>
</ClCompile>
<ClCompile
Include=
"..\src\ofxImGuiParameter.cpp"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClCompile>
...
...
@@ -78,15 +66,6 @@
<Filter
Include=
"addons\ofxImGui\libs\imgui\src"
>
<UniqueIdentifier>
{8f90a1fe-50e5-469a-8d64-01e8f2dc99e6}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"addons\ofxXmlSettings"
>
<UniqueIdentifier>
{e3c17501-f1d7-41db-841a-0d473deb6dc0}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"addons\ofxXmlSettings\src"
>
<UniqueIdentifier>
{709ac37c-8237-4a77-a87c-0bcd4df04f88}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"addons\ofxXmlSettings\libs"
>
<UniqueIdentifier>
{4f8472aa-8de3-4dc4-812e-eac04a9bd339}
</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"src\ofApp.h"
>
...
...
@@ -140,12 +119,6 @@
<ClInclude
Include=
"..\..\..\addons\ofxImGui\libs\imgui\src\stb_truetype.h"
>
<Filter>
addons\ofxImGui\libs\imgui\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxXmlSettings\src\ofxXmlSettings.h"
>
<Filter>
addons\ofxXmlSettings\src
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\..\addons\ofxXmlSettings\libs\tinyxml.h"
>
<Filter>
addons\ofxXmlSettings\libs
</Filter>
</ClInclude>
<ClInclude
Include=
"..\src\ofxImGuiParameter.h"
>
<Filter>
addons\ofxImGui\src
</Filter>
</ClInclude>
...
...
example-demo-parameter/src/ofApp.cpp
View file @
a9a31eff
...
...
@@ -3,7 +3,7 @@
//--------------------------------------------------------------
void
ofApp
::
setup
()
{
ofSetLogLevel
(
OF_LOG_VERBOSE
);
//
ofSetLogLevel(OF_LOG_VERBOSE);
m_background_color
.
setName
(
"Background Color"
);
m_background_color
.
set
(
ofColor
(
114
,
144
,
154
));
...
...
src/ofxImGuiParameter.cpp
View file @
a9a31eff
/*
The78ester
*/
#include <ofxImGui.h>
#include "ofxImGuiParameter.h"
#include "ofXml.h"
#if
1
#if
0
#include <ofxXmlSettings.h>
#else
typedef
class
ofxXmlSettings2ofXml
{
public:
#if OF_VERSION_MINOR >= 10
ofxXmlSettings2ofXml
()
{
m_stack
.
push_back
(
m_xml
);
}
#endif
bool
load
(
std
::
string
const
&
p
)
{
bool
yes
=
m_xml
.
load
(
p
);
#if OF_VERSION_MINOR < 10
if
(
yes
)
{
m_xml
.
setToParent
();
...
...
@@ -20,6 +32,11 @@ public:
{
m_xml
.
clear
();
}
#else
m_stack
.
clear
();
m_stack
.
push_back
(
m_xml
);
#endif
return
yes
;
}
...
...
@@ -30,44 +47,89 @@ public:
bool
tagExists
(
std
::
string
const
&
tag
)
{
#if OF_VERSION_MINOR < 10
return
m_xml
.
exists
(
tag
);
#else
return
m_stack
.
back
().
getChild
(
tag
);
#endif
}
int
addTag
(
std
::
string
const
&
tag
)
{
#if OF_VERSION_MINOR < 10
bool
yes
=
m_xml
.
addChild
(
tag
);
if
(
!
yes
)
{
return
-
1
;
}
return
m_xml
.
getNumChildren
(
tag
)
-
1
;
#else
ofXml
xml
=
m_stack
.
back
().
appendChild
(
tag
);
if
(
!
xml
)
{
return
-
1
;
}
return
0
;
#endif
}
bool
pushTag
(
const
std
::
string
&
tag
,
int
which
=
0
)
{
#if OF_VERSION_MINOR < 10
if
(
!
m_xml
.
exists
(
tag
))
{
return
false
;
}
return
m_xml
.
setTo
(
tag
);
#else
ofXml
xml
=
m_stack
.
back
().
getChild
(
tag
);
if
(
!
xml
)
{
return
false
;
}
m_stack
.
push_back
(
xml
);
return
true
;
#endif
}
int
popTag
()
{
#if OF_VERSION_MINOR < 10
m_xml
.
setToParent
();
#else
m_stack
.
pop_back
();
#endif
return
0
;
}
template
<
typename
T
>
T
getValue
(
const
std
::
string
&
tag
,
T
const
&
defaultValue
)
{
#if OF_VERSION_MINOR < 10
if
(
!
m_xml
.
exists
(
tag
))
{
return
defaultValue
;
}
return
m_xml
.
getValue
<
T
>
(
tag
,
T
());
#else
ofXml
xml
=
m_stack
.
back
().
getChild
(
tag
);
if
(
!
xml
)
{
return
defaultValue
;
}
return
xml
.
getValue
<
T
>
();
#endif
}
std
::
string
getValue
(
const
std
::
string
&
tag
,
char
const
*
defaultValue
)
...
...
@@ -78,6 +140,7 @@ public:
template
<
typename
T
>
T
getAttribute
(
const
std
::
string
&
tag
,
const
std
::
string
&
attribute
,
T
const
&
defaultValue
,
int
n
=
0
)
{
#if OF_VERSION_MINOR < 10
if
(
!
m_xml
.
exists
(
tag
))
{
return
defaultValue
;
...
...
@@ -98,6 +161,23 @@ public:
}
return
ofFromString
<
T
>
(
val
);
#else
ofXml
xml
=
m_stack
.
back
().
getChild
(
tag
);
if
(
!
xml
)
{
return
defaultValue
;
}
ofXml
::
Attribute
attr
=
xml
.
getAttribute
(
attribute
);
if
(
!
attr
)
{
return
defaultValue
;
}
return
ofFromString
<
T
>
(
attr
.
getValue
());
#endif
}
std
::
string
getAttribute
(
const
std
::
string
&
tag
,
const
std
::
string
&
attribute
,
char
const
*
defaultValue
,
int
n
=
0
)
...
...
@@ -108,6 +188,7 @@ public:
template
<
typename
T
>
int
setAttribute
(
const
std
::
string
&
tag
,
const
std
::
string
&
attribute
,
T
const
&
value
,
int
which
=
0
)
{
#if OF_VERSION_MINOR < 10
if
(
!
m_xml
.
exists
(
tag
))
{
return
-
1
;
...
...
@@ -128,6 +209,23 @@ public:
}
return
0
;
#else
ofXml
xml
=
m_stack
.
back
().
getChild
(
tag
);
if
(
!
xml
)
{
return
-
1
;
}
ofXml
::
Attribute
attr
=
xml
.
setAttribute
(
attribute
,
ofToString
(
value
));
if
(
!
attr
)
{
return
-
1
;
}
return
0
;
#endif
}
int
setAttribute
(
const
std
::
string
&
tag
,
const
std
::
string
&
attribute
,
char
const
*
value
,
int
which
=
0
)
...
...
@@ -138,6 +236,7 @@ public:
template
<
typename
T
>
int
setValue
(
const
std
::
string
&
tag
,
T
const
&
value
,
int
which
=
0
)
{
#if OF_VERSION_MINOR < 10
if
(
!
m_xml
.
exists
(
tag
))
{
bool
yes
=
m_xml
.
addChild
(
tag
);
...
...
@@ -148,6 +247,22 @@ public:
}
return
m_xml
.
setValue
(
tag
,
ofToString
(
value
));
#else
ofXml
xml
=
m_stack
.
back
().
getChild
(
tag
);
if
(
!
xml
)
{
xml
=
m_stack
.
back
().
appendChild
(
tag
);
if
(
!
xml
)
{
return
-
1
;
}
}
xml
.
set
(
value
);
return
0
;
#endif
}
int
setValue
(
const
std
::
string
&
tag
,
char
const
*
value
,
int
which
=
0
)
...
...
@@ -157,13 +272,22 @@ public:
private:
ofXml
m_xml
;
#if OF_VERSION_MINOR >= 10
std
::
vector
<
ofXml
>
m_stack
;
#endif
}
ofxXmlSettings
;
#endif
namespace
{
typedef
std
::
shared_ptr
<
ofBaseVideoPlayer
>
sptr_vid_player
;
typedef
std
::
shared_ptr
<
ofBaseSoundPlayer
>
sptr_snd_player
;
typedef
std
::
shared_ptr
<
ofParameter
<
ofTexture
>
>
sp_param_tex
;
typedef
std
::
shared_ptr
<
ofAppBaseWindow
>
sptr_window
;
struct
MyTex
{
sp_param_tex
sp_param_texture
;
...
...
@@ -401,7 +525,7 @@ namespace
void
gf_draw_text_input
(
ofParameter
<
std
::
string
>*
p_param
)
{
enum
{
MaxSizeBuf
=
256
};
enum
{
MaxSizeBuf
=
256
+
128
};
char
buf
[
MaxSizeBuf
];
strncpy
(
buf
,
p_param
->
get
().
c_str
(),
MaxSizeBuf
);
...
...
@@ -447,8 +571,130 @@ namespace
case
GL_R32F
:
return
"GL_R32F"
;
//=========================================================
#endif
case
GL_COMPRESSED_RGB_S3TC_DXT1_EXT
:
return
"GL_COMPRESSED_RGB_S3TC_DXT1"
;
case
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
:
return
"GL_COMPRESSED_RGBA_S3TC_DXT1"
;
case
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
:
return
"GL_COMPRESSED_RGBA_S3TC_DXT3"
;
case
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
:
return
"GL_COMPRESSED_RGBA_S3TC_DXT5"
;
default:
return
"unknown glInternalFormat"
;
}
}
void
gf_draw_video_player
(
ofParameter
<
sptr_vid_player
>*
p_param
)
{
ofParameter
<
sptr_vid_player
>&
param
=
*
p_param
;
sptr_vid_player
sp_player
=
param
.
get
();
if
(
sp_player
==
nullptr
)
{
return
;
}
ImGui
::
SetNextTreeNodeOpen
(
true
,
ImGuiCond_Appearing
);
if
(
ImGui
::
CollapsingHeader
(
p_param
->
getName
().
c_str
()))
{
if
(
sp_player
->
isLoaded
())
{
ofTexture
*
p_tex
=
sp_player
->
getTexturePtr
();
if
(
p_tex
)
{
ImGui
::
TextDisabled
(
"w: %.2f, h: %.2f, fmt: %s"
,
p_tex
->
getWidth
(),
p_tex
->
getHeight
(),
gf_get_gl_internal_fmt_name
(
p_tex
->
getTextureData
().
glInternalFormat
));
}
else
{
ofVideoPlayer
*
p_vid_player
=
dynamic_cast
<
ofVideoPlayer
*>
(
sp_player
.
get
());
if
(
p_vid_player
)
{
ofTexture
&
tex
=
p_vid_player
->
getTexture
();
ImGui
::
TextDisabled
(
"w: %.2f, h: %.2f, fmt: %s"
,
tex
.
getWidth
(),
tex
.
getHeight
(),
gf_get_gl_internal_fmt_name
(
tex
.
getTextureData
().
glInternalFormat
));
}
}
float
duration
=
sp_player
->
getDuration
();
float
time
=
sp_player
->
getPosition
()
*
duration
;
if
(
ImGui
::
SliderFloat
(
"time"
,
&
time
,
0.
f
,
duration
))
{
sp_player
->
setPosition
(
time
/
duration
);
}
if
(
ImGui
::
Button
(
"play"
))
{
sp_player
->
play
();
}
ImGui
::
SameLine
();
if
(
ImGui
::
Button
(
"stop"
))
{
sp_player
->
stop
();
}
ImGui
::
SameLine
();
if
(
ImGui
::
Button
(
"pause/resume"
))
{
sp_player
->
setPaused
(
!
sp_player
->
isPaused
());
}
bool
yes
=
sp_player
->
getLoopState
()
==
OF_LOOP_NORMAL
?
true
:
false
;
ImGui
::
Checkbox
(
"is loop"
,
&
yes
);
yes
=
sp_player
->
isPlaying
();
ImGui
::
SameLine
();
ImGui
::
Checkbox
(
"is playing"
,
&
yes
);
yes
=
sp_player
->
isPaused
();
ImGui
::
SameLine
();
ImGui
::
Checkbox
(
"is paused"
,
&
yes
);
}
}
}
void
gf_draw_sound_player
(
ofParameter
<
sptr_snd_player
>*
p_param
)
{
ofParameter
<
sptr_snd_player
>&
param
=
*
p_param
;
sptr_snd_player
sp_player
=
param
.
get
();
if
(
sp_player
==
nullptr
)
{
return
;
}
ImGui
::
SetNextTreeNodeOpen
(
true
,
ImGuiCond_Appearing
);
if
(
ImGui
::
CollapsingHeader
(
p_param
->
getName
().
c_str
()))
{
if
(
sp_player
->
isLoaded
())
{
float
pos
=
sp_player
->
getPosition
();
if
(
ImGui
::
SliderFloat
(
"position"
,
&
pos
,
0.
f
,
1.
f
))
{
sp_player
->
setPosition
(
pos
);
}
if
(
ImGui
::
Button
(
"play"
))
{
sp_player
->
play
();
}
ImGui
::
SameLine
();
if
(
ImGui
::
Button
(
"stop"
))
{
sp_player
->
stop
();
}
//ImGui::SameLine();
//if (ImGui::Button("pause/resume"))
//{
// if (sp_player->isPlaying())
// {
// sp_player->setPaused(true);
// }
// else
// {
// sp_player->setPaused(false);
// }
//}
bool
yes
=
sp_player
->
isPlaying
();
ImGui
::
Checkbox
(
"is playing"
,
&
yes
);
}
}
}
void
gf_draw_texture
(
ofParameter
<
MyTex
>*
p_param
)
...
...
@@ -488,7 +734,6 @@ namespace
if
(
my_tex
.
is_show_detail
)
{
ImGui
::
SameLine
();
ImGui
::
TextDisabled
(
"w: %.2f, h: %.2f, fmt: %s"
,
tex
.
getWidth
(),
tex
.
getHeight
(),
gf_get_gl_internal_fmt_name
(
tex
.
getTextureData
().
glInternalFormat
));
}
}
...
...
@@ -932,9 +1177,9 @@ void ofxImGuiParameter::mf_exit()
m_is_setup
=
false
;
}
ofxImGuiParameter
::
BindedID
ofxImGuiParameter
::
bind
(
ofAbstractParameter
const
&
param
)
ofxImGuiParameter
::
BindedID
ofxImGuiParameter
::
bind
(
ofAbstractParameter
const
&
param
,
Style
style
)
{
return
mf_bind
(
param
,
m_parameters
);
return
mf_bind
(
param
,
m_parameters
,
style
);
}
void
ofxImGuiParameter
::
unbind
(
BindedID
id
)
...
...
@@ -1041,11 +1286,13 @@ bool ofxImGuiParameter::save(std::string const& filepath)
ofxXmlSettings
xml_settings
;
bool
yes
=
xml_settings
.
load
(
xml_filepath
);
#if OF_VERSION_MINOR < 10
if
(
!
yes
)
{
xml_settings
.
addTag
(
"ofxImGuiParameter"
);
xml_settings
.
popTag
();
}
#endif
if
(
gf_force_push_tag
(
xml_settings
,
"ofxImGuiParameter"
))
{
...
...
@@ -1072,7 +1319,13 @@ bool ofxImGuiParameter::save(std::string const& filepath)
}
ofLogNotice
(
"ofxImGuiParameter"
,
"Save %s to %s"
,
m_title
.
c_str
(),
xml_filepath
.
c_str
());
return
xml_settings
.
save
(
xml_filepath
);
yes
=
xml_settings
.
save
(
xml_filepath
);
if
(
yes
)
{
ofNotifyEvent
(
m_on_save_event
,
xml_filepath
,
this
);
}
return
yes
;
}
bool
ofxImGuiParameter
::
load
(
std
::
string
const
&
filepath
)
...
...
@@ -1127,6 +1380,7 @@ bool ofxImGuiParameter::load(std::string const& filepath)
xml_settings
.
popTag
();
ofLogNotice
(
"ofxImGuiParameter"
,
"Load %s from %s"
,
m_title
.
c_str
(),
xml_filepath
.
c_str
());
ofNotifyEvent
(
m_on_load_event
,
xml_filepath
,
this
);
return
true
;
}
...
...
@@ -1234,7 +1488,7 @@ void ofxImGuiParameter::mf_draw_dialog()
}
}
}
ImGui
::
End
();
ImGui
::
End
();
}
bool
gf_is_bad_char
(
char
c
)
...
...
@@ -1262,21 +1516,6 @@ bool gf_is_bad_char(char c)
void
gf_remove_any_bad_char
(
std
::
string
&
str
)
{
std
::
replace_if
(
str
.
begin
(),
str
.
end
(),
std
::
bind
(
&
gf_is_bad_char
,
std
::
placeholders
::
_1
),
'_'
);
//std::replace(str.begin(), str.end(), ' ', '_');
//std::replace(str.begin(), str.end(), '(', '_');
//std::replace(str.begin(), str.end(), ')', '_');
//std::replace(str.begin(), str.end(), ':', '_');
//std::replace(str.begin(), str.end(), '<', '_');
//std::replace(str.begin(), str.end(), '>', '_');
//std::replace(str.begin(), str.end(), '[', '_');
//std::replace(str.begin(), str.end(), ']', '_');
//std::replace(str.begin(), str.end(), '{', '_');
//std::replace(str.begin(), str.end(), '}', '_');
//std::replace(str.begin(), str.end(), '-', '_');
//std::replace(str.begin(), str.end(), '\\', '_');
//std::replace(str.begin(), str.end(), '/', '_');
//std::replace(str.begin(), str.end(), '!', '_');
//std::replace(str.begin(), str.end(), '?', '_');
}
void
gf_save_xml
(
ofxXmlSettings
&
xml_settings
,
std
::
vector
<
ParamInfo
*
>&
container
,
gf_draw_func
i_func
,
gf_draw_func
f_func
)
...
...
@@ -1301,7 +1540,11 @@ void gf_save_xml(ofxXmlSettings& xml_settings, std::vector< ParamInfo* >& contai
{
xml_settings
.
setValue
(
tag_name
,
p_info
->
sp_param
->
cast
<
bool
>
().
get
()
?
"true"
:
"false"
);
}
else
if
(
p_info
->
func
==
f_func
)
else
if
(
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_float_slider_default
||
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_float_drag_default
||
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_float_input_default
)
{
xml_settings
.
setValue
(
tag_name
,
(
double
)
p_info
->
sp_param
->
cast
<
float
>
().
get
());
}
...
...
@@ -1313,7 +1556,11 @@ void gf_save_xml(ofxXmlSettings& xml_settings, std::vector< ParamInfo* >& contai
{
gf_save_xml_value_type
<
int
,
int
>
(
xml_settings
,
p_info
,
tag_name
);
}
else
if
(
p_info
->
func
==
i_func
)
else
if
(
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_int_slider_default
||
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_int_drag_default
||
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_int_input_default
)
{
xml_settings
.
setValue
(
tag_name
,
p_info
->
sp_param
->
cast
<
int
>
().
get
());
}
...
...
@@ -1457,13 +1704,21 @@ void gf_load_xml(ofxXmlSettings& xml_settings, std::vector< ParamInfo* >& contai
std
::
string
value
=
xml_settings
.
getValue
(
tag_name
,
param_b
.
get
()
?
"true"
:
"false"
);
param_b
.
set
(
value
==
"true"
);
}
else
if
(
p_info
->
func
==
f_func
)
else
if
(
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_float_slider_default
||
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_float_drag_default
||
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_float_input_default
)
{
ofParameter
<
float
>&
param_f
=
p_info
->
sp_param
->
cast
<
float
>
();
double
value
=
xml_settings
.
getValue
(
tag_name
,
(
double
)
param_f
.
get
());
param_f
.
set
(
static_cast
<
float
>
(
value
));
}
else
if
(
p_info
->
func
==
i_func
)
else
if
(
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_int_slider_default
||
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_int_drag_default
||
p_info
->
func
==
(
gf_draw_func
)
&
gf_draw_int_input_default
)
{
ofParameter
<
int
>&
param_i
=
p_info
->
sp_param
->
cast
<
int
>
();
int
value
=
xml_settings
.
getValue
(
tag_name
,
param_i
.
get
());
...
...
@@ -1660,7 +1915,7 @@ void gf_load_xml(ofxXmlSettings& xml_settings, std::vector< ParamInfo* >& contai
}
}
ofxImGuiParameter
::
BindedID
ofxImGuiParameter
::
mf_bind
(
ofAbstractParameter
const
&
param
,
std
::
vector
<
ParamInfo
*
>&
contanier
)
ofxImGuiParameter
::
BindedID
ofxImGuiParameter
::
mf_bind
(
ofAbstractParameter
const
&
param
,
std
::
vector
<
ParamInfo
*
>&
contanier
,
Style
style
)
{
ParamInfo
*
p_info
=
new
ParamInfo
();
shared_ptr
<
ofAbstractParameter
>
sp_param
=
param
.
newReference
();
...
...
@@ -1671,7 +1926,7 @@ ofxImGuiParameter::BindedID ofxImGuiParameter::mf_bind(ofAbstractParameter const
ofParameterGroup
const
&
group
=
(
ofParameterGroup
const
&
)
param
;
for
(
size_t
i
=
0
;
i
<
group
.
size
();
++
i
)
{
mf_bind
(
group
[
i
],
p_info
->
children
);
mf_bind
(
group
[
i
],
p_info
->
children
,
style
);
}
}
else
if
(
type_name
==
typeid
(
ofParameter
<
bool
>
).
name
())
...
...
@@ -1680,11 +1935,48 @@ ofxImGuiParameter::BindedID ofxImGuiParameter::mf_bind(ofAbstractParameter const
}
else
if
(
type_name
==
typeid
(
ofParameter
<
int
>
).
name
())
{
p_info
->
func
=
m_default_draw_i_func
;
switch
(
style
)
{
default:
case
StyleNone
:
p_info
->
func
=
m_default_draw_i_func
;
break
;
case
StyleSlider
:
p_info
->
func
=
(
gf_draw_func
)
&
gf_draw_int_slider_default
;
break
;
case
StyleDrag
:
p_info
->
func
=
(
gf_draw_func
)
&
gf_draw_int_drag_default
;
break
;
case
StyleInputField
:
p_info
->
func
=
(
gf_draw_func
)
&
gf_draw_int_input_default
;
break
;
}
}
else
if
(
type_name
==
typeid
(
ofParameter
<
float
>
).
name
())
{
p_info
->
func
=
m_default_draw_f_func
;
switch
(
style
)
{
default:
case
StyleNone
:
p_info
->
func
=
m_default_draw_f_func
;
break
;
case
StyleSlider
:
p_info
->
func
=
(
gf_draw_func
)
&
gf_draw_float_slider_default
;
break
;
case
StyleDrag
:
p_info
->
func
=
(
gf_draw_func
)
&
gf_draw_float_drag_default
;
break
;
case
StyleInputField
:
p_info
->
func
=
(
gf_draw_func
)
&
gf_draw_float_input_default
;
break
;
}
}
else
if
(
type_name
==
typeid
(
ofParameter
<
EnumType
>
).
name
())
{
...
...
@@ -1744,6 +2036,14 @@ ofxImGuiParameter::BindedID ofxImGuiParameter::mf_bind(ofAbstractParameter const
{
p_info
->
func
=
(
gf_draw_func
)
&
gf_draw_text_input
;
}
else
if
(
type_name
==
typeid
(
ofParameter
<
sptr_vid_player
>
).
name
())
{
p_info
->
func
=
(
gf_draw_func
)
&
gf_draw_video_player
;
}
else
if
(
type_name
==
typeid
(
ofParameter
<
sptr_snd_player
>
).
name
())
{
p_info
->
func
=
(
gf_draw_func
)
&
gf_draw_sound_player
;
}
else
if
(
type_name
==
typeid
(
ofParameter
<
ofTexture
>
).
name
())
{
ofParameter
<
ofTexture
>
const
&
param_tex
=
(
ofParameter
<
ofTexture
>
const
&
)
param
;
...
...
src/ofxImGuiParameter.h
View file @
a9a31eff
/*
The78ester
*/
#ifndef INCLUDE_OF_ADDONS_OFXIMGUIPARAMETER_H
#define INCLUDE_OF_ADDONS_OFXIMGUIPARAMETER_H
#ifndef INCLUDE_OF_ADDONS_OFXIMGUIPARAMETER_H
_
#define INCLUDE_OF_ADDONS_OFXIMGUIPARAMETER_H
_
#include <ofMain.h>
#include "ofXml.h"
typedef
void
(
*
gf_draw_func
)(
ofAbstractParameter
*
);
...
...
@@ -26,6 +28,7 @@ public:
enum
Style
{
StyleNone
,
StyleInputField
,
StyleSlider
,
StyleDrag
,
...
...
@@ -90,7 +93,7 @@ public:
bool
is_setup
();
void
exit
();
BindedID
bind
(
ofAbstractParameter
const
&
param
);
BindedID
bind
(
ofAbstractParameter
const
&
param
,
Style
style
=
StyleNone
);
void
unbind
(
BindedID
bid
);
void
draw
();
bool
save
(
std
::
string
const
&
filepath
=
""
);
...
...
@@ -108,6 +111,9 @@ public:
ofEvent
<
void
>&
get_on_pre_draw_parameter_event
();
ofEvent
<
void
>&
get_on_post_draw_parameter_event
();
ofEvent
<
std
::
string
const
>&
get_on_save_event
();
ofEvent
<
std
::
string
const
>&
get_on_load_event
();
private:
static
std
::
vector
<
ofxImGuiParameter
*
>
s_box
;
...
...
@@ -116,8 +122,10 @@ private:
static
void
sf_draw
(
ParamInfo
*
p_param_info
);
ofEvent
<
void
>
m_pre_draw_event
;
ofEvent
<
void
>
m_post_draw_event
;
ofEvent
<
void
>
m_pre_draw_event
;
ofEvent
<
void
>
m_post_draw_event
;
ofEvent
<
std
::
string
const
>
m_on_save_event
;
ofEvent
<
std
::
string
const
>
m_on_load_event
;
ofMutex
m_mutex
;
gf_draw_func
m_default_draw_i_func
;
...
...
@@ -141,7 +149,7 @@ private:
void
mf_exit
();
void
mf_draw_dialog
();
BindedID
mf_bind
(
ofAbstractParameter
const
&
param
,
std
::
vector
<
ParamInfo
*
>&
contanier
);
BindedID
mf_bind
(
ofAbstractParameter
const
&
param
,
std
::
vector
<
ParamInfo
*
>&
contanier
,
Style
style
);
void
mf_unbind
(
std
::
vector
<
ParamInfo
*
>&
contanier
);
void
mf_unbind
(
BindedID
bid
,
std
::
vector
<
ParamInfo
*
>&
contanier
);
...
...
@@ -203,6 +211,16 @@ inline ofEvent< void >& ofxImGuiParameter::get_on_post_draw_parameter_event()
return
m_post_draw_event
;
}
inline
ofEvent
<
std
::
string
const
>&
ofxImGuiParameter
::
get_on_save_event
()
{
return
m_on_save_event
;
}
inline
ofEvent
<
std
::
string
const
>&
ofxImGuiParameter
::
get_on_load_event
()
{
return
m_on_load_event
;
}
typedef
ofxImGuiParameter
::
ValueType
<
int
>
ofxImGuiInt
;
typedef
ofxImGuiParameter
::
ValueType
<
float
>
ofxImGuiFloat
;
typedef
ofxImGuiParameter
::
EnumType
ofxImGuiEnum
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment