diff options
| author | Yong He <yonghe@outlook.com> | 2021-03-08 10:01:20 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-08 10:01:20 -0800 |
| commit | fc9968dc4fd58fab37476f48e4405c2743c5349c (patch) | |
| tree | 6119b293a5a5cc24401dde5ff54287beb28fe63b /examples/gpu-printing/main.cpp | |
| parent | 95ca93938f5d45f4eaf340867965bd77a1724d6c (diff) | |
Refactor window library. (#1739)
* Refactor window library.
* Fix project file
* Fix warnings.
Diffstat (limited to 'examples/gpu-printing/main.cpp')
| -rw-r--r-- | examples/gpu-printing/main.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/examples/gpu-printing/main.cpp b/examples/gpu-printing/main.cpp index 63eb31a82..e95233571 100644 --- a/examples/gpu-printing/main.cpp +++ b/examples/gpu-printing/main.cpp @@ -6,7 +6,7 @@ using Slang::ComPtr; #include "slang-gfx.h" -#include "tools/graphics-app-framework/window.h" +#include "tools/platform/window.h" #include "source/core/slang-basic.h" using namespace gfx; @@ -44,7 +44,7 @@ ComPtr<slang::IModule> compileShaderModuleFromFile(slang::ISession* slangSession const SlangResult compileRes = spCompile(slangRequest); if(auto diagnostics = spGetDiagnosticOutput(slangRequest)) { - reportError("%s", diagnostics); + printf("%s", diagnostics); } if(SLANG_FAILED(compileRes)) @@ -63,7 +63,6 @@ struct ExampleProgram int gWindowWidth = 640; int gWindowHeight = 480; -gfx::ApplicationContext* gAppContext; ComPtr<gfx::IRenderer> gRenderer; ComPtr<slang::ISession> gSlangSession; @@ -151,8 +150,6 @@ Result execute() auto descriptorSet = gRenderer->createDescriptorSet(descriptorSetLayout, IDescriptorSet::Flag::Transient); if(!descriptorSet) return SLANG_FAIL; -// descriptorSet->setConstantBuffer(0, 0, gConstantBuffer); - gDescriptorSet = descriptorSet; ComputePipelineStateDesc desc; @@ -201,21 +198,12 @@ Result execute() }; -// This "inner" main function is used by the platform abstraction -// layer to deal with differences in how an entry point needs -// to be defined for different platforms. -// -void innerMain(ApplicationContext* context) +int main() { ExampleProgram app; - if (SLANG_FAILED(app.execute())) { - return exitApplication(context, 1); + return -1; } + return 0; } - -// This macro instantiates an appropriate main function to -// invoke the `innerMain` above. -// -GFX_CONSOLE_MAIN(innerMain) |
