├── NuoWindowsFoundation
├── NuoUI
│ ├── NuoRect.cpp
│ ├── NuoMonitorScale.cpp
│ ├── NuoMouse.h
│ ├── NuoSlider.h
│ ├── NuoMouse.cpp
│ ├── NuoSlider.cpp
│ ├── NuoProgressBar.h
│ ├── NuoScrollView.h
│ ├── NuoDropdownList.h
│ ├── NuoProgressBar.cpp
│ ├── NuoScrollView.cpp
│ ├── NuoDropdownList.cpp
│ ├── NuoWindowTypes.h
│ ├── NuoView.h
│ ├── NuoStrings.h
│ ├── NuoOpenFileDialog.h
│ ├── NuoView.cpp
│ ├── FoundationResource.h
│ ├── NuoAppInstance.h
│ ├── NuoMonitorScale.h
│ ├── DPIAware.manifest
│ ├── NuoButton.h
│ ├── NuoLabel.h
│ ├── NuoDialog.h
│ ├── NuoTimer.h
│ ├── NuoListView.h
│ ├── NuoTimer.cpp
│ ├── NuoOpenFileDialog.cpp
│ ├── NuoImage.h
│ ├── NuoStrings.cpp
│ ├── NuoFile.h
│ ├── NuoButton.cpp
│ ├── NuoAppInstance.cpp
│ ├── NuoLabel.cpp
│ ├── NuoMenu.h
│ ├── NuoControl.h
│ └── FoundationResource.rc
├── NuoModelLoader
│ ├── tiny_obj_loader.cc
│ ├── NuoModelLoader.h
│ ├── NuoBounds.h
│ ├── NuoModelLoaderGPU.h
│ ├── NuoModelTextured.cpp
│ ├── NuoModelLoaderGPU.cpp
│ └── NuoMaterial.h
├── NuoDirect
│ ├── NuoRenderPassTarget.h
│ ├── NuoSize.h
│ ├── NuoTexture.cpp
│ ├── NuoTexture.h
│ ├── NuoShader.h
│ ├── NuoCommandQueue.h
│ ├── NuoConstantBufferSwapChain.h
│ ├── NuoResource.h
│ ├── NuoResourceSwapChain.h
│ ├── NuoVertexBuffer.h
│ ├── NuoPipelineState.h
│ ├── NuoConstantBufferSwapChain.cpp
│ ├── NuoResourceSwapChain.cpp
│ ├── NuoRenderTargetSwapChain.h
│ ├── NuoFenceSwapChain.h
│ ├── NuoDescriptorHeap.h
│ ├── NuoCommandQueue.cpp
│ ├── NuoResource.cpp
│ ├── NuoRenderTargetSwapChain.cpp
│ ├── NuoVertexBuffer.cpp
│ ├── NuoSignature.h
│ ├── NuoDevice.h
│ ├── NuoDirectView.h
│ ├── NuoRenderTarget.h
│ └── NuoDescriptorHeap.cpp
├── NuoMeshes
│ ├── NuoMeshBounds.cpp
│ ├── NuoShaders
│ │ ├── NuoTexturePixel.hlsl
│ │ ├── NuoMeshTextured.h
│ │ ├── NuoTextureVertex.hlsl
│ │ ├── NuoMeshShaderType.h
│ │ ├── NuoMeshScreenSpace.h
│ │ ├── NuoMeshSimple.h
│ │ ├── NuoMeshShadersCommon.h
│ │ ├── NuoMeshSimpleVertex.hlsl
│ │ ├── NuoMeshMaterialedVertex.hlsl
│ │ ├── NuoMeshMaterialedPixel.hlsl
│ │ ├── NuoMeshSimplePixel.hlsl
│ │ └── NuoMeshMaterialed.h
│ ├── NuoMeshBounds.h
│ ├── NuoMeshSceneRoot.h
│ ├── NuoMeshOptions.h
│ ├── NuoCubeMesh.h
│ ├── NuoCubeMesh.cpp
│ ├── NuoMeshRotation.h
│ ├── NuoMeshSceneRoot.cpp
│ ├── NuoMeshCompound.h
│ ├── NuoMeshMaterialed.h
│ ├── NuoMeshRotation.cpp
│ ├── NuoAuxilliaryMeshes
│ │ └── NuoScreenSpaceMesh.h
│ └── NuoMeshMaterialed.cpp
├── NuoShadowMap
│ ├── NuoLightSource.cpp
│ └── NuoLightSource.h
├── NuoUtilites
│ ├── NuoDispatch.h
│ ├── NuoTableExporter.h
│ ├── NuoBackgroundTask.h
│ ├── NuoModelArrow.h
│ ├── NuoMathVector.cpp
│ ├── NuoDispatch.cpp
│ ├── NuoModelBoard.cpp
│ ├── Win
│ │ └── NuoMathVectorTypeTraitWin.hpp
│ └── NuoBackgroundTask.cpp
├── NuoRender
│ ├── NuoRenderPass.cpp
│ ├── NuoRenderPipeline.h
│ ├── NuoRenderPass.h
│ ├── NuoRenderPipelinePass.cpp
│ ├── NuoRenderPipelinePass.h
│ └── NuoRenderPipeline.cpp
└── NuoScripting
│ └── NuoLua.h
├── NuoWindow
├── NuoWindow
│ ├── NuoApp.h
│ ├── small.ico
│ ├── NuoWindow.ico
│ ├── NuoWindow.rc
│ ├── NuoWindow.vcxproj.user
│ ├── targetver.h
│ ├── framework.h
│ ├── IconWindow.h
│ ├── ListViewWindow.h
│ ├── AppAboutDialog.h
│ ├── AppAboutDialog.cpp
│ ├── Resource.h
│ ├── ListViewWindow.cpp
│ └── IconWindow.cpp
├── Nuclear.png
└── NuoWindow.sln
├── NuoDirect
├── NuoDirect
│ ├── NuoDirect.h
│ ├── small.ico
│ ├── NuoDirect.aps
│ ├── NuoDirect.ico
│ ├── NuoDirect.rc
│ ├── NuoDirect.vcxproj.user
│ ├── targetver.h
│ ├── framework.h
│ ├── NuoDirectWindow.h
│ ├── Resource.h
│ ├── NuoDirectWindow.cpp
│ ├── DirectView.h
│ ├── shaders.hlsl
│ └── NuoDirect.cpp
└── NuoDirect.sln
├── lua
├── doc
│ ├── logo.gif
│ ├── osi-certified-72x60.png
│ ├── index.css
│ └── manual.css
├── Lua
│ ├── LuaLib
│ │ ├── LuaLib.cpp
│ │ ├── LuaLib.vcxproj.user
│ │ └── framework.h
│ ├── LuaCmd
│ │ ├── LuaCmd.vcxproj.user
│ │ └── LuaCmd.vcxproj.filters
│ └── Lua.sln
├── README
└── src
│ ├── lua.hpp
│ ├── lundump.h
│ ├── lprefix.h
│ ├── lualib.h
│ ├── lapi.h
│ ├── lzio.c
│ ├── lopnames.h
│ ├── lzio.h
│ ├── lstring.h
│ ├── linit.c
│ ├── lfunc.h
│ ├── ldebug.h
│ ├── ltable.h
│ ├── ljumptab.h
│ ├── lctype.h
│ ├── lctype.c
│ └── llex.h
├── NuoModelViewer
├── NuoModelViewer
│ ├── ModelViewerMain.h
│ ├── small.ico
│ ├── NuoDirect.ico
│ ├── NuoDirect.rc
│ ├── ModelState
│ │ ├── ModelState.h
│ │ ├── ModelState.cpp
│ │ ├── ModelViewConfiguration.h
│ │ └── ModelViewConfiguration.cpp
│ ├── Renderer
│ │ ├── NotationRenderer.h
│ │ ├── ModelSceneParameters.h
│ │ ├── ModelViewerRenderer.h
│ │ └── NotationLight.h
│ ├── Resources
│ │ └── NuoModelViewer.ico
│ ├── NuoModelViewer.vcxproj.user
│ ├── targetver.h
│ ├── UserInterface
│ │ ├── ModelOptionUpdate.h
│ │ └── ModelOperationPanel.h
│ ├── framework.h
│ ├── Resource.h
│ ├── ModelViewerWindow.h
│ ├── ModelViewerMain.cpp
│ └── ModelView.h
└── NuoModelViewer.sln
├── README.md
└── .gitignore
/NuoWindowsFoundation/NuoUI/NuoRect.cpp:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoMonitorScale.cpp:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/NuoApp.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "resource.h"
4 |
--------------------------------------------------------------------------------
/NuoDirect/NuoDirect/NuoDirect.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "resource.h"
4 |
--------------------------------------------------------------------------------
/lua/doc/logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/lua/doc/logo.gif
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/ModelViewerMain.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "resource.h"
4 |
--------------------------------------------------------------------------------
/NuoWindow/Nuclear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindow/Nuclear.png
--------------------------------------------------------------------------------
/NuoDirect/NuoDirect/small.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoDirect/NuoDirect/small.ico
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/small.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindow/NuoWindow/small.ico
--------------------------------------------------------------------------------
/NuoDirect/NuoDirect/NuoDirect.aps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoDirect/NuoDirect/NuoDirect.aps
--------------------------------------------------------------------------------
/NuoDirect/NuoDirect/NuoDirect.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoDirect/NuoDirect/NuoDirect.ico
--------------------------------------------------------------------------------
/NuoDirect/NuoDirect/NuoDirect.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoDirect/NuoDirect/NuoDirect.rc
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/NuoWindow.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindow/NuoWindow/NuoWindow.ico
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/NuoWindow.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindow/NuoWindow/NuoWindow.rc
--------------------------------------------------------------------------------
/lua/doc/osi-certified-72x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/lua/doc/osi-certified-72x60.png
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoModelLoader/tiny_obj_loader.cc:
--------------------------------------------------------------------------------
1 | #define TINYOBJLOADER_IMPLEMENTATION
2 | #include "tiny_obj_loader.h"
3 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoMouse.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindowsFoundation/NuoUI/NuoMouse.h
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoSlider.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindowsFoundation/NuoUI/NuoSlider.h
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/small.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoModelViewer/NuoModelViewer/small.ico
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoMouse.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindowsFoundation/NuoUI/NuoMouse.cpp
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoSlider.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindowsFoundation/NuoUI/NuoSlider.cpp
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/NuoDirect.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoModelViewer/NuoModelViewer/NuoDirect.ico
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/NuoDirect.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoModelViewer/NuoModelViewer/NuoDirect.rc
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoProgressBar.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindowsFoundation/NuoUI/NuoProgressBar.h
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoScrollView.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindowsFoundation/NuoUI/NuoScrollView.h
--------------------------------------------------------------------------------
/lua/Lua/LuaLib/LuaLib.cpp:
--------------------------------------------------------------------------------
1 | // LuaLib.cpp : Defines the functions for the static library.
2 | //
3 |
4 | #include "framework.h"
5 |
6 |
7 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoDropdownList.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindowsFoundation/NuoUI/NuoDropdownList.h
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoProgressBar.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindowsFoundation/NuoUI/NuoProgressBar.cpp
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoScrollView.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindowsFoundation/NuoUI/NuoScrollView.cpp
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoDropdownList.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindowsFoundation/NuoUI/NuoDropdownList.cpp
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/ModelState/ModelState.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoModelViewer/NuoModelViewer/ModelState/ModelState.h
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoDirect/NuoRenderPassTarget.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoWindowsFoundation/NuoDirect/NuoRenderPassTarget.h
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/ModelState/ModelState.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoModelViewer/NuoModelViewer/ModelState/ModelState.cpp
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/Renderer/NotationRenderer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoModelViewer/NuoModelViewer/Renderer/NotationRenderer.h
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/Resources/NuoModelViewer.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoModelViewer/NuoModelViewer/Resources/NuoModelViewer.ico
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NuoWindows
2 |
3 | Simple C++ class framework for Win32 and DirectX12
4 |
5 | # NuoModelViewer
6 |
7 | A renderer under construction, based on NuoWindows.
8 |
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/Renderer/ModelSceneParameters.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/middlefeng/NuoWindows/HEAD/NuoModelViewer/NuoModelViewer/Renderer/ModelSceneParameters.h
--------------------------------------------------------------------------------
/lua/README:
--------------------------------------------------------------------------------
1 |
2 | This is Lua 5.4.2, released on 13 Nov 2020.
3 |
4 | For installation instructions, license details, and
5 | further information about Lua, see doc/readme.html.
6 |
7 |
--------------------------------------------------------------------------------
/lua/Lua/LuaCmd/LuaCmd.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/lua/Lua/LuaLib/LuaLib.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/NuoDirect/NuoDirect/NuoDirect.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/NuoWindow.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/NuoModelViewer.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoWindowTypes.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ifndef __NUO_WINDOW_TYPES_H__
4 | #define __NUO_WINDOW_TYPES_H__
5 |
6 | enum NuoAlign
7 | {
8 | kNuoAlign_Left,
9 | kNuoAlign_Right,
10 | };
11 |
12 | #endif
13 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoDirect/NuoSize.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __NUO_SIZE_H__
3 | #define __NUO_SIZE_H__
4 |
5 |
6 | #include "NuoUI/NuoRect.h"
7 |
8 |
9 | typedef NuoPoint NuoSize;
10 |
11 |
12 | #endif // !__NUO_SIZE_H__
13 |
--------------------------------------------------------------------------------
/lua/src/lua.hpp:
--------------------------------------------------------------------------------
1 | // lua.hpp
2 | // Lua header files for C++
3 | // <> not supplied automatically because Lua also compiles as C++
4 |
5 | extern "C" {
6 | #include "lua.h"
7 | #include "lualib.h"
8 | #include "lauxlib.h"
9 | }
10 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoMeshBounds.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // NuoMeshBounds.m
3 | // ModelViewer
4 | //
5 | // Created by Dong on 1/25/18.
6 | // Copyright © 2018 middleware. All rights reserved.
7 | //
8 |
9 | #include "NuoMeshBounds.h"
10 |
11 |
--------------------------------------------------------------------------------
/lua/Lua/LuaLib/framework.h:
--------------------------------------------------------------------------------
1 | // header.h : include file for standard system include files,
2 | // or project specific include files
3 | //
4 |
5 | #pragma once
6 |
7 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | NuoModelViewer/Debug/
2 | NuoWindow/NuoWindow/Debug/
3 | NuoWindow/NuoWindow/NuoWindow.aps
4 | NuoDirect/Debug/
5 | NuoDirect/NuoDirect/Debug/
6 | NuoDirect/NuoDirect/Release/
7 | NuoDirect/x64/Debug/
8 | NuoDirect/x64/Release/
9 |
10 | x64
11 | .vs
12 |
13 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoView.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include "NuoControl.h"
5 |
6 |
7 | class NuoView;
8 | typedef std::shared_ptr PNuoView;
9 |
10 |
11 | class NuoView : public NuoControl
12 | {
13 |
14 | public:
15 |
16 | NuoView(const PNuoWindow& parent);
17 |
18 | void Init();
19 |
20 | };
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/NuoDirect/NuoDirect/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // // Including SDKDDKVer.h defines the highest available Windows platform.
4 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
5 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
6 | #include
7 |
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // // Including SDKDDKVer.h defines the highest available Windows platform.
4 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
5 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
6 | #include
7 |
--------------------------------------------------------------------------------
/lua/doc/index.css:
--------------------------------------------------------------------------------
1 | ul {
2 | list-style-type: none ;
3 | }
4 |
5 | ul.contents {
6 | padding: 0 ;
7 | }
8 |
9 | table {
10 | border: none ;
11 | border-spacing: 0 ;
12 | border-collapse: collapse ;
13 | }
14 |
15 | td {
16 | vertical-align: top ;
17 | padding: 0 ;
18 | text-align: left ;
19 | line-height: 1.25 ;
20 | width: 15% ;
21 | }
22 |
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // // Including SDKDDKVer.h defines the highest available Windows platform.
4 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
5 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
6 | #include
7 |
--------------------------------------------------------------------------------
/lua/doc/manual.css:
--------------------------------------------------------------------------------
1 | h3 code {
2 | font-family: inherit ;
3 | font-size: inherit ;
4 | }
5 |
6 | pre, code {
7 | font-size: 12pt ;
8 | }
9 |
10 | span.apii {
11 | color: gray ;
12 | float: right ;
13 | font-family: inherit ;
14 | font-style: normal ;
15 | font-size: small ;
16 | }
17 |
18 | h2:before {
19 | content: "" ;
20 | padding-right: 0em ;
21 | }
22 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoStrings.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | std::wstring StringToUTF16(const std::string& s);
7 | std::string StringToUTF8(const std::wstring& s);
8 |
9 | std::string LastPathComponent(const std::string& s);
10 | std::string RemoveLastPathComponent(const std::string& s);
11 |
12 | std::wstring ErrorMessage(ID3DBlob* errorBlob);
13 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoShaders/NuoTexturePixel.hlsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #include "NuoMeshScreenSpace.h"
6 |
7 |
8 | Texture2D texSource : register(t0);
9 | SamplerState texSampler : register(s0);
10 |
11 |
12 | float4 main(NuoMeshScreenSpaceVertexShaderOutput inVertex) : SV_Target
13 | {
14 | float4 color = texSource.Sample(texSampler, inVertex._texCoord);
15 | return color;
16 | }
17 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoShaders/NuoMeshTextured.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ifndef __NuoMeshTextured_h__
4 | #define __NuoMeshTextured_h__
5 |
6 |
7 | #include "NuoMeshShaderType.h"
8 |
9 |
10 |
11 | struct NuoMeshTexturedItem
12 | {
13 | float4 _position SHADER_SEMATIC(POSITION);
14 | float4 _normal SHADER_SEMATIC(NORMAL);
15 | float2 _texCoord SHADER_SEMATIC(TEX_COORD);
16 | };
17 |
18 |
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoOpenFileDialog.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | #include
5 | #include
6 |
7 | #include "NuoWindow.h"
8 |
9 |
10 | class NuoFileDialog
11 | {
12 |
13 | OPENFILENAME _ofn;
14 | wchar_t _szFile[256];
15 |
16 | public:
17 |
18 | NuoFileDialog();
19 |
20 | void Open(const PNuoWindow& owner);
21 | void Save(const PNuoWindow& owner);
22 | std::string FilePath() const;
23 |
24 | };
25 |
26 |
27 |
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/UserInterface/ModelOptionUpdate.h:
--------------------------------------------------------------------------------
1 | //
2 | // ModelOptionUpdate.h
3 | // ModelViewer
4 | //
5 | // Created by Dong Feng on 5/8/22.
6 | // Copyright © 2022 Dong Feng. All rights reserved.
7 | //
8 |
9 |
10 |
11 | #ifndef __MODEL_OPTION_UPDATE_H__
12 | #define __MODEL_OPTION_UPDATE_H__
13 |
14 |
15 | class ModelOptionUpdate
16 | {
17 | public:
18 | virtual void ModelOptionUpdated() = 0;
19 | };
20 |
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/NuoDirect/NuoDirect/framework.h:
--------------------------------------------------------------------------------
1 | // header.h : include file for standard system include files,
2 | // or project specific include files
3 | //
4 |
5 | #pragma once
6 |
7 | #include "targetver.h"
8 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
9 | // Windows Header Files
10 | #include
11 | // C RunTime Header Files
12 | #include
13 | #include
14 | #include
15 | #include
16 |
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/framework.h:
--------------------------------------------------------------------------------
1 | // header.h : include file for standard system include files,
2 | // or project specific include files
3 | //
4 |
5 | #pragma once
6 |
7 | #include "targetver.h"
8 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
9 | // Windows Header Files
10 | #include
11 | // C RunTime Header Files
12 | #include
13 | #include
14 | #include
15 | #include
16 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoShaders/NuoTextureVertex.hlsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #include "NuoMeshScreenSpace.h"
5 |
6 |
7 |
8 | NuoMeshScreenSpaceVertexShaderOutput main(NuoMeshScreenSpaceItem v)
9 | {
10 | NuoMeshScreenSpaceVertexShaderOutput outVertex;
11 |
12 | outVertex._position = v._position;
13 | outVertex._position.z = 1.0;
14 | outVertex._position.w = 1.0;
15 | outVertex._texCoord = v._texCoord.xy;
16 |
17 | return outVertex;
18 | }
19 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoMeshBounds.h:
--------------------------------------------------------------------------------
1 | //
2 | // NuoMeshBounds.h
3 | // ModelViewer
4 | //
5 | // Created by Dong on 1/25/18.
6 | // Copyright © 2018 middleware. All rights reserved.
7 | //
8 |
9 | #ifndef __MESH_BOUNDS_H__
10 | #define __MESH_BOUNDS_H__
11 |
12 |
13 | #include "NuoModelLoader/NuoBounds.h"
14 |
15 |
16 | class NuoMeshBounds
17 | {
18 | public:
19 | NuoBounds boundingBox;
20 | NuoSphere boundingSphere;
21 | };
22 |
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/framework.h:
--------------------------------------------------------------------------------
1 | // header.h : include file for standard system include files,
2 | // or project specific include files
3 | //
4 |
5 | #pragma once
6 |
7 | #include "targetver.h"
8 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
9 | // Windows Header Files
10 | #include
11 | // C RunTime Header Files
12 | #include
13 | #include
14 | #include
15 | #include
16 |
--------------------------------------------------------------------------------
/NuoDirect/NuoDirect/NuoDirectWindow.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "NuoWindow.h"
4 | #include "DirectView.h"
5 | #include
6 |
7 | class NuoDirectWindow : public NuoWindow
8 | {
9 |
10 | std::function _onPaint;
11 | PDirectView _dxView;
12 |
13 | public:
14 |
15 | void Init();
16 |
17 | NuoDirectWindow(const std::string& title);
18 | virtual void OnPaint();
19 |
20 | };
21 |
22 |
23 |
24 | typedef std::shared_ptr PNuoDirectWindow;
25 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoShaders/NuoMeshShaderType.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ifndef __NUOMESHSHADERMESH_H__
4 | #define __NUOMESHSHADERMESH_H__
5 |
6 | #if __cplusplus
7 |
8 | #include
9 |
10 | typedef DirectX::XMVECTOR float4;
11 | typedef DirectX::XMFLOAT3 float3;
12 | typedef DirectX::XMFLOAT2 float2;
13 |
14 | typedef DirectX::XMMATRIX matrix;
15 |
16 | #define SHADER_SEMATIC(name)
17 |
18 | #else
19 |
20 | #define SHADER_SEMATIC(name) : name
21 |
22 | #endif
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/IconWindow.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "NuoWindow.h"
4 |
5 | #include "NuoButton.h"
6 | #include "NuoLabel.h"
7 |
8 |
9 | class IconWindow : public NuoWindow
10 | {
11 | std::weak_ptr _appWindow;
12 | PNuoButton _loadButton;
13 | PNuoButton _saveButton;
14 | PNuoLabel _iconLabel;
15 |
16 | public:
17 | IconWindow(const PNuoWindow& appWindow);
18 |
19 | void Init();
20 | NuoRect PreferredRect() const;
21 | };
22 |
23 |
24 | typedef std::shared_ptr PIconWindow;
25 |
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/ListViewWindow.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "NuoWindow.h"
4 |
5 | #include "NuoButton.h"
6 | #include "NuoListView.h"
7 |
8 |
9 |
10 | class ListViewWindow : public NuoWindow
11 | {
12 | std::weak_ptr _appWindow;
13 | PNuoButton _loadButton;
14 | PNuoListView _listView;
15 |
16 | public:
17 | ListViewWindow(const PNuoWindow& appWindow);
18 |
19 | void Init();
20 | NuoRect PreferredRect() const;
21 | };
22 |
23 |
24 | typedef std::shared_ptr PListViewWindow;
25 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoShadowMap/NuoLightSource.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // NuoLightSource.m
3 | // ModelViewer
4 | //
5 | // Created by middleware on 11/19/16.
6 | // Copyright © 2020 middleware. All rights reserved.
7 | //
8 |
9 | #include "NuoLightSource.h"
10 |
11 |
12 | NuoLightSource::NuoLightSource()
13 | : _lightDirection(NuoMatrixFloat44Identity),
14 | _lightingIrradiance(0),
15 | _lightingSpecular(0),
16 | _enableShadow(0),
17 | _shadowSoften(0),
18 | _shadowOccluderRadius(0),
19 | _shadowBias(0)
20 | {
21 | }
22 |
23 |
24 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoView.cpp:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include "NuoView.h"
4 | #include "NuoAppInstance.h"
5 | #include
6 |
7 | NuoView::NuoView(const PNuoWindow& parent)
8 | : NuoControl("", parent)
9 | {
10 | _hWnd = CreateWindow(kClassName, L"", WS_VISIBLE | WS_CHILD,
11 | CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, parent->Handle(), nullptr,
12 | NuoAppInstance::GetInstance()->Instance(), nullptr);
13 |
14 | SetWindowLongPtr(_hWnd, kWindowPtr, (LONG_PTR)this);
15 | }
16 |
17 |
18 |
19 | void NuoView::Init()
20 | {
21 | }
22 |
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/AppAboutDialog.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include "NuoDialog.h"
5 | #include "NuoButton.h"
6 | #include "NuoLabel.h"
7 |
8 |
9 | class AppAboutDialog : public NuoDialog
10 | {
11 |
12 | PNuoLabel _label;
13 | PNuoLabel _labelCopyright;
14 |
15 | public:
16 |
17 | AppAboutDialog(const std::string& title);
18 | virtual ~AppAboutDialog();
19 |
20 | virtual void InitDialog() override;
21 | virtual void UpdateLayout() override;
22 |
23 | };
24 |
25 |
26 | typedef std::shared_ptr PAppAboutDialog;
27 |
28 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/FoundationResource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by FoundationResource.rc
4 |
5 | #define IDD_DIALOG_FOUNDATION 102
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 101
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoShaders/NuoMeshScreenSpace.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ifndef __NuoMeshScreenSpace_h__
4 | #define __NuoMeshScreenSpace_h__
5 |
6 |
7 | #include "NuoMeshShaderType.h"
8 |
9 |
10 |
11 | struct NuoMeshScreenSpaceItem
12 | {
13 | float4 _position SHADER_SEMATIC(POSITION);
14 | float2 _texCoord SHADER_SEMATIC(TEX_COORD);
15 | };
16 |
17 | struct NuoMeshScreenSpaceVertexShaderOutput
18 | {
19 | float2 _texCoord SHADER_SEMATIC(TEX_COORD);
20 | float4 _position SHADER_SEMATIC(SV_Position);
21 | };
22 |
23 |
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoAppInstance.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | class NuoAppInstance
7 | {
8 | HINSTANCE _instance;
9 | int _cmdShow;
10 |
11 | static ULONG_PTR _gdiToken;
12 |
13 | NuoAppInstance(HINSTANCE hInstance, int cmdShow);
14 |
15 | public:
16 |
17 | static void Init(HINSTANCE hInstance, int cmdShow);
18 | static void UnInit();
19 | static NuoAppInstance* GetInstance();
20 |
21 | HINSTANCE Instance();
22 | std::string ModulePath();
23 | int CommandShow();
24 | static void Exit();
25 | };
26 |
27 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoShaders/NuoMeshSimple.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ifndef __NuoMeshSimple_h__
4 | #define __NuoMeshSimple_h__
5 |
6 |
7 | #include "NuoMeshShaderType.h"
8 |
9 |
10 |
11 | struct NuoMeshSimpleItem
12 | {
13 | float4 _position SHADER_SEMATIC(POSITION);
14 | float4 _normal SHADER_SEMATIC(NORMAL);
15 | };
16 |
17 | struct NuoMeshSimpleVertexShaderOutput
18 | {
19 | float4 _position SHADER_SEMATIC(SV_Position);
20 | float3 _eye SHADER_SEMATIC(EYE_DIRECTION);
21 | float4 _normal SHADER_SEMATIC(NORMAL);
22 | };
23 |
24 |
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoMonitorScale.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 |
7 |
8 | template
9 | NuoPoint MonitorDPI(const NuoPoint& point)
10 | {
11 | POINT pt;
12 | pt.x = (LONG)point.X();
13 | pt.y = (LONG)point.Y();
14 |
15 | UINT dpiX, dpiY;
16 | HMONITOR monitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
17 | GetDpiForMonitor(monitor, MDT_EFFECTIVE_DPI, &dpiX, &dpiY);
18 |
19 | NuoPoint scaleF(1, 1);
20 | scaleF.SetX((double)dpiX / 100.0);
21 | scaleF.SetY((double)dpiY / 100.0);
22 |
23 | return scaleF;
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoDirect/NuoTexture.cpp:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include "NuoTexture.h"
4 | #include "NuoCommandBuffer.h"
5 |
6 |
7 | NuoTexture::NuoTexture()
8 | {
9 | }
10 |
11 |
12 | NuoTexture::~NuoTexture()
13 | {
14 | }
15 |
16 |
17 |
18 | void NuoTexture::Upload(const PNuoCommandBuffer& commandBuffer, const std::vector& data,
19 | std::vector& intermediate)
20 | {
21 | PNuoCommandEncoder encoder = commandBuffer->CreateRenderPassEncoder();
22 | encoder->CopyTexture(data, intermediate, std::dynamic_pointer_cast(shared_from_this()));
23 | encoder->EndEncoding();
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoMeshSceneRoot.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 |
7 | #include
8 | #include
9 | #include
10 |
11 | #include "NuoMeshCompound.h"
12 |
13 |
14 |
15 | class NuoMesh;
16 | typedef std::shared_ptr PNuoMesh;
17 |
18 |
19 |
20 | class NuoMeshSceneRoot : public NuoMeshCompound
21 | {
22 |
23 | protected:
24 |
25 | public:
26 |
27 | NuoMeshSceneRoot();
28 | NuoMeshSceneRoot(const std::vector& meshes);
29 |
30 | void ReplaceMesh(const PNuoMesh& older, const PNuoMesh& replacer);
31 |
32 | };
33 |
34 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoMeshOptions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NuoMeshOption.h
3 | // ModelViewer
4 | //
5 | // Created by middleware on 9/15/16.
6 | // Copyright © 2016 middleware. All rights reserved.
7 | //
8 |
9 |
10 | #ifndef __NuoMeshOption_h__
11 | #define __NuoMeshOption_h__
12 |
13 | class NuoMeshOptions
14 | {
15 | public:
16 | bool _textured;
17 | bool _textureEmbedMaterialTransparency;
18 | bool _texturedBump;
19 |
20 | bool _basicMaterialized;
21 | bool _combineByMaterials;
22 |
23 | bool _physicallyReflection;
24 |
25 | unsigned int _frameCount;
26 | unsigned int _sampleCount;
27 | };
28 |
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoShadowMap/NuoLightSource.h:
--------------------------------------------------------------------------------
1 | //
2 | // NuoLightSource.h
3 | // ModelViewer
4 | //
5 | // Created by Dong Feng on 11/19/16.
6 | // Ported: 9/22/21
7 | // Copyright © 2021 Dong Feng. All rights reserved.
8 | //
9 |
10 |
11 | #ifndef __NUO_LIGHT_SOURCE_H__
12 | #define __NUO_LIGHT_SOURCE_H__
13 |
14 |
15 | #include "NuoMathVector.h"
16 |
17 |
18 | struct NuoLightSource
19 | {
20 | NuoMatrixFloat44 _lightDirection;
21 |
22 | float _lightingIrradiance;
23 | float _lightingSpecular;
24 |
25 | bool _enableShadow;
26 | float _shadowSoften;
27 | float _shadowOccluderRadius;
28 | float _shadowBias;
29 |
30 | NuoLightSource();
31 | };
32 |
33 |
34 | #endif
35 |
36 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoDirect/NuoTexture.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | #include
8 | #include
9 | #include
10 |
11 | #include "NuoResource.h"
12 |
13 |
14 | class NuoCommandBuffer;
15 | typedef std::shared_ptr PNuoCommandBuffer;
16 |
17 |
18 |
19 | class NuoTexture : public NuoResource
20 | {
21 |
22 | public:
23 |
24 | NuoTexture();
25 | virtual ~NuoTexture();
26 |
27 | void Upload(const PNuoCommandBuffer& commandBuffe, const std::vector& data, std::vector& intermediate);
28 |
29 | friend class NuoSwapChain;
30 | friend class NuoDevice;
31 |
32 | };
33 |
34 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/DPIAware.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | true
11 | PerMonitorV2
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoButton.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | #include "NuoRect.h"
11 | #include "NuoControl.h"
12 |
13 |
14 | class NuoDialog;
15 | typedef std::shared_ptr PNuoDialog;
16 |
17 |
18 | class NuoButton : public NuoControl
19 | {
20 |
21 | protected:
22 |
23 | NuoButton(const PNuoDialog& parent, int controlID);
24 |
25 | public:
26 |
27 | NuoButton(const PNuoWindow& parent, const std::string& title);
28 | virtual ~NuoButton();
29 |
30 | void Init(int controlID);
31 |
32 |
33 | friend NuoDialog;
34 |
35 | };
36 |
37 |
38 | typedef std::shared_ptr PNuoButton;
39 |
40 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoCubeMesh.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | #include "NuoMeshes/NuoMesh.h"
13 | #include "NuoUtilites/NuoModelBoard.h"
14 |
15 |
16 |
17 | class NuoCubeMesh;
18 | typedef std::shared_ptr PNuoCubeMesh;
19 |
20 |
21 | class NuoCubeMesh : public NuoMeshSimple
22 | {
23 |
24 | public:
25 |
26 | NuoCubeMesh() = default;
27 |
28 | void Init(const PNuoCommandBuffer& commandBuffer,
29 | unsigned int frameCount,
30 | std::vector& intermediate,
31 | float width, float height, float depth, DXGI_FORMAT format);
32 |
33 | };
34 |
35 |
36 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoShaders/NuoMeshShadersCommon.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ifndef __MESH_SHADERS_COMMON_H__
4 | #define __MESH_SHADERS_COMMON_H__
5 |
6 | #include "NuoUniforms.h"
7 |
8 |
9 | struct Material
10 | {
11 | float3 diffuseColor;
12 | float3 specularColor;
13 | float specularPower;
14 | };
15 |
16 |
17 |
18 | inline float3 specular_common(float3 materialSpecularColor, float materialSpecularPower,
19 | NuoLightParameterUniformField lightParams,
20 | float3 normal, float3 halfway, float cosTheta)
21 | {
22 | float cosNHPower = pow(saturate(dot(normal, halfway)), materialSpecularPower);
23 | return 0.5 * cosNHPower * cosTheta * lightParams.irradiance;
24 | }
25 |
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoCubeMesh.cpp:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include "NuoCubeMesh.h"
4 | #include "NuoAppInstance.h"
5 |
6 | #include "NuoDirect/NuoShader.h"
7 | #include "NuoDirect/NuoResourceSwapChain.h"
8 |
9 | #include "NuoStrings.h"
10 | #include "NuoFile.h"
11 |
12 | #include "NuoModelLoader/NuoModelLoader.h"
13 |
14 |
15 |
16 | void NuoCubeMesh::Init(const PNuoCommandBuffer& commandBuffer,
17 | unsigned int frameCount,
18 | std::vector& intermediate,
19 | float width, float height, float depth, DXGI_FORMAT format)
20 | {
21 | PNuoModelBoard board = std::make_shared(width, height, depth);
22 | board->CreateBuffer();
23 |
24 | NuoMeshSimple::Init(commandBuffer, frameCount, intermediate, board, format);
25 | }
26 |
27 |
28 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoLabel.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | #include "NuoRect.h"
11 | #include "NuoControl.h"
12 | #include "NuoImage.h"
13 |
14 |
15 | class NuoDialog;
16 | typedef std::shared_ptr PNuoDialog;
17 |
18 |
19 | class NuoLabel : public NuoControl
20 | {
21 |
22 | PNuoImage _image;
23 |
24 | public:
25 |
26 | NuoLabel(const PNuoWindow& parent);
27 | virtual ~NuoLabel();
28 |
29 | void Init(bool image);
30 | void SetImage(const PNuoImage& image);
31 | PNuoImage Image() const;
32 |
33 | virtual void SetText(const std::string& text) override;
34 |
35 | friend NuoDialog;
36 |
37 | };
38 |
39 |
40 | typedef std::shared_ptr PNuoLabel;
41 |
42 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoShaders/NuoMeshSimpleVertex.hlsl:
--------------------------------------------------------------------------------
1 |
2 |
3 | #define __SHADER_REGISTERS__ 1
4 |
5 | #include "NuoUniforms.h"
6 | #include "NuoMeshSimple.h"
7 |
8 |
9 | NuoMeshSimpleVertexShaderOutput main(NuoMeshSimpleItem v)
10 | {
11 | NuoMeshSimpleVertexShaderOutput outVertex;
12 |
13 | float4 meshPosition = mul(meshUniforms.transform, v._position);
14 | float4 eyePosition = mul(uniforms.viewMatrixInverse, float4(0.0, 0.0, 0.0, 1.0));
15 |
16 | outVertex._position = mul(uniforms.viewProjectionMatrix, meshPosition);
17 | outVertex._eye = eyePosition.xyz - meshPosition.xyz;
18 |
19 | matrix normalMatrix = meshUniforms.normalTransform;
20 | normalMatrix[3] = float4(0, 0, 0, 1);
21 | outVertex._normal = mul(normalMatrix, v._normal);
22 |
23 | return outVertex;
24 | }
25 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoDirect/NuoShader.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | #include
8 | #include
9 | #include
10 |
11 | #include
12 |
13 | #include "NuoDevice.h"
14 |
15 | class NuoShader;
16 | typedef std::shared_ptr PNuoShader;
17 | typedef std::weak_ptr WPNuoShader;
18 |
19 |
20 | class NuoShader
21 | {
22 |
23 | Microsoft::WRL::ComPtr _dxShaderBlob;
24 |
25 |
26 | public:
27 |
28 | enum Type
29 | {
30 | kNuoShader_Vertex,
31 | kNuoShader_Pixel,
32 | kNuoShader_Lib,
33 | };
34 |
35 | NuoShader(const std::string& source,
36 | const std::string& name,
37 | NuoShader::Type type, const std::string entryPoint);
38 |
39 | D3D12_SHADER_BYTECODE ByteCode();
40 |
41 | };
42 |
43 |
--------------------------------------------------------------------------------
/NuoDirect/NuoDirect/Resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by NuoDirect.rc
4 |
5 | #define IDS_APP_TITLE 103
6 |
7 | #define IDR_MAINFRAME 128
8 | #define IDD_NUODIRECT_DIALOG 102
9 | #define IDD_ABOUTBOX 103
10 | #define IDM_ABOUT 104
11 | #define IDM_EXIT 105
12 | #define IDI_NUODIRECT 107
13 | #define IDI_SMALL 108
14 | #define IDC_NUODIRECT 109
15 | #define IDC_MYICON 2
16 | #ifndef IDC_STATIC
17 | #define IDC_STATIC -1
18 | #endif
19 | // Next default values for new objects
20 | //
21 | #ifdef APSTUDIO_INVOKED
22 | #ifndef APSTUDIO_READONLY_SYMBOLS
23 |
24 | #define _APS_NO_MFC 130
25 | #define _APS_NEXT_RESOURCE_VALUE 129
26 | #define _APS_NEXT_COMMAND_VALUE 32771
27 | #define _APS_NEXT_CONTROL_VALUE 1000
28 | #define _APS_NEXT_SYMED_VALUE 110
29 | #endif
30 | #endif
31 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoMeshRotation.h:
--------------------------------------------------------------------------------
1 | //
2 | // NuoMeshRotation.h
3 | // ModelViewer
4 | //
5 | // Created by middleware on 2/2/17.
6 | // Copyright © 2017 middleware. All rights reserved.
7 | //
8 |
9 |
10 | #ifndef __NUOMESHROTATION_H__
11 | #define __NUOMESHROTATION_H__
12 |
13 |
14 | #include "NuoMathVector.h"
15 |
16 |
17 | class NuoMeshRotation
18 | {
19 |
20 | private:
21 | float _radius;
22 | NuoMatrixFloat44 _cachedResult;
23 |
24 | void GenerateMatrices();
25 |
26 | public:
27 | NuoVectorFloat3 _transformVector;
28 | NuoVectorFloat3 _axis;
29 |
30 | NuoMeshRotation();
31 | NuoMeshRotation(const NuoMeshRotation& r);
32 |
33 | void SetRadius(float radius);
34 | float Radius() const { return _radius; }
35 | const NuoMatrixFloat44& RotationMatrix() const;
36 |
37 | };
38 |
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoDialog.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include
5 | #include
6 |
7 | #include "NuoWindow.h"
8 |
9 |
10 | class NuoDialogProc;
11 | class NuoButton;
12 |
13 | class NuoDialog : public NuoWindow
14 | {
15 | long _x;
16 | long _y;
17 | long _cx;
18 | long _cy;
19 |
20 | std::shared_ptr _okButton;
21 | std::shared_ptr _cancelButton;
22 |
23 | bool _showCancel;
24 |
25 | public:
26 |
27 | NuoDialog(const std::string& title);
28 |
29 | void SetPosition(const NuoRect& pos);
30 | void SetPosition(long x, long y, long cx, long cy);
31 | void DoModal(const PNuoWindow& parent);
32 |
33 | virtual void InitDialog();
34 | virtual void UpdateLayout();
35 |
36 | void SetShowCancel(bool show);
37 |
38 | friend NuoDialogProc;
39 |
40 | };
41 |
42 |
43 | typedef std::shared_ptr PNuoDialog;
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoTimer.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 | #include
10 |
11 |
12 | class NuoWindow;
13 | typedef std::shared_ptr PNuoWindow;
14 |
15 | class NuoTimer;
16 | typedef std::shared_ptr PNuoTimer;
17 | typedef std::weak_ptr WPNuoTimer;
18 |
19 |
20 | class NuoTimer : std::enable_shared_from_this
21 | {
22 | public:
23 |
24 | typedef std::function Func;
25 |
26 | UINT_PTR _id;
27 |
28 | unsigned int _interval;
29 | Func _function;
30 |
31 | NuoTimer(unsigned int _interval, Func timerFunc);
32 |
33 | public:
34 |
35 | friend class NuoWindow;
36 |
37 | static PNuoTimer MakeTimer(unsigned int interval, Func timeFunc);
38 | virtual bool OnTimer();
39 |
40 | virtual ~NuoTimer();
41 | };
42 |
43 |
44 |
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/AppAboutDialog.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "AppAboutDialog.h"
3 |
4 |
5 | AppAboutDialog::AppAboutDialog(const std::string& title)
6 | : NuoDialog(title)
7 | {
8 | }
9 |
10 |
11 | AppAboutDialog::~AppAboutDialog()
12 | {
13 | }
14 |
15 |
16 | void AppAboutDialog::InitDialog()
17 | {
18 | NuoDialog::InitDialog();
19 |
20 | NuoRect pos(20, 20, 98, 15);
21 |
22 | _label = std::make_shared(shared_from_this());
23 | _label->Init(false);
24 | _label->SetText("Nuo Window");
25 | _label->SetPosition(pos, false);
26 |
27 | pos.SetY((pos.Y() + pos.H() + 6));
28 | _labelCopyright = std::make_shared(shared_from_this());
29 | _labelCopyright->Init(false);
30 | _labelCopyright->SetText("Copyright (c) 2020");
31 | _labelCopyright->SetPosition(pos, false);
32 |
33 | SetShowCancel(false);
34 | }
35 |
36 | void AppAboutDialog::UpdateLayout()
37 | {
38 | NuoDialog::UpdateLayout();
39 | }
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/Resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by NuoDirect.rc
4 |
5 | #define IDS_APP_TITLE 103
6 |
7 | #define IDR_MAINFRAME 128
8 | #define IDD_NUODIRECT_DIALOG 102
9 | #define IDD_ABOUTBOX 103
10 | #define IDM_ABOUT 104
11 | #define IDM_EXIT 105
12 | #define IDM_FILE_OPEN 501
13 | #define IDC_DEVICE_LIST 601
14 | #define IDI_NUODIRECT 107
15 | #define IDI_SMALL 108
16 | #define IDC_NUODIRECT 109
17 | #define IDC_MYICON 2
18 | #ifndef IDC_STATIC
19 | #define IDC_STATIC -1
20 | #endif
21 | // Next default values for new objects
22 | //
23 | #ifdef APSTUDIO_INVOKED
24 | #ifndef APSTUDIO_READONLY_SYMBOLS
25 |
26 | #define _APS_NO_MFC 130
27 | #define _APS_NEXT_RESOURCE_VALUE 129
28 | #define _APS_NEXT_COMMAND_VALUE 32771
29 | #define _APS_NEXT_CONTROL_VALUE 1000
30 | #define _APS_NEXT_SYMED_VALUE 110
31 | #endif
32 | #endif
33 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoMeshSceneRoot.cpp:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include "NuoMeshSceneRoot.h"
4 |
5 |
6 | NuoMeshSceneRoot::NuoMeshSceneRoot()
7 | : NuoMeshCompound({})
8 | {
9 | }
10 |
11 |
12 | NuoMeshSceneRoot::NuoMeshSceneRoot(const std::vector& meshes)
13 | : NuoMeshCompound(meshes)
14 | {
15 | }
16 |
17 |
18 | void NuoMeshSceneRoot::ReplaceMesh(const PNuoMesh& meshOld, const PNuoMesh& replacer)
19 | {
20 | bool haveReplaced = false;
21 |
22 | // put the main model at the end of the draw queue,
23 | // for now it is the only one has transparency
24 | //
25 |
26 | for (unsigned int i = 0; i < _meshes.size(); ++i)
27 | {
28 | if (_meshes[i] == meshOld)
29 | {
30 | _meshes[i] = replacer;
31 | haveReplaced = true;
32 |
33 | break;
34 | }
35 | }
36 |
37 | if (!haveReplaced)
38 | _meshes.push_back(replacer);
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoMeshes/NuoShaders/NuoMeshMaterialedVertex.hlsl:
--------------------------------------------------------------------------------
1 |
2 |
3 | #define __SHADER_REGISTERS__ 1
4 |
5 | #include "NuoUniforms.h"
6 | #include "NuoMeshMaterialed.h"
7 |
8 |
9 |
10 | NuoMaterialedBasicVertexOutput main(NuoMaterialedBasicItem v)
11 | {
12 | NuoMaterialedBasicVertexOutput outVertex;
13 |
14 | float4 meshPosition = mul(meshUniforms.transform, v._position);
15 | float4 eyePosition = mul(uniforms.viewMatrixInverse, float4(0.0, 0.0, 0.0, 1.0));
16 |
17 | outVertex._position = mul(uniforms.viewProjectionMatrix, meshPosition);
18 | outVertex._eye = eyePosition.xyz - meshPosition.xyz;
19 | outVertex._diffuse = v._diffuse;
20 | outVertex._shinessDisolveIllum = v._shinessDisolveIllum;
21 |
22 | matrix normalMatrix = meshUniforms.normalTransform;
23 | normalMatrix[3] = float4(0, 0, 0, 1);
24 | outVertex._normal = mul(normalMatrix, v._normal);
25 |
26 | return outVertex;
27 | }
28 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoDirect/NuoCommandQueue.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | #include
8 | #include
9 | #include
10 |
11 | #include "NuoDirect/NuoDevice.h"
12 |
13 | class NuoCommandQueue;
14 | typedef std::shared_ptr PNuoCommandQueue;
15 |
16 | class NuoCommandBuffer;
17 | typedef std::shared_ptr PNuoCommandBuffer;
18 |
19 |
20 | class NuoCommandQueue : public std::enable_shared_from_this
21 | {
22 |
23 | PNuoDevice _device;
24 |
25 | Microsoft::WRL::ComPtr _dxQueue;
26 | std::vector _pendingCommandBuffers;
27 |
28 | public:
29 |
30 | NuoCommandQueue(const PNuoDevice& device);
31 | PNuoCommandBuffer CreateCommandBuffer();
32 |
33 | PNuoDevice Device() const;
34 | void ReleasePendingCommandBuffers();
35 |
36 | ID3D12CommandQueue* DxQueue() const;
37 |
38 | };
39 |
40 |
41 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUI/NuoListView.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | #include "NuoRect.h"
11 | #include "NuoControl.h"
12 | #include "NuoImage.h"
13 |
14 | #include "NuoWindowTypes.h"
15 |
16 |
17 | class NuoDialog;
18 | class NuoListView;
19 | typedef std::shared_ptr PNuoListView;
20 |
21 |
22 |
23 | enum NuoListProperty
24 | {
25 | kNuoList_Checkbox = 1,
26 | kNuoList_Edit = 1 << 1,
27 | };
28 |
29 |
30 |
31 | class NuoListView : public NuoControl
32 | {
33 |
34 | public:
35 |
36 | NuoListView(const PNuoWindow& parent);
37 | virtual ~NuoListView();
38 |
39 | void Init(int controlID, int properties);
40 | void AddColumn(unsigned int index, const std::string& title,
41 | unsigned int width, NuoAlign align);
42 | void AddItem(unsigned int index, unsigned int col, const std::string& str);
43 |
44 | friend NuoDialog;
45 |
46 | };
47 |
48 |
--------------------------------------------------------------------------------
/NuoWindow/NuoWindow/Resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by NuoWindow.rc
4 |
5 | #define IDS_APP_TITLE 103
6 |
7 | #define IDR_MAINFRAME 128
8 | #define IDD_NUOWINDOW_DIALOG 102
9 | #define IDD_ABOUTBOX 103
10 | #define IDM_ABOUT 104
11 | #define IDM_EXIT 105
12 | #define IDM_ICONTOOLS 201
13 | #define IDM_LISTVIEW 202
14 |
15 | #define IDB_LOADICON 301
16 | #define IDB_SAVEICON 302
17 |
18 | #define IDI_NUOWINDOW 107
19 | #define IDI_SMALL 108
20 | #define IDC_NUOWINDOW 109
21 | #define IDC_MYICON 2
22 | #ifndef IDC_STATIC
23 | #define IDC_STATIC -1
24 | #endif
25 | // Next default values for new objects
26 | //
27 | #ifdef APSTUDIO_INVOKED
28 | #ifndef APSTUDIO_READONLY_SYMBOLS
29 |
30 | #define _APS_NO_MFC 130
31 | #define _APS_NEXT_RESOURCE_VALUE 129
32 | #define _APS_NEXT_COMMAND_VALUE 32771
33 | #define _APS_NEXT_CONTROL_VALUE 1000
34 | #define _APS_NEXT_SYMED_VALUE 110
35 | #endif
36 | #endif
37 |
--------------------------------------------------------------------------------
/NuoDirect/NuoDirect/NuoDirectWindow.cpp:
--------------------------------------------------------------------------------
1 | // NuoDirect.cpp : Defines the entry point for the application.
2 | //
3 |
4 | #include "framework.h"
5 | #include "NuoDirectWindow.h"
6 |
7 | #include "NuoAppInstance.h"
8 |
9 |
10 | NuoDirectWindow::NuoDirectWindow(const std::string& title)
11 | : NuoWindow(title)
12 | {
13 | }
14 |
15 |
16 | void NuoDirectWindow::Init()
17 | {
18 | PNuoDevice currentDevice;
19 | std::set devices = NuoDevice::Devices();
20 | for (auto device : devices)
21 | {
22 | std::string name = device->Name();
23 | if (name.find("NVIDIA") != std::string::npos)
24 | currentDevice = device;
25 | }
26 |
27 | currentDevice->EnableDebugInfoQueue();
28 |
29 | _dxView = std::make_shared(currentDevice, shared_from_this());
30 | Add(_dxView);
31 |
32 | NuoInset margin(0, 0, 0, 200);
33 | _dxView->SetAutoPosition(kNuoControl_Stretch_ALL);
34 | _dxView->SetMargin(margin);
35 | }
36 |
37 |
38 | void NuoDirectWindow::OnPaint()
39 | {
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/lua/src/lundump.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lundump.h $
3 | ** load precompiled Lua chunks
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lundump_h
8 | #define lundump_h
9 |
10 | #include "llimits.h"
11 | #include "lobject.h"
12 | #include "lzio.h"
13 |
14 |
15 | /* data to catch conversion errors */
16 | #define LUAC_DATA "\x19\x93\r\n\x1a\n"
17 |
18 | #define LUAC_INT 0x5678
19 | #define LUAC_NUM cast_num(370.5)
20 |
21 | /*
22 | ** Encode major-minor version in one byte, one nibble for each
23 | */
24 | #define MYINT(s) (s[0]-'0') /* assume one-digit numerals */
25 | #define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR))
26 |
27 | #define LUAC_FORMAT 0 /* this is the official format */
28 |
29 | /* load one chunk; from lundump.c */
30 | LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name);
31 |
32 | /* dump one chunk; from ldump.c */
33 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w,
34 | void* data, int strip);
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/NuoWindowsFoundation/NuoUtilites/NuoDispatch.h:
--------------------------------------------------------------------------------
1 | //
2 | // NuoDispatch.h
3 | // ModelViewer
4 | //
5 | // Created by Dong Feng on 1/14/2021.
6 | // Copyright © 2021 middleware. All rights reserved.
7 | //
8 |
9 | #ifndef NuoDispatch_hpp
10 | #define NuoDispatch_hpp
11 |
12 |
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 |
19 |
20 | class NuoDispatch
21 | {
22 |
23 | static NuoDispatch* _dispatch;
24 |
25 | std::thread _backthread;
26 | std::queue > _works;
27 |
28 | std::mutex _mutex;
29 | std::condition_variable _condition;
30 |
31 | std::atomic _running;
32 |
33 | NuoDispatch();
34 | ~NuoDispatch();
35 |
36 | public:
37 |
38 | static NuoDispatch* GetInstance();
39 |
40 | void DispatchAsync(std::function work);
41 |
42 | private:
43 |
44 | void Execute();
45 |
46 | static void BackThreadFunc(NuoDispatch* dispatch);
47 |
48 | };
49 |
50 |
51 |
52 | #endif /* NuoDispatch_hpp */
53 |
--------------------------------------------------------------------------------
/lua/src/lprefix.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lprefix.h $
3 | ** Definitions for Lua code that must come before any other header file
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lprefix_h
8 | #define lprefix_h
9 |
10 |
11 | /*
12 | ** Allows POSIX/XSI stuff
13 | */
14 | #if !defined(LUA_USE_C89) /* { */
15 |
16 | #if !defined(_XOPEN_SOURCE)
17 | #define _XOPEN_SOURCE 600
18 | #elif _XOPEN_SOURCE == 0
19 | #undef _XOPEN_SOURCE /* use -D_XOPEN_SOURCE=0 to undefine it */
20 | #endif
21 |
22 | /*
23 | ** Allows manipulation of large files in gcc and some other compilers
24 | */
25 | #if !defined(LUA_32BITS) && !defined(_FILE_OFFSET_BITS)
26 | #define _LARGEFILE_SOURCE 1
27 | #define _FILE_OFFSET_BITS 64
28 | #endif
29 |
30 | #endif /* } */
31 |
32 |
33 | /*
34 | ** Windows stuff
35 | */
36 | #if defined(_WIN32) /* { */
37 |
38 | #if !defined(_CRT_SECURE_NO_WARNINGS)
39 | #define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */
40 | #endif
41 |
42 | #endif /* } */
43 |
44 | #endif
45 |
46 |
--------------------------------------------------------------------------------
/NuoModelViewer/NuoModelViewer/ModelState/ModelViewConfiguration.h:
--------------------------------------------------------------------------------
1 | //
2 | // ModelViewConfiguration.h
3 | // ModelViewer
4 | //
5 | // Created by Dong on 12/20/2020.
6 | // Copyright 2020 Dong FEng. All rights reserved.
7 | //
8 |
9 | #ifndef __MODEL_VIEW_CONFIGURATION_H__
10 | #define __MODEL_VIEW_CONFIGURATION_H__
11 |
12 |
13 | #include
14 | #include
15 | #include
16 | #include