├── .gitignore ├── .ignore ├── AUTHORS ├── CMakeLists.txt ├── Dockerfile ├── LICENSE ├── README.md ├── cmake ├── CheckTemplate.cmake ├── ClangTidy.cmake ├── CompileOptions.cmake ├── ComponentInstall.cmake ├── Cppcheck.cmake ├── Custom.cmake ├── CustomMacOSXBundleInfo.plist.in ├── FindASSIMP.cmake ├── FindEGL.cmake ├── FindFFMPEG.cmake ├── FindHIDAPI.cmake ├── Findclang_tidy.cmake ├── Findcppcheck.cmake ├── GenerateTemplateExportHeader.cmake ├── GetGitRevisionDescription.cmake ├── GetGitRevisionDescription.cmake.in ├── HealthCheck.cmake └── RuntimeDependencies.cmake ├── configure ├── data ├── gloperate-text │ └── fonts │ │ ├── opensansr36.512.512.r.ub.raw │ │ ├── opensansr36.fnt │ │ └── opensansr36.png └── gloperate │ ├── gradients │ └── colorbrewer.json │ ├── meshes │ └── demos │ │ └── multi_frame_demo.obj │ ├── qml │ ├── ClickLabel.qml │ ├── DemoPipelineInterface.qml │ ├── ExampleViewer.qml │ ├── GlOperatePipeline.qml │ ├── MainMenu.qml │ ├── PipelinePage.qml │ ├── PipelineView.qml │ ├── ScreenshotDialog.qml │ ├── SettingsPage.qml │ ├── VideoDialog.qml │ ├── Viewer.qml │ └── i18n │ │ ├── uiconcept.de.ts │ │ └── uiconcept.sv.ts │ ├── shaders │ ├── demos │ │ ├── colorize.frag │ │ ├── demo.frag │ │ ├── demo.vert │ │ ├── gradient.frag │ │ ├── gradient.vert │ │ ├── lights.frag │ │ ├── lights.geom │ │ ├── lights.vert │ │ ├── multi_frame_postprocessing.frag │ │ ├── multi_frame_rendering.frag │ │ ├── multi_frame_rendering.vert │ │ ├── transparency.frag │ │ └── transparency.vert │ ├── geometry │ │ ├── geometry.frag │ │ ├── geometry.vert │ │ ├── screenaligned.frag │ │ ├── screenaligned.vert │ │ └── screenaligned_inverted.frag │ ├── lighting │ │ ├── lightprocessing.glsl │ │ ├── lightprocessing_diffuse.glsl │ │ ├── lightprocessing_phong.glsl │ │ └── ssao.glsl │ └── util │ │ └── random.glsl │ ├── textures │ ├── gloperate-logo.glraw │ └── gloperate-logo.png │ └── video_profiles │ ├── avi.json │ ├── avi_raw.json │ └── flv.json ├── deploy ├── CMakeLists.txt ├── packages │ └── pack-gloperate.cmake └── ubuntu-ppa │ ├── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── rules │ └── source │ │ └── format │ └── recipe.txt ├── docs ├── CMakeLists.txt ├── api-docs │ ├── CMakeLists.txt │ ├── doxyfile.in │ ├── extra_files │ │ ├── bc_s.png │ │ ├── bdwn.png │ │ ├── clclosed.png │ │ ├── clopen.png │ │ ├── closed.png │ │ ├── ftv2blank.png │ │ ├── ftv2cl.png │ │ ├── ftv2doc.png │ │ ├── ftv2folderclosed.png │ │ ├── ftv2folderopen.png │ │ ├── ftv2lastnode.png │ │ ├── ftv2link.png │ │ ├── ftv2mlastnode.png │ │ ├── ftv2mnode.png │ │ ├── ftv2mo.png │ │ ├── ftv2node.png │ │ ├── ftv2ns.png │ │ ├── ftv2plastnode.png │ │ ├── ftv2pnode.png │ │ ├── ftv2splitbar.png │ │ ├── ftv2vertline.png │ │ ├── navtree.css │ │ ├── open.png │ │ ├── search │ │ │ └── search.css │ │ ├── sync_off.png │ │ └── sync_on.png │ ├── footer.html │ ├── header.html │ ├── include │ │ └── mainpage.html │ ├── layout.xml │ ├── mainpage.h │ ├── namespacedocumentation.h │ └── qmi.css ├── ffmpeg-docs │ └── readme.md └── implementation-details │ ├── CameraUtils.pdf │ ├── CameraUtils.tex │ ├── fovyConversion.pdf │ └── projections.pdf ├── gloperate-config.cmake ├── gloperate-logo.png ├── gloperate-logo.svg └── source ├── CMakeLists.txt ├── applications ├── CMakeLists.txt └── gloperate-viewer │ ├── CMakeLists.txt │ └── main.cpp ├── codegeneration ├── gloperate_features.h ├── template_api.h.in └── template_msvc_api.h.in ├── examples ├── CMakeLists.txt ├── demo-stages-plugins │ ├── AssimpMeshLoader.cpp │ ├── AssimpMeshLoader.h │ ├── CMakeLists.txt │ ├── ColorGradientDemo.cpp │ ├── ColorGradientDemo.h │ ├── DemoMultiFrameAggregationPipeline.cpp │ ├── DemoMultiFrameAggregationPipeline.h │ ├── DemoMultiFrameEffectsPipeline.cpp │ ├── DemoMultiFrameEffectsPipeline.h │ ├── DemoTextRenderingPipeline.cpp │ ├── DemoTextRenderingPipeline.h │ ├── GeometryImporterStage.cpp │ ├── GeometryImporterStage.h │ ├── GlyphSequenceDemoStage.cpp │ ├── GlyphSequenceDemoStage.h │ ├── LightTestPipeline.cpp │ ├── LightTestPipeline.h │ ├── MultiFrameRenderingPipeline.cpp │ ├── MultiFrameRenderingPipeline.h │ ├── ShaderDemoPipeline.cpp │ ├── ShaderDemoPipeline.h │ ├── ShapeDemo.cpp │ ├── ShapeDemo.h │ ├── TransparencyRenderingPipeline.cpp │ └── TransparencyRenderingPipeline.h ├── gloperate-ffmpeg-example │ ├── CMakeLists.txt │ └── main.cpp ├── gloperate-glfw-example │ ├── CMakeLists.txt │ └── main.cpp ├── gloperate-headless-example │ ├── CMakeLists.txt │ └── main.cpp ├── gloperate-qt-example │ ├── CMakeLists.txt │ └── main.cpp ├── gloperate-qtquick-example │ ├── CMakeLists.txt │ └── main.cpp └── gloperate-videotool-example │ ├── CMakeLists.txt │ └── main.cpp ├── gloperate-glfw ├── CMakeLists.txt ├── include │ └── gloperate-glfw │ │ ├── Application.h │ │ ├── GLContext.h │ │ ├── GLContextFactory.h │ │ ├── RenderWindow.h │ │ ├── Window.h │ │ ├── WindowEvent.h │ │ └── WindowEventDispatcher.h └── source │ ├── Application.cpp │ ├── GLContext.cpp │ ├── GLContextFactory.cpp │ ├── RenderWindow.cpp │ ├── Window.cpp │ ├── WindowEvent.cpp │ └── WindowEventDispatcher.cpp ├── gloperate-glkernel ├── CMakeLists.txt ├── include │ └── gloperate-glkernel │ │ └── stages │ │ ├── DiscDistributionKernelStage.h │ │ ├── HemisphereDistributionKernelStage.h │ │ ├── IntermediateFramePreparationStage.h │ │ ├── KernelToPointInPlaneStage.h │ │ ├── MultiFrameAggregationPipeline.h │ │ ├── MultiFrameAggregationPipeline.inl │ │ ├── MultiFrameAggregationStage.h │ │ ├── MultiFrameControlStage.h │ │ ├── NoiseKernelStage.h │ │ └── TransparencyKernelStage.h └── source │ └── stages │ ├── DiscDistributionKernelStage.cpp │ ├── HemisphereDistributionKernelStage.cpp │ ├── IntermediateFramePreparationStage.cpp │ ├── KernelToPointInPlaneStage.cpp │ ├── MultiFrameAggregationPipeline.cpp │ ├── MultiFrameAggregationStage.cpp │ ├── MultiFrameControlStage.cpp │ ├── NoiseKernelStage.cpp │ └── TransparencyKernelStage.cpp ├── gloperate-headless ├── CMakeLists.txt ├── include │ └── gloperate-headless │ │ ├── Application.h │ │ ├── GLContext.h │ │ ├── GLContextFactory.h │ │ ├── RenderSurface.h │ │ ├── Surface.h │ │ ├── SurfaceEvent.h │ │ └── getProcAddress.h └── source │ ├── Application.cpp │ ├── GLContext.cpp │ ├── GLContextFactory.cpp │ ├── RenderSurface.cpp │ ├── Surface.cpp │ ├── SurfaceEvent.cpp │ └── getProcAddress.cpp ├── gloperate-hidapi ├── CMakeLists.txt ├── include │ └── gloperate-hidapi │ │ ├── HIDDeviceProvider.h │ │ └── SpaceNavigator.h └── source │ ├── HIDDeviceProvider.cpp │ └── SpaceNavigator.cpp ├── gloperate-qt ├── CMakeLists.txt ├── include │ └── gloperate-qt │ │ ├── base │ │ ├── Application.h │ │ ├── Converter.h │ │ ├── GLContext.h │ │ ├── GLContextFactory.h │ │ ├── OpenGLWindow.h │ │ ├── QtOpenGL.h │ │ └── RenderWindow.h │ │ ├── loaders │ │ ├── QtImageLoader.h │ │ ├── QtImageStorer.h │ │ ├── QtTextureLoader.h │ │ └── QtTextureStorer.h │ │ └── scripting │ │ ├── ECMA26251Completer.h │ │ ├── ECMA26251SyntaxHighlighter.h │ │ ├── ScriptCompleter.h │ │ ├── ScriptPromptWidget.h │ │ └── ScriptSyntaxHighlighter.h └── source │ ├── base │ ├── Application.cpp │ ├── Converter.cpp │ ├── GLContext.cpp │ ├── GLContextFactory.cpp │ ├── GLContext_qt.cpp │ ├── OpenGLWindow.cpp │ ├── QtOpenGL.cpp │ └── RenderWindow.cpp │ ├── loaders │ ├── QtImageLoader.cpp │ ├── QtImageStorer.cpp │ ├── QtTextureLoader.cpp │ └── QtTextureStorer.cpp │ └── scripting │ ├── ECMA26251Completer.cpp │ ├── ECMA26251SyntaxHighlighter.cpp │ ├── ScriptCompleter.cpp │ ├── ScriptPromptWidget.cpp │ └── ScriptSyntaxHighlighter.cpp ├── gloperate-qtquick ├── CMakeLists.txt ├── include │ └── gloperate-qtquick │ │ ├── Application.h │ │ ├── QmlEngine.h │ │ ├── QmlObjectWrapper.h │ │ ├── QmlScriptContext.h │ │ ├── QmlScriptFunction.h │ │ ├── RenderItem.h │ │ ├── RenderItemRenderer.h │ │ ├── TextController.h │ │ ├── TextureItem.h │ │ ├── TextureItemRenderer.h │ │ ├── Utils.h │ │ └── VideoProfile.h └── source │ ├── Application.cpp │ ├── QmlEngine.cpp │ ├── QmlObjectWrapper.cpp │ ├── QmlScriptContext.cpp │ ├── QmlScriptFunction.cpp │ ├── RenderItem.cpp │ ├── RenderItemRenderer.cpp │ ├── RenderItemRenderer_ogl.cpp │ ├── TextController.cpp │ ├── TextureItem.cpp │ ├── TextureItemRenderer.cpp │ ├── TextureItemRenderer_ogl.cpp │ ├── Utils.cpp │ └── VideoProfile.cpp ├── gloperate-text ├── CMakeLists.txt ├── include │ └── gloperate-text │ │ ├── FontLoader.h │ │ └── stages │ │ ├── FontImporterStage.h │ │ ├── GlyphPreparationStage.h │ │ └── GlyphRenderStage.h └── source │ ├── FontLoader.cpp │ └── stages │ ├── FontImporterStage.cpp │ ├── GlyphPreparationStage.cpp │ └── GlyphRenderStage.cpp ├── gloperate ├── CMakeLists.txt ├── include │ └── gloperate │ │ ├── base │ │ ├── AbstractComponent.h │ │ ├── AbstractComponent.inl │ │ ├── AbstractContext.h │ │ ├── AbstractGLContext.h │ │ ├── AbstractGLContextFactory.h │ │ ├── AbstractLoader.h │ │ ├── AbstractStorer.h │ │ ├── AutoTimer.h │ │ ├── CachedValue.h │ │ ├── CachedValue.inl │ │ ├── Canvas.h │ │ ├── ChronoTimer.h │ │ ├── Component.h │ │ ├── Component.inl │ │ ├── ComponentManager.h │ │ ├── Environment.h │ │ ├── ExtendedProperties.h │ │ ├── ExtendedProperties.inl │ │ ├── GLContextFormat.h │ │ ├── GLContextUtils.h │ │ ├── Loader.h │ │ ├── Loader.inl │ │ ├── Range.h │ │ ├── ResourceManager.h │ │ ├── ResourceManager.inl │ │ ├── Storer.h │ │ ├── Storer.inl │ │ ├── System.h │ │ └── TimerManager.h │ │ ├── gloperate.h │ │ ├── input │ │ ├── AbstractDevice.h │ │ ├── AbstractDeviceProvider.h │ │ ├── AbstractEventConsumer.h │ │ ├── AxisEvent.h │ │ ├── ButtonEvent.h │ │ ├── InputEvent.h │ │ ├── InputManager.h │ │ ├── KeyboardDevice.h │ │ ├── MouseDevice.h │ │ ├── MouseEvent.h │ │ ├── PrintLineConsumer.h │ │ └── constants.h │ │ ├── loaders │ │ ├── ColorGradientLoader.h │ │ ├── GlrawTextureLoader.h │ │ ├── RawFileNameSuffix.h │ │ └── ShaderLoader.h │ │ ├── pipeline │ │ ├── AbstractSlot.h │ │ ├── AbstractSlot.inl │ │ ├── Input.h │ │ ├── Input.inl │ │ ├── Output.h │ │ ├── Output.inl │ │ ├── Pipeline.h │ │ ├── Slot.h │ │ ├── Slot.inl │ │ ├── Stage.h │ │ └── Stage.inl │ │ ├── rendering │ │ ├── AbstractColorGradient.h │ │ ├── AbstractColorGradient.inl │ │ ├── AbstractDrawable.h │ │ ├── AbstractRenderTarget.h │ │ ├── AttachmentType.h │ │ ├── Box.h │ │ ├── Camera.h │ │ ├── CameraUtils.h │ │ ├── Color.h │ │ ├── ColorGradientList.h │ │ ├── ColorGradientList.inl │ │ ├── ColorRenderTarget.h │ │ ├── DepthRenderTarget.h │ │ ├── DepthStencilRenderTarget.h │ │ ├── Drawable.h │ │ ├── Drawable.inl │ │ ├── Icosahedron.h │ │ ├── Image.h │ │ ├── Light.h │ │ ├── LightType.h │ │ ├── LinearColorGradient.h │ │ ├── LinearColorGradient.inl │ │ ├── NoiseTexture.h │ │ ├── Point.h │ │ ├── Quad.h │ │ ├── RenderPass.h │ │ ├── RenderTargetType.h │ │ ├── ScreenAlignedQuad.h │ │ ├── ScreenAlignedTriangle.h │ │ ├── Shape.h │ │ ├── ShapeType.h │ │ ├── Sphere.h │ │ ├── StencilRenderTarget.h │ │ ├── TransparencyMasksGenerator.h │ │ └── Triangle.h │ │ ├── stages │ │ ├── base │ │ │ ├── BasicFramebufferStage.h │ │ │ ├── BlitStage.h │ │ │ ├── ClearStage.h │ │ │ ├── ColorGradientSelectionStage.h │ │ │ ├── ColorGradientStage.h │ │ │ ├── ColorGradientTextureStage.h │ │ │ ├── CubeMapProjectionsStage.h │ │ │ ├── FloatSelectionStage.h │ │ │ ├── ProgramStage.h │ │ │ ├── RasterizationStage.h │ │ │ ├── RenderPassStage.h │ │ │ ├── RenderbufferRenderTargetStage.h │ │ │ ├── ShaderStage.h │ │ │ ├── ShapeStage.h │ │ │ ├── TextureFromRenderTargetExtractionStage.h │ │ │ ├── TextureLoadStage.h │ │ │ ├── TextureRenderTargetStage.h │ │ │ ├── TimerStage.h │ │ │ ├── TransformStage.h │ │ │ ├── VectorSelectionStage.h │ │ │ ├── VectorSelectionStage.inl │ │ │ └── ViewportScaleStage.h │ │ ├── interfaces │ │ │ ├── CanvasInterface.h │ │ │ └── RenderInterface.h │ │ ├── lights │ │ │ ├── LightBufferTextureStage.h │ │ │ └── LightCreationStage.h │ │ └── navigation │ │ │ └── TrackballStage.h │ │ └── tools │ │ ├── AbstractVideoExporter.h │ │ └── ImageExporter.h └── source │ ├── base │ ├── AbstractComponent.cpp │ ├── AbstractContext.cpp │ ├── AbstractGLContext.cpp │ ├── AbstractGLContextFactory.cpp │ ├── AbstractLoader.cpp │ ├── AbstractStorer.cpp │ ├── AutoTimer.cpp │ ├── Canvas.cpp │ ├── ChronoTimer.cpp │ ├── ComponentManager.cpp │ ├── Environment.cpp │ ├── ExtendedProperties.cpp │ ├── GLContextFormat.cpp │ ├── GLContextUtils.cpp │ ├── Range.cpp │ ├── ResourceManager.cpp │ ├── System.cpp │ └── TimerManager.cpp │ ├── gloperate.cpp │ ├── input │ ├── AbstractDevice.cpp │ ├── AbstractDeviceProvider.cpp │ ├── AbstractEventConsumer.cpp │ ├── AxisEvent.cpp │ ├── ButtonEvent.cpp │ ├── InputEvent.cpp │ ├── InputManager.cpp │ ├── KeyboardDevice.cpp │ ├── MouseDevice.cpp │ ├── MouseEvent.cpp │ └── PrintLineConsumer.cpp │ ├── loaders │ ├── ColorGradientLoader.cpp │ ├── GlrawTextureLoader.cpp │ ├── RawFileNameSuffix.cpp │ └── ShaderLoader.cpp │ ├── pipeline │ ├── AbstractSlot.cpp │ ├── Pipeline.cpp │ └── Stage.cpp │ ├── rendering │ ├── AbstractColorGradient.cpp │ ├── AbstractDrawable.cpp │ ├── AbstractRenderTarget.cpp │ ├── Box.cpp │ ├── Camera.cpp │ ├── CameraUtils.cpp │ ├── Color.cpp │ ├── ColorGradientList.cpp │ ├── ColorRenderTarget.cpp │ ├── DepthRenderTarget.cpp │ ├── DepthStencilRenderTarget.cpp │ ├── Drawable.cpp │ ├── Icosahedron.cpp │ ├── Image.cpp │ ├── LinearColorGradient.cpp │ ├── NoiseTexture.cpp │ ├── Point.cpp │ ├── Quad.cpp │ ├── RenderPass.cpp │ ├── ScreenAlignedQuad.cpp │ ├── ScreenAlignedTriangle.cpp │ ├── Shape.cpp │ ├── Sphere.cpp │ ├── StencilRenderTarget.cpp │ ├── TransparencyMasksGenerator.cpp │ └── Triangle.cpp │ ├── stages │ ├── base │ │ ├── BasicFramebufferStage.cpp │ │ ├── BlitStage.cpp │ │ ├── ClearStage.cpp │ │ ├── ColorGradientSelectionStage.cpp │ │ ├── ColorGradientStage.cpp │ │ ├── ColorGradientTextureStage.cpp │ │ ├── CubeMapProjectionsStage.cpp │ │ ├── FloatSelectionStage.cpp │ │ ├── ProgramStage.cpp │ │ ├── RasterizationStage.cpp │ │ ├── RenderPassStage.cpp │ │ ├── RenderbufferRenderTargetStage.cpp │ │ ├── ShaderStage.cpp │ │ ├── ShapeStage.cpp │ │ ├── TextureFromRenderTargetExtractionStage.cpp │ │ ├── TextureLoadStage.cpp │ │ ├── TextureRenderTargetStage.cpp │ │ ├── TimerStage.cpp │ │ ├── TransformStage.cpp │ │ └── ViewportScaleStage.cpp │ ├── interfaces │ │ ├── CanvasInterface.cpp │ │ └── RenderInterface.cpp │ ├── lights │ │ ├── LightBufferTextureStage.cpp │ │ └── LightCreationStage.cpp │ └── navigation │ │ └── TrackballStage.cpp │ └── tools │ ├── AbstractVideoExporter.cpp │ └── ImageExporter.cpp ├── plugins ├── CMakeLists.txt └── gloperate-ffmpeg-exporter │ ├── CMakeLists.txt │ ├── FFMPEGVideoEncoder.cpp │ ├── FFMPEGVideoEncoder.h │ ├── FFMPEGVideoExporter.cpp │ └── FFMPEGVideoExporter.h ├── tests ├── CMakeLists.txt └── googletest │ ├── .travis.yml │ ├── CMakeLists.txt │ ├── README.md │ ├── googlemock │ ├── CHANGES │ ├── CMakeLists.txt │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── Makefile.am │ ├── README.md │ ├── configure.ac │ ├── docs │ │ ├── CheatSheet.md │ │ ├── CookBook.md │ │ ├── DesignDoc.md │ │ ├── DevGuide.md │ │ ├── Documentation.md │ │ ├── ForDummies.md │ │ ├── FrequentlyAskedQuestions.md │ │ ├── KnownIssues.md │ │ ├── v1_5 │ │ │ ├── CheatSheet.md │ │ │ ├── CookBook.md │ │ │ ├── Documentation.md │ │ │ ├── ForDummies.md │ │ │ └── FrequentlyAskedQuestions.md │ │ ├── v1_6 │ │ │ ├── CheatSheet.md │ │ │ ├── CookBook.md │ │ │ ├── Documentation.md │ │ │ ├── ForDummies.md │ │ │ └── FrequentlyAskedQuestions.md │ │ └── v1_7 │ │ │ ├── CheatSheet.md │ │ │ ├── CookBook.md │ │ │ ├── Documentation.md │ │ │ ├── ForDummies.md │ │ │ └── FrequentlyAskedQuestions.md │ ├── include │ │ └── gmock │ │ │ ├── gmock-actions.h │ │ │ ├── gmock-cardinalities.h │ │ │ ├── gmock-generated-actions.h │ │ │ ├── gmock-generated-actions.h.pump │ │ │ ├── gmock-generated-function-mockers.h │ │ │ ├── gmock-generated-function-mockers.h.pump │ │ │ ├── gmock-generated-matchers.h │ │ │ ├── gmock-generated-matchers.h.pump │ │ │ ├── gmock-generated-nice-strict.h │ │ │ ├── gmock-generated-nice-strict.h.pump │ │ │ ├── gmock-matchers.h │ │ │ ├── gmock-more-actions.h │ │ │ ├── gmock-more-matchers.h │ │ │ ├── gmock-spec-builders.h │ │ │ ├── gmock.h │ │ │ └── internal │ │ │ ├── custom │ │ │ ├── gmock-generated-actions.h │ │ │ ├── gmock-generated-actions.h.pump │ │ │ ├── gmock-matchers.h │ │ │ └── gmock-port.h │ │ │ ├── gmock-generated-internal-utils.h │ │ │ ├── gmock-generated-internal-utils.h.pump │ │ │ ├── gmock-internal-utils.h │ │ │ └── gmock-port.h │ ├── make │ │ └── Makefile │ ├── msvc │ │ ├── 2005 │ │ │ ├── gmock.sln │ │ │ ├── gmock.vcproj │ │ │ ├── gmock_config.vsprops │ │ │ ├── gmock_main.vcproj │ │ │ └── gmock_test.vcproj │ │ └── 2010 │ │ │ ├── gmock.sln │ │ │ ├── gmock.vcxproj │ │ │ ├── gmock_config.props │ │ │ ├── gmock_main.vcxproj │ │ │ └── gmock_test.vcxproj │ ├── scripts │ │ ├── fuse_gmock_files.py │ │ ├── generator │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── README.cppclean │ │ │ ├── cpp │ │ │ │ ├── __init__.py │ │ │ │ ├── ast.py │ │ │ │ ├── gmock_class.py │ │ │ │ ├── gmock_class_test.py │ │ │ │ ├── keywords.py │ │ │ │ ├── tokenize.py │ │ │ │ └── utils.py │ │ │ └── gmock_gen.py │ │ ├── gmock-config.in │ │ ├── gmock_doctor.py │ │ ├── upload.py │ │ └── upload_gmock.py │ ├── src │ │ ├── gmock-all.cc │ │ ├── gmock-cardinalities.cc │ │ ├── gmock-internal-utils.cc │ │ ├── gmock-matchers.cc │ │ ├── gmock-spec-builders.cc │ │ ├── gmock.cc │ │ └── gmock_main.cc │ └── test │ │ ├── gmock-actions_test.cc │ │ ├── gmock-cardinalities_test.cc │ │ ├── gmock-generated-actions_test.cc │ │ ├── gmock-generated-function-mockers_test.cc │ │ ├── gmock-generated-internal-utils_test.cc │ │ ├── gmock-generated-matchers_test.cc │ │ ├── gmock-internal-utils_test.cc │ │ ├── gmock-matchers_test.cc │ │ ├── gmock-more-actions_test.cc │ │ ├── gmock-nice-strict_test.cc │ │ ├── gmock-port_test.cc │ │ ├── gmock-spec-builders_test.cc │ │ ├── gmock_all_test.cc │ │ ├── gmock_ex_test.cc │ │ ├── gmock_leak_test.py │ │ ├── gmock_leak_test_.cc │ │ ├── gmock_link2_test.cc │ │ ├── gmock_link_test.cc │ │ ├── gmock_link_test.h │ │ ├── gmock_output_test.py │ │ ├── gmock_output_test_.cc │ │ ├── gmock_output_test_golden.txt │ │ ├── gmock_stress_test.cc │ │ ├── gmock_test.cc │ │ └── gmock_test_utils.py │ ├── googletest │ ├── CHANGES │ ├── CMakeLists.txt │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── Makefile.am │ ├── README.md │ ├── cmake │ │ └── internal_utils.cmake │ ├── codegear │ │ ├── gtest.cbproj │ │ ├── gtest.groupproj │ │ ├── gtest_all.cc │ │ ├── gtest_link.cc │ │ ├── gtest_main.cbproj │ │ └── gtest_unittest.cbproj │ ├── configure.ac │ ├── docs │ │ ├── AdvancedGuide.md │ │ ├── DevGuide.md │ │ ├── Documentation.md │ │ ├── FAQ.md │ │ ├── Primer.md │ │ ├── PumpManual.md │ │ ├── Samples.md │ │ ├── V1_5_AdvancedGuide.md │ │ ├── V1_5_Documentation.md │ │ ├── V1_5_FAQ.md │ │ ├── V1_5_Primer.md │ │ ├── V1_5_PumpManual.md │ │ ├── V1_5_XcodeGuide.md │ │ ├── V1_6_AdvancedGuide.md │ │ ├── V1_6_Documentation.md │ │ ├── V1_6_FAQ.md │ │ ├── V1_6_Primer.md │ │ ├── V1_6_PumpManual.md │ │ ├── V1_6_Samples.md │ │ ├── V1_6_XcodeGuide.md │ │ ├── V1_7_AdvancedGuide.md │ │ ├── V1_7_Documentation.md │ │ ├── V1_7_FAQ.md │ │ ├── V1_7_Primer.md │ │ ├── V1_7_PumpManual.md │ │ ├── V1_7_Samples.md │ │ ├── V1_7_XcodeGuide.md │ │ └── XcodeGuide.md │ ├── include │ │ └── gtest │ │ │ ├── gtest-death-test.h │ │ │ ├── gtest-message.h │ │ │ ├── gtest-param-test.h │ │ │ ├── gtest-param-test.h.pump │ │ │ ├── gtest-printers.h │ │ │ ├── gtest-spi.h │ │ │ ├── gtest-test-part.h │ │ │ ├── gtest-typed-test.h │ │ │ ├── gtest.h │ │ │ ├── gtest_pred_impl.h │ │ │ ├── gtest_prod.h │ │ │ └── internal │ │ │ ├── custom │ │ │ ├── gtest-port.h │ │ │ ├── gtest-printers.h │ │ │ └── gtest.h │ │ │ ├── gtest-death-test-internal.h │ │ │ ├── gtest-filepath.h │ │ │ ├── gtest-internal.h │ │ │ ├── gtest-linked_ptr.h │ │ │ ├── gtest-param-util-generated.h │ │ │ ├── gtest-param-util-generated.h.pump │ │ │ ├── gtest-param-util.h │ │ │ ├── gtest-port-arch.h │ │ │ ├── gtest-port.h │ │ │ ├── gtest-string.h │ │ │ ├── gtest-tuple.h │ │ │ ├── gtest-tuple.h.pump │ │ │ ├── gtest-type-util.h │ │ │ └── gtest-type-util.h.pump │ ├── m4 │ │ ├── acx_pthread.m4 │ │ └── gtest.m4 │ ├── make │ │ └── Makefile │ ├── msvc │ │ ├── gtest-md.sln │ │ ├── gtest-md.vcproj │ │ ├── gtest.sln │ │ ├── gtest.vcproj │ │ ├── gtest_main-md.vcproj │ │ ├── gtest_main.vcproj │ │ ├── gtest_prod_test-md.vcproj │ │ ├── gtest_prod_test.vcproj │ │ ├── gtest_unittest-md.vcproj │ │ └── gtest_unittest.vcproj │ ├── samples │ │ ├── prime_tables.h │ │ ├── sample1.cc │ │ ├── sample1.h │ │ ├── sample10_unittest.cc │ │ ├── sample1_unittest.cc │ │ ├── sample2.cc │ │ ├── sample2.h │ │ ├── sample2_unittest.cc │ │ ├── sample3-inl.h │ │ ├── sample3_unittest.cc │ │ ├── sample4.cc │ │ ├── sample4.h │ │ ├── sample4_unittest.cc │ │ ├── sample5_unittest.cc │ │ ├── sample6_unittest.cc │ │ ├── sample7_unittest.cc │ │ ├── sample8_unittest.cc │ │ └── sample9_unittest.cc │ ├── scripts │ │ ├── common.py │ │ ├── fuse_gtest_files.py │ │ ├── gen_gtest_pred_impl.py │ │ ├── gtest-config.in │ │ ├── pump.py │ │ ├── release_docs.py │ │ ├── test │ │ │ └── Makefile │ │ ├── upload.py │ │ └── upload_gtest.py │ ├── src │ │ ├── gtest-all.cc │ │ ├── gtest-death-test.cc │ │ ├── gtest-filepath.cc │ │ ├── gtest-internal-inl.h │ │ ├── gtest-port.cc │ │ ├── gtest-printers.cc │ │ ├── gtest-test-part.cc │ │ ├── gtest-typed-test.cc │ │ ├── gtest.cc │ │ └── gtest_main.cc │ ├── test │ │ ├── gtest-death-test_ex_test.cc │ │ ├── gtest-death-test_test.cc │ │ ├── gtest-filepath_test.cc │ │ ├── gtest-linked_ptr_test.cc │ │ ├── gtest-listener_test.cc │ │ ├── gtest-message_test.cc │ │ ├── gtest-options_test.cc │ │ ├── gtest-param-test2_test.cc │ │ ├── gtest-param-test_test.cc │ │ ├── gtest-param-test_test.h │ │ ├── gtest-port_test.cc │ │ ├── gtest-printers_test.cc │ │ ├── gtest-test-part_test.cc │ │ ├── gtest-tuple_test.cc │ │ ├── gtest-typed-test2_test.cc │ │ ├── gtest-typed-test_test.cc │ │ ├── gtest-typed-test_test.h │ │ ├── gtest-unittest-api_test.cc │ │ ├── gtest_all_test.cc │ │ ├── gtest_break_on_failure_unittest.py │ │ ├── gtest_break_on_failure_unittest_.cc │ │ ├── gtest_catch_exceptions_test.py │ │ ├── gtest_catch_exceptions_test_.cc │ │ ├── gtest_color_test.py │ │ ├── gtest_color_test_.cc │ │ ├── gtest_env_var_test.py │ │ ├── gtest_env_var_test_.cc │ │ ├── gtest_environment_test.cc │ │ ├── gtest_filter_unittest.py │ │ ├── gtest_filter_unittest_.cc │ │ ├── gtest_help_test.py │ │ ├── gtest_help_test_.cc │ │ ├── gtest_list_tests_unittest.py │ │ ├── gtest_list_tests_unittest_.cc │ │ ├── gtest_main_unittest.cc │ │ ├── gtest_no_test_unittest.cc │ │ ├── gtest_output_test.py │ │ ├── gtest_output_test_.cc │ │ ├── gtest_output_test_golden_lin.txt │ │ ├── gtest_pred_impl_unittest.cc │ │ ├── gtest_premature_exit_test.cc │ │ ├── gtest_prod_test.cc │ │ ├── gtest_repeat_test.cc │ │ ├── gtest_shuffle_test.py │ │ ├── gtest_shuffle_test_.cc │ │ ├── gtest_sole_header_test.cc │ │ ├── gtest_stress_test.cc │ │ ├── gtest_test_utils.py │ │ ├── gtest_throw_on_failure_ex_test.cc │ │ ├── gtest_throw_on_failure_test.py │ │ ├── gtest_throw_on_failure_test_.cc │ │ ├── gtest_uninitialized_test.py │ │ ├── gtest_uninitialized_test_.cc │ │ ├── gtest_unittest.cc │ │ ├── gtest_xml_outfile1_test_.cc │ │ ├── gtest_xml_outfile2_test_.cc │ │ ├── gtest_xml_outfiles_test.py │ │ ├── gtest_xml_output_unittest.py │ │ ├── gtest_xml_output_unittest_.cc │ │ ├── gtest_xml_test_utils.py │ │ ├── production.cc │ │ └── production.h │ └── xcode │ │ ├── Config │ │ ├── DebugProject.xcconfig │ │ ├── FrameworkTarget.xcconfig │ │ ├── General.xcconfig │ │ ├── ReleaseProject.xcconfig │ │ ├── StaticLibraryTarget.xcconfig │ │ └── TestTarget.xcconfig │ │ ├── Resources │ │ └── Info.plist │ │ ├── Samples │ │ └── FrameworkSample │ │ │ ├── Info.plist │ │ │ ├── WidgetFramework.xcodeproj │ │ │ └── project.pbxproj │ │ │ ├── runtests.sh │ │ │ ├── widget.cc │ │ │ ├── widget.h │ │ │ └── widget_test.cc │ │ ├── Scripts │ │ ├── runtests.sh │ │ └── versiongenerate.py │ │ └── gtest.xcodeproj │ │ └── project.pbxproj │ └── travis.sh └── version.h.in /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | 15 | # Build dir 16 | build* 17 | debug_build 18 | release_build 19 | /bin 20 | /lib 21 | /install 22 | 23 | # Qt cache 24 | CMakeLists.txt.user 25 | CMakeLists.txt.user.* 26 | *.qmlc 27 | 28 | # IDE project files 29 | *.sublime-project 30 | *.sublime-workspace 31 | .vscode 32 | 33 | # Local config windows 34 | _configure*.bat 35 | _open-project*.bat 36 | _start-cmake-gui*.bat 37 | _start-cmd*.bat 38 | 39 | # Local config unix 40 | .localconfig 41 | -------------------------------------------------------------------------------- /.ignore: -------------------------------------------------------------------------------- 1 | source/tests/googletest/* 2 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | 2 | Stefan Buschmann 3 | Willy Scheibel 4 | Daniel Limberger 5 | 6 | 7 | Thanks to all Contributors 8 | 9 | sebastiankaybelle 10 | JenniferStamm 11 | apopiak 12 | Somae 13 | lordgeorg 14 | dommueller 15 | dgimb89 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2014-2016 Computer Graphics Systems Group at the Hasso-Plattner-Institute, Germany. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | *gloperate* is a cross-platform C++ library for defining and controlling modern GPU rendering/processing operations. 5 | 6 | ![GitHub release](https://img.shields.io/github/release/cginternals/gloperate.svg) 7 | [![Travis](https://img.shields.io/travis/cginternals/gloperate/master.svg?style=flat&logo=travis)](https://travis-ci.org/cginternals/gloperate) 8 | [![Appveyor](https://img.shields.io/appveyor/ci/scheibel/gloperate/master.svg?style=flat&logo=appveyor)](https://ci.appveyor.com/project/scheibel/gloperate/branch/master) 9 | [![Tokei](https://tokei.rs/b1/github/cginternals/gloperate)](https://github.com/Aaronepower/tokei) 10 | 11 | 12 | ### Dependencies 13 | 14 | The following dev-libraries and programs need to be provided for correct CMake configuration: 15 | * C++11 compatible compiler (e.g. gcc >=4.7, MSVC >=2013) 16 | * CMake (>=2.8.9, better 2.8.12): http://www.cmake.org/ 17 | * OpenGL C++ Bindings (glbinding >=1.0.0): https://github.com/cginternals/glbinding 18 | * OpenGL Mathematics (GLM >=0.9.4): http://glm.g-truc.net/, https://github.com/g-truc/glm 19 | * OpenGL Objects Wrapper (globjects >=0.3.2): https://github.com/cginternals/globjects 20 | 21 | ### Optional Dependencies 22 | 23 | * Window and Context creation (GLFW 3.1): http://www.glfw.org/ 24 | * Qt (>=5.4): http://qt-project.org/ 25 | -------------------------------------------------------------------------------- /cmake/CheckTemplate.cmake: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Get cmake-init latest commit SHA on master 4 | # 5 | 6 | file(DOWNLOAD 7 | "https://api.github.com/repos/cginternals/cmake-init/commits/master" 8 | "${PROJECT_BINARY_DIR}/cmake-init.github.data" 9 | ) 10 | file(READ 11 | "${PROJECT_BINARY_DIR}/cmake-init.github.data" 12 | CMAKE_INIT_INFO 13 | ) 14 | 15 | string(REGEX MATCH 16 | "\"sha\": \"([0-9a-f]+)\"," 17 | CMAKE_INIT_SHA 18 | ${CMAKE_INIT_INFO}) 19 | 20 | string(SUBSTRING 21 | ${CMAKE_INIT_SHA} 22 | 8 23 | 40 24 | CMAKE_INIT_SHA 25 | ) 26 | 27 | # 28 | # Get latest cmake-init commit on this repository 29 | # 30 | 31 | # APPLIED_CMAKE_INIT_SHA can be set by parent script 32 | if(NOT APPLIED_CMAKE_INIT_SHA) 33 | # [TODO]: Get from git commit list (see cmake_init/source/scripts/check_template.sh) 34 | set(APPLIED_CMAKE_INIT_SHA "") 35 | endif () 36 | 37 | if("${APPLIED_CMAKE_INIT_SHA}" STREQUAL "") 38 | message(WARNING 39 | "No cmake-init version detected, could not verify up-to-dateness. " 40 | "Set the cmake-init version by defining a META_CMAKE_INIT_SHA for your project." 41 | ) 42 | return() 43 | endif() 44 | 45 | if(${APPLIED_CMAKE_INIT_SHA} STREQUAL ${CMAKE_INIT_SHA}) 46 | message(STATUS "cmake-init template is up-to-date (${CMAKE_INIT_SHA})") 47 | else() 48 | message(STATUS "cmake-init template needs an update https://github.com/cginternals/cmake-init/compare/${APPLIED_CMAKE_INIT_SHA}...master") 49 | endif() 50 | -------------------------------------------------------------------------------- /cmake/ClangTidy.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Function to register a target for clang-tidy 3 | function(perform_clang_tidy check_target target) 4 | set(includes "$") 5 | 6 | add_custom_target( 7 | ${check_target} 8 | COMMAND 9 | ${clang_tidy_EXECUTABLE} 10 | -p\t${PROJECT_BINARY_DIR} 11 | ${ARGN} 12 | -checks=* 13 | "$<$>:--\t$<$:-I$>>" 14 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 15 | ) 16 | 17 | set_target_properties(${check_target} 18 | PROPERTIES 19 | FOLDER "Maintenance" 20 | ) 21 | 22 | add_dependencies(${check_target} ${target}) 23 | endfunction() 24 | -------------------------------------------------------------------------------- /cmake/ComponentInstall.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Execute cmake_install.cmake wrapper that allows to pass both DESTDIR and COMPONENT environment variable 3 | 4 | execute_process( 5 | COMMAND ${CMAKE_COMMAND} -DCOMPONENT=$ENV{COMPONENT} -P cmake_install.cmake 6 | ) 7 | -------------------------------------------------------------------------------- /cmake/Cppcheck.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Function to register a target for cppcheck 3 | function(perform_cppcheck check_target target) 4 | set(includes "$") 5 | 6 | add_custom_target( 7 | ${check_target} 8 | COMMAND 9 | ${cppcheck_EXECUTABLE} 10 | "$<$:-I$>" 11 | --check-config 12 | --enable=warning,performance,portability,information,missingInclude 13 | --quiet 14 | --std=c++11 15 | --verbose 16 | --suppress=missingIncludeSystem 17 | ${ARGN} 18 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 19 | ) 20 | 21 | set_target_properties(${check_target} 22 | PROPERTIES 23 | FOLDER "Maintenance" 24 | ) 25 | 26 | add_dependencies(${check_target} ${target}) 27 | endfunction() 28 | -------------------------------------------------------------------------------- /cmake/Custom.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set policy if policy is available 3 | function(set_policy POL VAL) 4 | 5 | if(POLICY ${POL}) 6 | cmake_policy(SET ${POL} ${VAL}) 7 | endif() 8 | 9 | endfunction(set_policy) 10 | 11 | 12 | # Define function "source_group_by_path with three mandatory arguments (PARENT_PATH, REGEX, GROUP, ...) 13 | # to group source files in folders (e.g. for MSVC solutions). 14 | # 15 | # Example: 16 | # source_group_by_path("${CMAKE_CURRENT_SOURCE_DIR}/src" "\\\\.h$|\\\\.inl$|\\\\.cpp$|\\\\.c$|\\\\.ui$|\\\\.qrc$" "Source Files" ${sources}) 17 | function(source_group_by_path PARENT_PATH REGEX GROUP) 18 | 19 | foreach (FILENAME ${ARGN}) 20 | 21 | get_filename_component(FILEPATH "${FILENAME}" REALPATH) 22 | file(RELATIVE_PATH FILEPATH ${PARENT_PATH} ${FILEPATH}) 23 | get_filename_component(FILEPATH "${FILEPATH}" DIRECTORY) 24 | 25 | string(REPLACE "/" "\\" FILEPATH "${FILEPATH}") 26 | 27 | source_group("${GROUP}\\${FILEPATH}" REGULAR_EXPRESSION "${REGEX}" FILES ${FILENAME}) 28 | 29 | endforeach() 30 | 31 | endfunction(source_group_by_path) 32 | 33 | 34 | # Function that extract entries matching a given regex from a list. 35 | # ${OUTPUT} will store the list of matching filenames. 36 | function(list_extract OUTPUT REGEX) 37 | 38 | foreach(FILENAME ${ARGN}) 39 | if(${FILENAME} MATCHES "${REGEX}") 40 | list(APPEND ${OUTPUT} ${FILENAME}) 41 | endif() 42 | endforeach() 43 | 44 | set(${OUTPUT} ${${OUTPUT}} PARENT_SCOPE) 45 | 46 | endfunction(list_extract) 47 | -------------------------------------------------------------------------------- /cmake/CustomMacOSXBundleInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 9 | CFBundleGetInfoString 10 | ${MACOSX_BUNDLE_INFO_STRING} 11 | CFBundleIconFile 12 | ${MACOSX_BUNDLE_ICON_FILE} 13 | CFBundleIdentifier 14 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 19 | CFBundleName 20 | ${MACOSX_BUNDLE_BUNDLE_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | ${MACOSX_BUNDLE_BUNDLE_VERSION} 29 | CSResourcesFileMapped 30 | 31 | NSHumanReadableCopyright 32 | ${MACOSX_BUNDLE_COPYRIGHT} 33 | NSPrincipalClass 34 | NSApplication 35 | NSHighResolutionCapable 36 | True 37 | 38 | 39 | -------------------------------------------------------------------------------- /cmake/FindHIDAPI.cmake: -------------------------------------------------------------------------------- 1 | 2 | # HIDAPI_FOUND 3 | # HIDAPI_INCLUDE_DIRS 4 | # HIDAPI_LIBRARIES 5 | 6 | find_path(HIDAPI_INCLUDE_DIRS 7 | NAMES hidapi/hidapi.h 8 | /usr/include 9 | /usr/local/include 10 | /sw/include 11 | /opt/local/include 12 | DOC "The directory where hidapi/hidapi.h resides") 13 | 14 | find_library(HIDAPI_LIBRARIES 15 | NAMES hidapi-hidraw hidapi-libusb 16 | PATHS 17 | /usr/lib64 18 | /usr/local/lib64 19 | /sw/lib64 20 | /opt/loca/lib64 21 | /usr/lib 22 | /usr/local/lib 23 | /sw/lib 24 | /opt/local/lib 25 | DOC "The hidapi library") 26 | 27 | 28 | include(FindPackageHandleStandardArgs) 29 | find_package_handle_standard_args(HIDAPI REQUIRED_VARS HIDAPI_LIBRARIES HIDAPI_INCLUDE_DIRS) 30 | 31 | mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY) 32 | 33 | -------------------------------------------------------------------------------- /cmake/Findclang_tidy.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Findclang_tidy results: 3 | # clang_tidy_FOUND 4 | # clang_tidy_EXECUTABLE 5 | 6 | include(FindPackageHandleStandardArgs) 7 | 8 | find_program(clang_tidy_EXECUTABLE 9 | NAMES 10 | clang-tidy-3.5 11 | clang-tidy-3.6 12 | clang-tidy-3.7 13 | clang-tidy-3.8 14 | clang-tidy-3.9 15 | clang-tidy-4.0 16 | PATHS 17 | "${CLANG_TIDY_DIR}" 18 | ) 19 | 20 | find_package_handle_standard_args(clang_tidy 21 | FOUND_VAR 22 | clang_tidy_FOUND 23 | REQUIRED_VARS 24 | clang_tidy_EXECUTABLE 25 | ) 26 | 27 | mark_as_advanced(clang_tidy_EXECUTABLE) -------------------------------------------------------------------------------- /cmake/Findcppcheck.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Findcppcheck results: 3 | # cppcheck_FOUND 4 | # cppcheck_EXECUTABLE 5 | 6 | include(FindPackageHandleStandardArgs) 7 | 8 | find_program(cppcheck_EXECUTABLE 9 | NAMES 10 | cppcheck 11 | PATHS 12 | "${CPPCHECK_DIR}" 13 | ) 14 | 15 | find_package_handle_standard_args(cppcheck 16 | FOUND_VAR 17 | cppcheck_FOUND 18 | REQUIRED_VARS 19 | cppcheck_EXECUTABLE 20 | ) 21 | 22 | mark_as_advanced(cppcheck_EXECUTABLE) -------------------------------------------------------------------------------- /cmake/GenerateTemplateExportHeader.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Creates an export header similar to generate_export_header, but for templates. 3 | # The main difference is that for MSVC, templates must not get exported. 4 | # When the file ${export_file} is included in source code, the macro ${target_id}_TEMPLATE_API 5 | # may get used to define public visibility for templates on GCC and Clang platforms. 6 | function(generate_template_export_header target target_id export_file) 7 | if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") 8 | configure_file(${PROJECT_SOURCE_DIR}/source/codegeneration/template_msvc_api.h.in ${CMAKE_CURRENT_BINARY_DIR}/${export_file}) 9 | else() 10 | configure_file(${PROJECT_SOURCE_DIR}/source/codegeneration/template_api.h.in ${CMAKE_CURRENT_BINARY_DIR}/${export_file}) 11 | endif() 12 | endfunction() 13 | -------------------------------------------------------------------------------- /cmake/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | if(HEAD_CONTENTS MATCHES "ref") 22 | # named branch 23 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 24 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 25 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 26 | else() 27 | configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) 28 | file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) 29 | if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") 30 | set(HEAD_HASH "${CMAKE_MATCH_1}") 31 | endif() 32 | endif() 33 | else() 34 | # detached HEAD 35 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 36 | endif() 37 | 38 | if(NOT HEAD_HASH) 39 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 40 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 41 | endif() 42 | -------------------------------------------------------------------------------- /cmake/RuntimeDependencies.cmake: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Default dependencies for the runtime-package 4 | # 5 | 6 | # Install 3rd-party runtime dependencies into runtime-component 7 | # install(FILES ... COMPONENT runtime) 8 | 9 | 10 | # 11 | # Full dependencies for self-contained packages 12 | # 13 | 14 | if(OPTION_SELF_CONTAINED) 15 | 16 | # Install 3rd-party runtime dependencies into runtime-component 17 | # install(FILES ... COMPONENT runtime) 18 | 19 | endif() 20 | -------------------------------------------------------------------------------- /data/gloperate-text/fonts/opensansr36.512.512.r.ub.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/data/gloperate-text/fonts/opensansr36.512.512.r.ub.raw -------------------------------------------------------------------------------- /data/gloperate-text/fonts/opensansr36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/data/gloperate-text/fonts/opensansr36.png -------------------------------------------------------------------------------- /data/gloperate/qml/ClickLabel.qml: -------------------------------------------------------------------------------- 1 | 2 | import QtQuick 2.0 3 | 4 | import QmlToolbox.Base 1.0 5 | import QmlToolbox.Controls 1.0 6 | 7 | 8 | Item 9 | { 10 | id: item 11 | 12 | signal clicked() 13 | 14 | property color color: '#0000ff' 15 | property color hoverColor: '#8888ff' 16 | property color selectedColor: '#ffbb44' 17 | property bool selected: false 18 | property alias text: label.text 19 | 20 | implicitWidth: label.implicitWidth 21 | implicitHeight: label.implicitHeight 22 | 23 | MouseArea 24 | { 25 | id: mouseArea 26 | 27 | anchors.fill: parent 28 | 29 | hoverEnabled: true 30 | 31 | onClicked: item.clicked(); 32 | } 33 | 34 | Label 35 | { 36 | id: label 37 | 38 | anchors.fill: parent 39 | 40 | color: mouseArea.containsMouse ? item.hoverColor : (item.selected ? item.selectedColor : item.color) 41 | font.bold: item.selected 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/colorize.frag: -------------------------------------------------------------------------------- 1 | 2 | #version 140 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | uniform sampler2D source; 7 | uniform vec4 color; 8 | 9 | 10 | in vec2 v_uv; 11 | 12 | layout (location = 0) out vec4 fragColor; 13 | 14 | 15 | void main() 16 | { 17 | fragColor = texture(source, v_uv) * color; 18 | } 19 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/demo.frag: -------------------------------------------------------------------------------- 1 | 2 | #version 330 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | uniform sampler2D texColor; 7 | 8 | 9 | in vec2 v_uv; 10 | 11 | layout (location = 0) out vec4 fragColor; 12 | 13 | 14 | void main() 15 | { 16 | vec4 color = texture(texColor, v_uv); 17 | fragColor = vec4(color.rgb * (0.5 + 0.5 * cos(v_uv.x * 100)), 1.0); 18 | } 19 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/demo.vert: -------------------------------------------------------------------------------- 1 | 2 | #version 330 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | layout (location = 0) in vec2 vertex; 7 | 8 | out vec2 v_uv; 9 | 10 | 11 | void main() 12 | { 13 | v_uv = vertex * 0.5 + 0.5; 14 | gl_Position = vec4(vertex, 0.0, 1.0); 15 | } 16 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/gradient.frag: -------------------------------------------------------------------------------- 1 | 2 | #version 140 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | in vec4 v_color; 7 | 8 | 9 | layout (location = 0) out vec4 fragColor; 10 | 11 | 12 | void main() 13 | { 14 | fragColor = v_color; 15 | } 16 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/gradient.vert: -------------------------------------------------------------------------------- 1 | 2 | #version 140 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | uniform mat4 modelViewProjectionMatrix; 7 | uniform sampler2D gradientTexture; 8 | uniform uint gradientIndex; 9 | uniform float value; 10 | 11 | 12 | layout (location = 0) in vec3 vertex; 13 | 14 | 15 | out vec4 v_color; 16 | 17 | 18 | void main() 19 | { 20 | gl_Position = modelViewProjectionMatrix * vec4(vertex, 1.0); 21 | 22 | ivec2 size = textureSize(gradientTexture, 0); 23 | v_color = texelFetch(gradientTexture, ivec2(int(value * float(size.x-1)), gradientIndex), 0); 24 | } 25 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/lights.frag: -------------------------------------------------------------------------------- 1 | 2 | #version 140 3 | #extension GL_ARB_explicit_attrib_location : require 4 | #extension GL_ARB_shading_language_include : require 5 | 6 | // Use phong implementation 7 | #define LIGHT_PROCESSING_PHONG 8 | #include 9 | 10 | 11 | uniform samplerBuffer colorTypeData; 12 | uniform samplerBuffer positionData; 13 | uniform samplerBuffer attenuationData; 14 | 15 | uniform vec3 eye; 16 | uniform float glossiness; 17 | 18 | 19 | in vec3 g_worldPosition; 20 | in vec3 g_normal; 21 | 22 | layout (location = 0) out vec4 fragColor; 23 | 24 | 25 | void main() 26 | { 27 | // Apply lighting 28 | vec3 color = lightIntensity( 29 | g_worldPosition, 30 | vec3(1.0), // diffuse color 31 | vec3(0.5), // specular color 32 | g_normal, 33 | glossiness, 34 | eye, 35 | colorTypeData, 36 | positionData, 37 | attenuationData); 38 | 39 | fragColor = vec4(color, 1.0); 40 | } 41 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/lights.geom: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | layout (triangles) in; 4 | layout (triangle_strip, max_vertices = 3) out; 5 | 6 | in vec3 v_worldPosition[]; 7 | 8 | out vec3 g_worldPosition; 9 | out vec3 g_normal; 10 | 11 | void main() 12 | { 13 | vec3 a = v_worldPosition[0]; 14 | vec3 b = v_worldPosition[1]; 15 | vec3 c = v_worldPosition[2]; 16 | 17 | // Calculate face normal ... 18 | vec3 tangent = b - a; 19 | vec3 bitangent = c - a; 20 | vec3 normal = normalize(cross(tangent, bitangent)); 21 | 22 | // ... and add normal to vertex information 23 | gl_Position = gl_in[0].gl_Position; 24 | g_worldPosition = v_worldPosition[0]; 25 | g_normal = normal; 26 | EmitVertex(); 27 | 28 | gl_Position = gl_in[1].gl_Position; 29 | g_worldPosition = v_worldPosition[1]; 30 | g_normal = normal; 31 | EmitVertex(); 32 | 33 | gl_Position = gl_in[2].gl_Position; 34 | g_worldPosition = v_worldPosition[2]; 35 | g_normal = normal; 36 | EmitVertex(); 37 | 38 | EndPrimitive(); 39 | } 40 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/lights.vert: -------------------------------------------------------------------------------- 1 | 2 | #version 140 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | uniform mat4 modelMatrix; 7 | uniform mat4 modelViewProjectionMatrix; 8 | 9 | 10 | layout (location = 0) in vec3 a_vertex; 11 | 12 | out vec3 v_worldPosition; 13 | 14 | 15 | void main() 16 | { 17 | gl_Position = modelViewProjectionMatrix * vec4(a_vertex, 1.0); 18 | 19 | v_worldPosition = (modelMatrix * vec4(a_vertex, 1.0)).xyz; 20 | } 21 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/multi_frame_postprocessing.frag: -------------------------------------------------------------------------------- 1 | 2 | #version 150 3 | #extension GL_ARB_explicit_attrib_location : require 4 | #extension GL_ARB_shading_language_include : require 5 | 6 | #include 7 | 8 | 9 | const vec3 ssaoColor = vec3(0.0); 10 | const float farZ = 10.0; 11 | 12 | 13 | uniform sampler2D colorTexture; 14 | uniform sampler2D normalTexture; 15 | uniform sampler2D depthTexture; 16 | uniform sampler1D ssaoKernelTexture; 17 | uniform sampler2DArray ssaoNoiseTexture; 18 | 19 | uniform mat4 modelViewProjectionMatrix; 20 | uniform mat3 normalMatrix; 21 | 22 | uniform int currentFrame; 23 | uniform float ssaoRadius; 24 | uniform float ssaoIntensity; 25 | 26 | uniform bool useSSAO; 27 | 28 | 29 | in vec2 v_uv; 30 | 31 | layout (location = 0) out vec4 fragColor; 32 | 33 | 34 | void main() 35 | { 36 | vec3 baseColor = texture(colorTexture, v_uv).rgb; 37 | 38 | float ssaoFactor = 1.0; 39 | 40 | // Run SSAO calculation 41 | if (useSSAO) 42 | { 43 | ssaoFactor = ssao( 44 | v_uv, 45 | depthTexture, 46 | normalTexture, 47 | ssaoNoiseTexture, 48 | ssaoKernelTexture, 49 | modelViewProjectionMatrix, 50 | inverse(modelViewProjectionMatrix), 51 | ssaoRadius, 52 | currentFrame 53 | ); 54 | } 55 | 56 | // Apply SSAO 57 | fragColor = vec4(baseColor * mix(1.0, ssaoFactor, ssaoIntensity), 1.0); 58 | } 59 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/multi_frame_rendering.frag: -------------------------------------------------------------------------------- 1 | 2 | #version 330 3 | #extension GL_ARB_explicit_attrib_location : require 4 | #extension GL_ARB_shading_language_include : require 5 | 6 | #include 7 | 8 | 9 | uniform sampler2D transparencyKernel; 10 | 11 | uniform int currentFrame; 12 | uniform float transparencyAlpha; 13 | 14 | uniform bool useTransparency; 15 | 16 | 17 | in vec4 v_position; 18 | in vec3 v_color; 19 | flat in vec3 v_normal; 20 | 21 | layout (location = 0) out vec4 fragColor; 22 | layout (location = 1) out vec3 normal; 23 | 24 | 25 | void main() 26 | { 27 | // Sample from transparency kernel 28 | float alpha = transparencyAlpha; 29 | float rand = random(v_position); 30 | ivec2 transpSize = textureSize(transparencyKernel, 0); 31 | ivec2 transpIndex = ivec2(vec2(rand, alpha) * transpSize) + ivec2(currentFrame, 0); 32 | bool opaque = texelFetch(transparencyKernel, transpIndex % transpSize, 0).r > 0.5; 33 | 34 | // Discard transparent pixels 35 | if (alpha == 1.0) 36 | opaque = true; 37 | if (!opaque && useTransparency) 38 | discard; 39 | 40 | fragColor = vec4(v_color, 1.0); 41 | normal = v_normal; 42 | } 43 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/multi_frame_rendering.vert: -------------------------------------------------------------------------------- 1 | 2 | #version 140 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | uniform sampler1D dofShiftKernel; 7 | uniform sampler1D subpixelShiftKernel; 8 | 9 | uniform mat4 modelViewMatrix; 10 | uniform mat4 projectionMatrix; 11 | 12 | uniform vec4 viewport; 13 | 14 | uniform int currentFrame; 15 | uniform float dofZFocus; 16 | 17 | uniform bool useAntialiasing; 18 | uniform bool useDOF; 19 | 20 | 21 | layout (location = 0) in vec3 a_vertex; 22 | layout (location = 1) in vec3 a_normal; 23 | 24 | out vec4 v_position; 25 | out vec3 v_color; 26 | flat out vec3 v_normal; 27 | 28 | 29 | void main() 30 | { 31 | // Get shift values 32 | vec2 dofShift = texelFetch(dofShiftKernel, currentFrame, 0).xy; 33 | vec2 subpixelShift = texelFetch(subpixelShiftKernel, currentFrame, 0).xy; 34 | subpixelShift /= viewport.zw; 35 | 36 | // Apply DOF shift in view space 37 | vec4 viewPos = modelViewMatrix * vec4(a_vertex, 1.0); 38 | vec4 dofViewPos = vec4(viewPos.xy + dofShift * (viewPos.z + dofZFocus) * float(useDOF), viewPos.zw); 39 | vec4 dofShiftedPos = projectionMatrix * dofViewPos; 40 | 41 | // Apply AA shift in screen space 42 | v_position = dofShiftedPos + vec4(subpixelShift, 0.0, 0.0) * float(useAntialiasing); 43 | v_color = vec3(0.6) + 0.2 * a_vertex + 0.2 * (a_normal * 0.5 + 0.5); 44 | v_normal = a_normal; 45 | gl_Position = v_position; 46 | } 47 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/transparency.frag: -------------------------------------------------------------------------------- 1 | 2 | #version 330 3 | #extension GL_ARB_explicit_attrib_location : require 4 | #extension GL_ARB_shading_language_include : require 5 | 6 | #include 7 | 8 | uniform sampler2D transparencyKernel; 9 | 10 | uniform int currentFrame; 11 | 12 | 13 | flat in vec4 v_color; 14 | in vec2 v_localPos; 15 | 16 | layout (location = 0) out vec4 fragColor; 17 | 18 | 19 | void main() 20 | { 21 | // Making a circle from a square 22 | float r2 = v_localPos.x * v_localPos.x + v_localPos.y * v_localPos.y; 23 | if (r2 > 1.0) 24 | { 25 | discard; 26 | } 27 | 28 | // Sample transparency kernel 29 | float rand = random(vec3(v_localPos, currentFrame)); 30 | float alpha = v_color.a; 31 | ivec2 transpSize = textureSize(transparencyKernel, 0); 32 | ivec2 transpIndex = ivec2(vec2(rand, alpha) * transpSize) + ivec2(currentFrame, 0); 33 | bool opaque = texelFetch(transparencyKernel, transpIndex % transpSize, 0).r > 0.5; 34 | 35 | // Discard transparent pixels 36 | if (!opaque) 37 | discard; 38 | 39 | fragColor = vec4(v_color.rgb, 1.0); 40 | } 41 | -------------------------------------------------------------------------------- /data/gloperate/shaders/demos/transparency.vert: -------------------------------------------------------------------------------- 1 | 2 | #version 140 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | layout (location = 0) in vec2 a_vertex; 7 | layout (location = 1) in vec2 a_uv; 8 | layout (location = 2) in vec4 a_color; 9 | 10 | flat out vec4 v_color; 11 | out vec2 v_localPos; 12 | 13 | 14 | void main() 15 | { 16 | gl_Position = vec4(a_vertex, 0.0, 1.0); 17 | v_color = a_color; 18 | v_localPos = a_uv; 19 | } 20 | -------------------------------------------------------------------------------- /data/gloperate/shaders/geometry/geometry.frag: -------------------------------------------------------------------------------- 1 | 2 | #version 330 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | uniform sampler2D tex0; 7 | 8 | 9 | in vec2 v_texcoord; 10 | 11 | 12 | layout (location = 0) out vec4 colorOut; 13 | 14 | 15 | void main() 16 | { 17 | // Output color 18 | colorOut = texture(tex0, v_texcoord); 19 | } 20 | -------------------------------------------------------------------------------- /data/gloperate/shaders/geometry/geometry.vert: -------------------------------------------------------------------------------- 1 | 2 | #version 330 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | uniform mat4 modelViewProjectionMatrix; 7 | 8 | 9 | layout (location = 0) in vec3 vertex; 10 | layout (location = 1) in vec2 texcoord; 11 | 12 | 13 | out vec2 v_texcoord; 14 | 15 | 16 | void main() 17 | { 18 | gl_Position = modelViewProjectionMatrix * vec4(vertex, 1.0); 19 | v_texcoord = texcoord; 20 | } 21 | -------------------------------------------------------------------------------- /data/gloperate/shaders/geometry/screenaligned.frag: -------------------------------------------------------------------------------- 1 | 2 | #version 140 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | uniform sampler2D source; 7 | 8 | 9 | in vec2 v_uv; 10 | 11 | layout (location = 0) out vec4 fragColor; 12 | 13 | 14 | void main() 15 | { 16 | fragColor = texture(source, v_uv); 17 | } 18 | -------------------------------------------------------------------------------- /data/gloperate/shaders/geometry/screenaligned.vert: -------------------------------------------------------------------------------- 1 | 2 | #version 140 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | layout (location = 0) in vec2 a_vertex; 7 | 8 | out vec2 v_uv; 9 | 10 | 11 | void main() 12 | { 13 | v_uv = a_vertex * 0.5 + 0.5; 14 | gl_Position = vec4(a_vertex, 0.0, 1.0); 15 | } 16 | -------------------------------------------------------------------------------- /data/gloperate/shaders/geometry/screenaligned_inverted.frag: -------------------------------------------------------------------------------- 1 | 2 | #version 140 3 | #extension GL_ARB_explicit_attrib_location : require 4 | 5 | 6 | uniform sampler2D source; 7 | 8 | 9 | in vec2 v_uv; 10 | 11 | layout (location = 0) out vec4 fragColor; 12 | 13 | 14 | void main() 15 | { 16 | fragColor = texture(source, vec2(v_uv.x, 1.0 - v_uv.y)); 17 | } 18 | -------------------------------------------------------------------------------- /data/gloperate/shaders/lighting/lightprocessing.glsl: -------------------------------------------------------------------------------- 1 | 2 | #ifndef LIGHT_PROCESSING 3 | #define LIGHT_PROCESSING 4 | 5 | #define LIGHT_TYPE_AMBIENT 1 6 | #define LIGHT_TYPE_DIRECTIONAL 2 7 | #define LIGHT_TYPE_POINT 3 8 | #define LIGHT_TYPE_POINT_ATT 4 9 | 10 | #ifdef LIGHT_PROCESSING_PHONG 11 | #include 12 | #else 13 | // Default: Diffuse only 14 | #include 15 | #endif 16 | 17 | vec3 lightIntensity( 18 | vec3 worldPosition, 19 | vec3 diffuseColor, 20 | vec3 specularColor, 21 | vec3 normal, 22 | float glossiness, 23 | vec3 eyePosition, 24 | samplerBuffer colorTypeData, 25 | samplerBuffer positionData, 26 | samplerBuffer attenuationData) 27 | { 28 | vec3 intensity = vec3(0.0); 29 | 30 | for (int i = 0; i < textureSize(colorTypeData); i++) 31 | { 32 | vec4 colorType = texelFetch(colorTypeData, i); 33 | vec3 lightColor = colorType.rgb; 34 | int lightType = int(colorType.a); 35 | vec3 lightPosition = texelFetch(positionData, i).xyz; 36 | vec3 attenuationCoefficients = texelFetch(attenuationData, i).xyz; 37 | 38 | intensity += singleLightIntensity( 39 | worldPosition, 40 | diffuseColor, 41 | specularColor, 42 | normal, 43 | glossiness, 44 | eyePosition, 45 | lightType, 46 | lightColor, 47 | lightPosition, 48 | attenuationCoefficients); 49 | } 50 | 51 | return intensity; 52 | } 53 | 54 | #endif // LIGHT_PROCESSING 55 | -------------------------------------------------------------------------------- /data/gloperate/shaders/lighting/lightprocessing_diffuse.glsl: -------------------------------------------------------------------------------- 1 | 2 | vec3 singleLightIntensity( 3 | vec3 worldPosition, 4 | vec3 diffuseColor, 5 | vec3 specularColor, 6 | vec3 normal, 7 | float glossiness, 8 | vec3 eyePosition, 9 | int lightType, 10 | vec3 lightColor, 11 | vec3 lightPosition, 12 | vec3 attenuationCoefficients) 13 | { 14 | switch(lightType) 15 | { 16 | case LIGHT_TYPE_AMBIENT: 17 | { 18 | return diffuseColor * lightColor; 19 | } 20 | case LIGHT_TYPE_DIRECTIONAL: 21 | { 22 | return diffuseColor * lightColor * max(dot(normalize(lightPosition), normal), 0.0); 23 | } 24 | case LIGHT_TYPE_POINT: 25 | { 26 | vec3 L = lightPosition - worldPosition; 27 | if (dot(L, normal) < 0.0) 28 | return vec3(0.0); 29 | return diffuseColor * lightColor * max(dot(normalize(L), normal), 0.0); 30 | } 31 | case LIGHT_TYPE_POINT_ATT: 32 | { 33 | vec3 L = lightPosition - worldPosition; 34 | if (dot(L, normal) < 0.0) 35 | return vec3(0.0); 36 | float d = length(L); 37 | float attenuation = 1 / (attenuationCoefficients.x + attenuationCoefficients.y * d + attenuationCoefficients.z * d*d); 38 | return diffuseColor * lightColor * attenuation * max(dot(normalize(L), normal), 0.0); 39 | } 40 | default: 41 | return vec3(0.0); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /data/gloperate/textures/gloperate-logo.glraw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/data/gloperate/textures/gloperate-logo.glraw -------------------------------------------------------------------------------- /data/gloperate/textures/gloperate-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/data/gloperate/textures/gloperate-logo.png -------------------------------------------------------------------------------- /data/gloperate/video_profiles/avi.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "AVI (codec: mpeg4)", 3 | "format": "avi", 4 | "codec": "mpeg4", 5 | "width": 800, 6 | "height": 600, 7 | "fps": 30, 8 | "seconds": 7, 9 | "gopsize": 60, 10 | "bitrate": 400000 11 | } 12 | -------------------------------------------------------------------------------- /data/gloperate/video_profiles/avi_raw.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "AVI (codec: rawvideo)", 3 | "format": "avi", 4 | "codec": "rawvideo", 5 | "width": 1600, 6 | "height": 1200 7 | } 8 | -------------------------------------------------------------------------------- /data/gloperate/video_profiles/flv.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "FLV", 3 | "format": "flv", 4 | "codec": "flv" 5 | } 6 | -------------------------------------------------------------------------------- /deploy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Target 'pack' 4 | # 5 | 6 | add_custom_target(pack) 7 | set_target_properties(pack PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1) 8 | 9 | 10 | # Install additional runtime dependencies 11 | include(${PROJECT_SOURCE_DIR}/cmake/RuntimeDependencies.cmake) 12 | 13 | 14 | # 15 | # Packages 16 | # 17 | 18 | include(packages/pack-gloperate.cmake) 19 | 20 | 21 | # 22 | # Target 'component_install' 23 | # 24 | 25 | add_custom_target( 26 | component_install 27 | COMMAND make preinstall 28 | COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/ComponentInstall.cmake 29 | WORKING_DIRECTORY ${PROJECT_BINARY_DIR} 30 | ) 31 | -------------------------------------------------------------------------------- /deploy/ubuntu-ppa/debian/changelog: -------------------------------------------------------------------------------- 1 | libgloperate (2.0.0-0) unknown; urgency=low 2 | 3 | * Initial release. 4 | 5 | -- Willy Scheibel Tue, 26 Jan 2016 21:58:03 +0100 6 | -------------------------------------------------------------------------------- /deploy/ubuntu-ppa/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /deploy/ubuntu-ppa/debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianised by Willy Scheibel on 2 | Tue, 26 Jan 2016 21:58:00 +0100 3 | 4 | It was downloaded from: 5 | 6 | https://github.com/cginternals/gloperate 7 | 8 | Upstream Author: 9 | 10 | CG Internals 11 | 12 | Copyright: 13 | 14 | Copyright (c) 2015-2018 CG Internals GmbH and Computer Graphics Systems Group at the Hasso-Plattner-Institute, Germany. 15 | 16 | License: 17 | 18 | This software is available to you under the terms of the MIT license, see "https://github.com/cginternals/gloperate/blob/master/LICENSE". 19 | -------------------------------------------------------------------------------- /deploy/ubuntu-ppa/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /deploy/ubuntu-ppa/recipe.txt: -------------------------------------------------------------------------------- 1 | # git-build-recipe format 0.4 deb-version {debupstream}+{revno} 2 | lp:gloperate v2.0 3 | nest-part packaging lp:gloperate deploy/ubuntu-ppa/debian debian v2.0 4 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Target 'docs' 4 | # 5 | 6 | if(NOT OPTION_BUILD_DOCS) 7 | return() 8 | endif() 9 | 10 | add_custom_target(docs) 11 | 12 | 13 | # 14 | # Documentation 15 | # 16 | 17 | add_subdirectory(api-docs) 18 | -------------------------------------------------------------------------------- /docs/api-docs/extra_files/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/bc_s.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/bdwn.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/clclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/clclosed.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/clopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/clopen.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/closed.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2blank.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2cl.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2doc.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2folderclosed.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2folderopen.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2lastnode.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2link.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2mlastnode.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2mnode.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2mo.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2node.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2ns.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2plastnode.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2pnode.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2splitbar.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/ftv2vertline.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/open.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/sync_off.png -------------------------------------------------------------------------------- /docs/api-docs/extra_files/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/extra_files/sync_on.png -------------------------------------------------------------------------------- /docs/api-docs/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | qmi style 11 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/api-docs/include/mainpage.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/api-docs/include/mainpage.html -------------------------------------------------------------------------------- /docs/api-docs/mainpage.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \mainpage 3 | * \htmlinclude mainpage.html 4 | */ -------------------------------------------------------------------------------- /docs/api-docs/namespacedocumentation.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \namespace gloperate 3 | * 4 | * \brief C++ library for defining and controlling modern GPU rendering/processing operations 5 | */ 6 | -------------------------------------------------------------------------------- /docs/ffmpeg-docs/readme.md: -------------------------------------------------------------------------------- 1 | 2 | A profile file for the FFMPEGVideoExporter plugin is a properly formatted json file. 3 | 4 | It must contain the following fields: 5 | - "format" 6 | - "codec" 7 | 8 | The following fields are optional: 9 | - "width" (default value, can later be adjusted in GUI) 10 | - "height" (default value, can later be adjusted in GUI) 11 | - "fps" (default value, can later be adjusted in GUI) 12 | - "seconds" (default value, can later be adjusted in GUI) 13 | 14 | - "gopsize" 15 | 16 | An example of a minimal profile.json would look like: 17 | 18 | { 19 | "format": "avi", 20 | "codec": "mpeg4" 21 | } 22 | 23 | An example of a comprehensive profile.json would look like: 24 | 25 | { 26 | "format": "avi", 27 | "codec": "mpeg4", 28 | "width": 800, 29 | "height": 600, 30 | "fps": 30, 31 | "seconds": 5, 32 | "gopsize": 60 33 | } 34 | -------------------------------------------------------------------------------- /docs/implementation-details/CameraUtils.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/implementation-details/CameraUtils.pdf -------------------------------------------------------------------------------- /docs/implementation-details/fovyConversion.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/implementation-details/fovyConversion.pdf -------------------------------------------------------------------------------- /docs/implementation-details/projections.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/docs/implementation-details/projections.pdf -------------------------------------------------------------------------------- /gloperate-config.cmake: -------------------------------------------------------------------------------- 1 | 2 | # This config script tries to locate the project either in its source tree 3 | # or from an install location. 4 | # 5 | # Please adjust the list of submodules to search for. 6 | 7 | 8 | # List of modules 9 | set(MODULE_NAMES 10 | gloperate 11 | gloperate-qt 12 | gloperate-qtquick 13 | gloperate-glfw 14 | gloperate-glkernel 15 | gloperate-headless 16 | # gloperate-osg 17 | # gloperate-assimp 18 | gloperate-text 19 | ) 20 | 21 | 22 | # Macro to search for a specific module 23 | macro(find_module FILENAME) 24 | if(EXISTS "${FILENAME}") 25 | set(MODULE_FOUND TRUE) 26 | include("${FILENAME}") 27 | endif() 28 | endmacro() 29 | 30 | # Macro to search for all modules 31 | macro(find_modules PREFIX) 32 | foreach(module_name ${MODULE_NAMES}) 33 | if(TARGET ${module_name}) 34 | set(MODULE_FOUND TRUE) 35 | else() 36 | find_module("${CMAKE_CURRENT_LIST_DIR}/${PREFIX}/${module_name}/${module_name}-export.cmake") 37 | endif() 38 | endforeach(module_name) 39 | endmacro() 40 | 41 | 42 | # Try install location 43 | set(MODULE_FOUND FALSE) 44 | find_modules("cmake") 45 | 46 | if(MODULE_FOUND) 47 | return() 48 | endif() 49 | 50 | # Try common build locations 51 | if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") 52 | find_modules("build-Debug/cmake") 53 | find_modules("build-debug/cmake") 54 | find_modules("build/cmake") 55 | else() 56 | find_modules("build/cmake") 57 | find_modules("build-debug/cmake") 58 | endif() 59 | 60 | # Signal success/failure to CMake 61 | set(gloperate_FOUND ${MODULE_FOUND}) 62 | -------------------------------------------------------------------------------- /gloperate-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/gloperate-logo.png -------------------------------------------------------------------------------- /source/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Configuration for all sub-projects 4 | # 5 | 6 | # Generate version-header 7 | configure_file(version.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/${META_PROJECT_NAME}/${META_PROJECT_NAME}-version.h) 8 | 9 | 10 | # 11 | # Sub-projects 12 | # 13 | 14 | # Libraries 15 | set(IDE_FOLDER "") 16 | add_subdirectory(gloperate) 17 | add_subdirectory(gloperate-glfw) 18 | add_subdirectory(gloperate-qt) 19 | add_subdirectory(gloperate-qtquick) 20 | add_subdirectory(gloperate-hidapi) 21 | add_subdirectory(gloperate-glkernel) 22 | add_subdirectory(gloperate-headless) 23 | #add_subdirectory(gloperate-ffmpeg) 24 | #add_subdirectory(gloperate-assimp) 25 | #add_subdirectory(gloperate-osg) 26 | add_subdirectory(gloperate-text) 27 | 28 | # Plugins 29 | set(IDE_FOLDER "Plugins") 30 | add_subdirectory(plugins) 31 | 32 | # Applications 33 | set(IDE_FOLDER "Applications") 34 | add_subdirectory(applications) 35 | 36 | # Tools 37 | #set(IDE_FOLDER "Tools") 38 | #add_subdirectory(tools) 39 | 40 | # Examples 41 | set(IDE_FOLDER "Examples") 42 | add_subdirectory(examples) 43 | 44 | # Tests 45 | #if(OPTION_BUILD_TESTS) 46 | # set(IDE_FOLDER "Tests") 47 | # add_subdirectory(tests) 48 | #endif() 49 | 50 | 51 | # 52 | # Deployment 53 | # 54 | 55 | # Deploy generated headers 56 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/${META_PROJECT_NAME} DESTINATION include COMPONENT dev) 57 | -------------------------------------------------------------------------------- /source/applications/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Applications 3 | add_subdirectory(gloperate-viewer) 4 | -------------------------------------------------------------------------------- /source/applications/gloperate-viewer/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | 7 | using namespace gloperate_qtquick; 8 | 9 | 10 | int main(int argc, char * argv[]) 11 | { 12 | // Initialize gloperate and qmltoolbox 13 | Application::initialize(); 14 | 15 | // Initialize Qt application 16 | Application app(argc, argv); 17 | app.setApplicationName(GLOPERATE_PROJECT_NAME); 18 | app.setApplicationVersion(GLOPERATE_VERSION); 19 | app.setOrganizationName(GLOPERATE_AUTHOR_ORGANIZATION); 20 | app.setOrganizationDomain(GLOPERATE_AUTHOR_DOMAIN); 21 | 22 | // Load and show QML 23 | app.loadQml(app.gloperateModulePath() + "/Viewer.qml"); 24 | 25 | // Run main loop 26 | return app.exec(); 27 | } 28 | -------------------------------------------------------------------------------- /source/codegeneration/template_api.h.in: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ${target_id}_TEMPLATE_API_H 3 | #define ${target_id}_TEMPLATE_API_H 4 | 5 | #include <${target}/${target}_export.h> 6 | 7 | #ifdef ${target_id}_STATIC_DEFINE 8 | # define ${target_id}_TEMPLATE_API 9 | #else 10 | # ifndef ${target_id}_TEMPLATE_API 11 | # ifdef ${target_id}_EXPORTS 12 | /* We are building this library */ 13 | # define ${target_id}_TEMPLATE_API __attribute__((visibility("default"))) 14 | # else 15 | /* We are using this library */ 16 | # define ${target_id}_TEMPLATE_API __attribute__((visibility("default"))) 17 | # endif 18 | # endif 19 | 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /source/codegeneration/template_msvc_api.h.in: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ${target_id}_TEMPLATE_API_H 3 | #define ${target_id}_TEMPLATE_API_H 4 | 5 | #include <${target}/${target}_export.h> 6 | 7 | #ifdef ${target_id}_STATIC_DEFINE 8 | # define ${target_id}_TEMPLATE_API 9 | #else 10 | # ifndef ${target_id}_TEMPLATE_API 11 | # ifdef ${target_id}_EXPORTS 12 | /* We are building this library */ 13 | # define ${target_id}_TEMPLATE_API 14 | # else 15 | /* We are using this library */ 16 | # define ${target_id}_TEMPLATE_API 17 | # endif 18 | # endif 19 | 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /source/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Check if examples are enabled 3 | if(NOT OPTION_BUILD_EXAMPLES) 4 | return() 5 | endif() 6 | 7 | # Example plugins 8 | add_subdirectory(demo-stages-plugins) 9 | 10 | # Example applications 11 | add_subdirectory(gloperate-glfw-example) 12 | add_subdirectory(gloperate-qt-example) 13 | add_subdirectory(gloperate-qtquick-example) 14 | add_subdirectory(gloperate-headless-example) 15 | #add_subdirectory(gloperate-ffmpeg-example) 16 | #add_subdirectory(gloperate-videotool-example) 17 | -------------------------------------------------------------------------------- /source/examples/demo-stages-plugins/DemoTextRenderingPipeline.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | namespace openll 15 | { 16 | enum class Alignment : unsigned char; 17 | enum class LineAnchor : unsigned char; 18 | } 19 | 20 | 21 | class DemoTextRenderingPipeline : public gloperate::Pipeline 22 | { 23 | public: 24 | CPPEXPOSE_DECLARE_COMPONENT( 25 | DemoTextRenderingPipeline, gloperate::Stage 26 | , "RenderStage Demos" // Tags 27 | , "" // Icon 28 | , "" // Annotations 29 | , "Text demo" 30 | , GLOPERATE_AUTHOR_ORGANIZATION 31 | , "v1.0.0" 32 | ) 33 | 34 | 35 | public: 36 | gloperate::CanvasInterface canvasInterface; 37 | 38 | Input fontFilename; 39 | 40 | Input string; 41 | Input numChars; 42 | 43 | Input fontSize; 44 | 45 | Input origin; 46 | Input margins; 47 | 48 | Input wordWrap; 49 | Input lineWidth; 50 | 51 | Input alignment; 52 | Input lineAnchor; 53 | Input optimized; 54 | 55 | 56 | public: 57 | explicit DemoTextRenderingPipeline(gloperate::Environment * environment, const std::string & name = ""); 58 | }; 59 | -------------------------------------------------------------------------------- /source/examples/demo-stages-plugins/GeometryImporterStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GeometryImporterStage.h" 3 | 4 | #include 5 | #include 6 | 7 | 8 | CPPEXPOSE_COMPONENT(GeometryImporterStage, gloperate::Stage) 9 | 10 | 11 | GeometryImporterStage::GeometryImporterStage(gloperate::Environment * environment, const std::string & name) 12 | : Stage(environment, name) 13 | , filePath("filepath", this) 14 | , geometry("geometry", this) 15 | , m_geometry(nullptr) 16 | { 17 | } 18 | 19 | GeometryImporterStage::~GeometryImporterStage() 20 | { 21 | } 22 | 23 | void GeometryImporterStage::onContextDeinit(gloperate::AbstractGLContext * /*context*/) 24 | { 25 | m_geometry.reset(); 26 | } 27 | 28 | void GeometryImporterStage::onProcess() 29 | { 30 | auto loaded = std::unique_ptr(m_environment->resourceManager()->load((*filePath).path())); 31 | 32 | if (loaded) 33 | { 34 | m_geometry = std::move(loaded); 35 | geometry = m_geometry.get(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /source/examples/demo-stages-plugins/GlyphSequenceDemoStage.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | 14 | 15 | namespace openll 16 | { 17 | enum class LineAnchor : unsigned char; 18 | enum class Alignment : unsigned char; 19 | class FontFace; 20 | } 21 | 22 | 23 | class GlyphSequenceDemoStage : public gloperate::Stage 24 | { 25 | public: 26 | Input string; 27 | Input numChars; 28 | 29 | Input font; 30 | Input fontSize; 31 | Input wordWrap; 32 | Input lineWidth; 33 | Input alignment; 34 | Input lineAnchor; 35 | 36 | Input origin; 37 | Input margins; 38 | 39 | Input pixelPerInch; 40 | Input viewport; 41 | 42 | Output *> sequences; 43 | 44 | 45 | public: 46 | explicit GlyphSequenceDemoStage(gloperate::Environment * environment, const std::string & name = ""); 47 | 48 | 49 | protected: 50 | virtual void onProcess() override; 51 | 52 | 53 | protected: 54 | std::vector m_sequences; 55 | }; 56 | -------------------------------------------------------------------------------- /source/examples/gloperate-ffmpeg-example/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | 11 | using namespace globjects; 12 | using namespace gloperate_ffmpeg; 13 | 14 | 15 | int main(int /*argc*/, char ** /*argv[]*/) 16 | { 17 | static const int w(256); 18 | static const int h(256); 19 | 20 | VideoEncoder * encoder = new VideoEncoder(); 21 | encoder->initEncoding("gloperate-ffmpeg-example_out.avi", w, h, 25); 22 | 23 | for (int i = 0; i < 100; ++i) 24 | { 25 | // Create procedural texture 26 | gloperate::Image image(w, h, gl::GL_RGB, gl::GL_UNSIGNED_BYTE); 27 | 28 | std::random_device rd; 29 | std::mt19937 generator(rd()); 30 | std::poisson_distribution<> r(0.2); 31 | 32 | for (int i = 0; i < w * h * image.channels() * image.bytes(); ++i) { 33 | image.data()[i] = static_cast(255 - static_cast(r(generator) * 255)); 34 | } 35 | 36 | encoder->putFrame(image); 37 | } 38 | 39 | encoder->finishEncoding(); 40 | delete encoder; 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /source/examples/gloperate-qtquick-example/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | 7 | using namespace gloperate_qtquick; 8 | 9 | 10 | int main(int argc, char * argv[]) 11 | { 12 | // Initialize gloperate and qmltoolbox 13 | Application::initialize(); 14 | 15 | // Initialize Qt application 16 | Application app(argc, argv); 17 | app.setApplicationName(GLOPERATE_PROJECT_NAME); 18 | app.setApplicationVersion(GLOPERATE_VERSION); 19 | app.setOrganizationName(GLOPERATE_AUTHOR_ORGANIZATION); 20 | app.setOrganizationDomain(GLOPERATE_AUTHOR_DOMAIN); 21 | 22 | // Load and show QML 23 | app.loadQml(app.gloperateModulePath() + "/ExampleViewer.qml"); 24 | 25 | // Run main loop 26 | return app.exec(); 27 | } 28 | -------------------------------------------------------------------------------- /source/gloperate-glkernel/include/gloperate-glkernel/stages/MultiFrameAggregationPipeline.inl: -------------------------------------------------------------------------------- 1 | 2 | namespace gloperate_glkernel 3 | { 4 | 5 | 6 | template 7 | gloperate::Input * MultiFrameAggregationPipeline::restartAggregationOn(gloperate::Slot * slot) 8 | { 9 | return m_controlStage->createInput(slot->name()) << *slot; 10 | } 11 | 12 | 13 | } // namespace gloperate_glkernel 14 | 15 | -------------------------------------------------------------------------------- /source/gloperate-glkernel/source/stages/MultiFrameControlStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | 7 | namespace gloperate_glkernel 8 | { 9 | 10 | 11 | CPPEXPOSE_COMPONENT(MultiFrameControlStage, gloperate::Stage) 12 | 13 | 14 | MultiFrameControlStage::MultiFrameControlStage(gloperate::Environment * environment, const std::string & name) 15 | : Stage(environment, name) 16 | , timeDelta("timeDelta", this) 17 | , viewport("viewport", this) 18 | , frameNumber("frameNumber", this) 19 | , multiFrameCount("multiFrameCount", this) 20 | , currentFrame("currentFrame", this) 21 | , aggregationFactor("aggregationFactor", this) 22 | , m_currentFrame(0) 23 | { 24 | } 25 | 26 | MultiFrameControlStage::~MultiFrameControlStage() 27 | { 28 | } 29 | 30 | void MultiFrameControlStage::onProcess() 31 | { 32 | if (m_currentFrame < *multiFrameCount) 33 | { 34 | const auto factor = 1.0f/(m_currentFrame+1); 35 | 36 | currentFrame.setValue(m_currentFrame); 37 | aggregationFactor.setValue(factor); 38 | 39 | ++m_currentFrame; 40 | } 41 | else 42 | { 43 | aggregationFactor.setValue(0.0f); 44 | } 45 | } 46 | 47 | void MultiFrameControlStage::onInputValueChanged(gloperate::AbstractSlot * slot) 48 | { 49 | if (slot != &frameNumber && slot != &timeDelta) 50 | { 51 | m_currentFrame = 0; 52 | } 53 | 54 | if (m_currentFrame < *multiFrameCount) 55 | { 56 | Stage::onInputValueChanged(slot); 57 | } 58 | } 59 | 60 | 61 | } // namespace gloperate_glkernel 62 | -------------------------------------------------------------------------------- /source/gloperate-headless/include/gloperate-headless/GLContextFactory.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | 11 | 12 | namespace gloperate_headless 13 | { 14 | 15 | 16 | /** 17 | * @brief 18 | * OpenGL context factory 19 | */ 20 | class GLOPERATE_HEADLESS_API GLContextFactory : public gloperate::AbstractGLContextFactory 21 | { 22 | public: 23 | /** 24 | * @brief 25 | * Constructor 26 | * 27 | * @param[in] display 28 | * EGL display 29 | * @param[in] width 30 | * Window width 31 | * @param[in] height 32 | * Window height 33 | */ 34 | GLContextFactory(egl::EGLDisplay display, unsigned int width, unsigned int height); 35 | 36 | /** 37 | * @brief 38 | * Destructor 39 | */ 40 | virtual ~GLContextFactory(); 41 | 42 | // Virtual gloperate::AbstractGLContextFactory functions 43 | virtual std::unique_ptr createContext(const gloperate::GLContextFormat & format) const override; 44 | 45 | 46 | private: 47 | egl::EGLDisplay m_display; ///< EGL display 48 | unsigned int m_width; ///< Window width 49 | unsigned int m_height; ///< Window height 50 | }; 51 | 52 | 53 | } // namespace gloperate_headless 54 | -------------------------------------------------------------------------------- /source/gloperate-headless/include/gloperate-headless/getProcAddress.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | namespace gloperate_headless 6 | { 7 | 8 | 9 | using ProcAddress = void(*)(); 10 | 11 | 12 | ProcAddress getProcAddress(const char * name); 13 | 14 | 15 | } // namespace gloperate_headless 16 | -------------------------------------------------------------------------------- /source/gloperate-headless/source/getProcAddress.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | 7 | namespace gloperate_headless 8 | { 9 | 10 | ProcAddress getProcAddress(const char * name) 11 | { 12 | return eglGetProcAddress(name); 13 | } 14 | 15 | 16 | } // namespace gloperate_headless 17 | -------------------------------------------------------------------------------- /source/gloperate-hidapi/include/gloperate-hidapi/HIDDeviceProvider.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | 16 | 17 | namespace gloperate 18 | { 19 | class InputManager; 20 | class AbstractDevice; 21 | } 22 | 23 | namespace gloperate_hidapi 24 | { 25 | 26 | class GLOPERATE_HIDAPI_API HIDDeviceProvider : public gloperate::AbstractDeviceProvider 27 | { 28 | using DeviceMap = std::unordered_map; 29 | 30 | public: 31 | /** 32 | * @brief 33 | * Constructor 34 | */ 35 | HIDDeviceProvider(); 36 | 37 | /** 38 | * @brief 39 | * Destructor 40 | */ 41 | virtual ~HIDDeviceProvider(); 42 | 43 | /** 44 | * @brief 45 | * Updates the list of active devices and polls from those still active 46 | */ 47 | virtual void updateDevices() override; 48 | 49 | 50 | private: 51 | 52 | void createDevice(hid_device_info * device, const std::wstring &deviceID); 53 | 54 | DeviceMap m_openDevices; 55 | }; 56 | 57 | } 58 | -------------------------------------------------------------------------------- /source/gloperate-hidapi/include/gloperate-hidapi/SpaceNavigator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | #include 11 | 12 | 13 | namespace gloperate_hidapi 14 | { 15 | 16 | class GLOPERATE_HIDAPI_API SpaceNavigator : public gloperate::AbstractDevice 17 | { 18 | public: 19 | /** 20 | * @brief 21 | * Constructor 22 | */ 23 | SpaceNavigator(gloperate::InputManager * inputManager, const std::string & deviceDescriptor, const std::string& path); 24 | 25 | /** 26 | * @brief 27 | * Destructor 28 | */ 29 | virtual ~SpaceNavigator(); 30 | 31 | /** 32 | * @brief 33 | * Updates the state of the device and the corresponding controls. 34 | * This will fire signals from the controls. 35 | */ 36 | void virtual update(); 37 | 38 | 39 | private: 40 | hid_device * m_pHandle; 41 | static const int m_timeout = 10; 42 | }; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /source/gloperate-qt/include/gloperate-qt/base/Application.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | 11 | namespace gloperate 12 | { 13 | class Environment; 14 | } 15 | 16 | 17 | namespace gloperate_qt 18 | { 19 | 20 | 21 | /** 22 | * @brief 23 | * Qt application for gloperate 24 | * 25 | * @remarks 26 | * Handles necessary initialization for gloperate applications. 27 | */ 28 | class GLOPERATE_QT_API Application : public QApplication 29 | { 30 | public: 31 | /** 32 | * @brief 33 | * Constructor 34 | * 35 | * @param[in] environment 36 | * Gloperate environment (must NOT be null!) 37 | * @param[in] argc 38 | * Argument count 39 | * @param[in] argv 40 | * Argument list 41 | */ 42 | Application(gloperate::Environment * environment, int & argc, char ** argv); 43 | 44 | /** 45 | * @brief 46 | * Destructor 47 | */ 48 | virtual ~Application(); 49 | 50 | 51 | protected: 52 | void onTimer(); 53 | 54 | 55 | protected: 56 | gloperate::Environment * m_environment; ///< Main gloperate environment 57 | QTimer m_timer; ///< Global timer (e.g., to update scripting timers) 58 | }; 59 | 60 | 61 | } // namespace gloperate_qt 62 | -------------------------------------------------------------------------------- /source/gloperate-qt/include/gloperate-qt/base/GLContextFactory.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | class QWindow; 11 | class QSurfaceFormat; 12 | 13 | 14 | namespace gloperate_qt 15 | { 16 | 17 | 18 | /** 19 | * @brief 20 | * OpenGL context factory 21 | */ 22 | class GLOPERATE_QT_API GLContextFactory : public gloperate::AbstractGLContextFactory 23 | { 24 | public: 25 | /** 26 | * @brief 27 | * Constructor 28 | * 29 | * @param[in] window 30 | * Surface on which contexts are created (must NOT be null) 31 | */ 32 | GLContextFactory(QWindow * window); 33 | 34 | /** 35 | * @brief 36 | * Destructor 37 | */ 38 | virtual ~GLContextFactory(); 39 | 40 | // Virtual gloperate::AbstractGLContextFactory functions 41 | virtual std::unique_ptr createContext(const gloperate::GLContextFormat & format) const override; 42 | 43 | /** 44 | * @brief 45 | * Convert context format description into Qt version 46 | * 47 | * @param[in] format 48 | * OpenGL context format description (gloperate version) 49 | * 50 | * @return 51 | * OpenGL context format description (Qt version) 52 | */ 53 | static QSurfaceFormat toQSurfaceFormat(const gloperate::GLContextFormat & format); 54 | 55 | 56 | protected: 57 | QWindow * m_window; ///< Surface on which contexts are created 58 | }; 59 | 60 | 61 | } // namespace gloperate_qt 62 | -------------------------------------------------------------------------------- /source/gloperate-qt/include/gloperate-qt/base/QtOpenGL.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | class QOpenGLContext; 11 | 12 | 13 | namespace gloperate_qt 14 | { 15 | 16 | 17 | /** 18 | * @brief 19 | * Helper functions to work with Qt and OpenGL 20 | */ 21 | class GLOPERATE_QT_API QtOpenGL 22 | { 23 | public: 24 | /** 25 | * @brief 26 | * Look up OpenGL function by name 27 | * 28 | * @param[in] context 29 | * Qt OpenGL context 30 | * @param[in] name 31 | * Function name 32 | * 33 | * @return 34 | * Function pointer 35 | */ 36 | static glbinding::ProcAddress getProcAddress(QOpenGLContext * context, const char * name); 37 | }; 38 | 39 | 40 | } // namespace gloperate_qt 41 | -------------------------------------------------------------------------------- /source/gloperate-qt/include/gloperate-qt/scripting/ECMA26251Completer.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate_qt 11 | { 12 | 13 | 14 | /** 15 | * @brief 16 | * Text completion for JavaScript 17 | */ 18 | class GLOPERATE_QT_API ECMA26251Completer : public ScriptCompleter 19 | { 20 | public: 21 | /** 22 | * @brief 23 | * Constructor 24 | */ 25 | ECMA26251Completer(); 26 | 27 | /** 28 | * @brief 29 | * Destructor 30 | */ 31 | virtual ~ECMA26251Completer(); 32 | }; 33 | 34 | 35 | } // namespace gloperate_qt 36 | -------------------------------------------------------------------------------- /source/gloperate-qt/include/gloperate-qt/scripting/ECMA26251SyntaxHighlighter.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate_qt 11 | { 12 | 13 | 14 | /** 15 | * @brief 16 | * Syntax highlighting for JavaScript 17 | */ 18 | class GLOPERATE_QT_API ECMA26251SyntaxHighlighter : public ScriptSyntaxHighlighter 19 | { 20 | public: 21 | /** 22 | * @brief 23 | * Constructor 24 | */ 25 | ECMA26251SyntaxHighlighter(); 26 | 27 | /** 28 | * @brief 29 | * Destructor 30 | */ 31 | virtual ~ECMA26251SyntaxHighlighter(); 32 | }; 33 | 34 | 35 | } // namespace gloperate_qt 36 | -------------------------------------------------------------------------------- /source/gloperate-qt/source/base/Application.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | 8 | namespace gloperate_qt 9 | { 10 | 11 | 12 | Application::Application(gloperate::Environment * environment, int & argc, char ** argv) 13 | : QApplication(argc, argv) 14 | , m_environment(environment) 15 | { 16 | // Connect to exit-signal 17 | m_environment->exitApplication.connect([] (int exitCode) 18 | { 19 | QApplication::exit(exitCode); 20 | }); 21 | 22 | // Create global timer 23 | QObject::connect( 24 | &m_timer, &QTimer::timeout, 25 | this, &Application::onTimer 26 | ); 27 | 28 | m_timer.start(5); 29 | } 30 | 31 | Application::~Application() 32 | { 33 | } 34 | 35 | void Application::onTimer() 36 | { 37 | // Update scripting timers 38 | m_environment->timerManager()->update(); 39 | } 40 | 41 | 42 | } // namespace gloperate_qt 43 | -------------------------------------------------------------------------------- /source/gloperate-qt/source/base/GLContext.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | 11 | using namespace gloperate; 12 | 13 | 14 | namespace gloperate_qt 15 | { 16 | 17 | 18 | GLContext::GLContext(QWindow * window, QOpenGLContext * context, bool takeOwnership) 19 | : m_window(window) 20 | , m_context(context) 21 | , m_ownsContext(takeOwnership) 22 | { 23 | assert(window); 24 | assert(context); 25 | 26 | // Activate context 27 | use(); 28 | 29 | // Initialize glbinding and globjects in context (needed for context utils) 30 | initializeBindings([this] (const char * name) -> glbinding::ProcAddress { 31 | return QtOpenGL::getProcAddress(m_context, name); 32 | }); 33 | 34 | // Read context format 35 | m_format = GLContextUtils::retrieveFormat(); 36 | 37 | // Deactivate context 38 | release(); 39 | } 40 | 41 | GLContext::~GLContext() 42 | { 43 | destroyContext(); 44 | } 45 | 46 | void GLContext::use() const 47 | { 48 | if (m_window && m_context) 49 | { 50 | GLContext::makeCurrent(m_context, m_window); 51 | } 52 | } 53 | 54 | void GLContext::release() const 55 | { 56 | if (m_context) 57 | { 58 | GLContext::doneCurrent(m_context); 59 | } 60 | } 61 | 62 | 63 | } // namespace gloperate_qt 64 | -------------------------------------------------------------------------------- /source/gloperate-qt/source/base/GLContext_qt.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | 8 | namespace gloperate_qt 9 | { 10 | 11 | 12 | QOpenGLContext * GLContext::qtContext() const 13 | { 14 | return m_context; 15 | } 16 | 17 | void GLContext::destroyContext() 18 | { 19 | if (m_ownsContext) 20 | { 21 | delete m_context; 22 | } 23 | 24 | m_context = nullptr; 25 | } 26 | 27 | void GLContext::makeCurrent(QOpenGLContext * context, QWindow * window) 28 | { 29 | context->makeCurrent(window); 30 | } 31 | 32 | void GLContext::doneCurrent(QOpenGLContext * context) 33 | { 34 | context->doneCurrent(); 35 | } 36 | 37 | 38 | } // namespace gloperate_qt 39 | -------------------------------------------------------------------------------- /source/gloperate-qt/source/base/QtOpenGL.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | 7 | 8 | namespace gloperate_qt 9 | { 10 | 11 | 12 | glbinding::ProcAddress QtOpenGL::getProcAddress(QOpenGLContext * context, const char * name) 13 | { 14 | // Return if name is invalid 15 | if (name == nullptr) 16 | { 17 | return nullptr; 18 | } 19 | 20 | // Convert name to QString 21 | const auto symbol = std::string(name); 22 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)) 23 | const auto qtSymbol = QByteArray::fromStdString(symbol); 24 | #else 25 | const auto qtSymbol = QByteArray::fromRawData(symbol.c_str(), symbol.size()); 26 | #endif 27 | 28 | // Lookup proc address 29 | return context->getProcAddress(qtSymbol); 30 | } 31 | 32 | 33 | } // namespace gloperate_qt 34 | -------------------------------------------------------------------------------- /source/gloperate-qt/source/scripting/ECMA26251Completer.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | 7 | namespace 8 | { 9 | /** 10 | * @brief 11 | * JavaScript keywords 12 | * 13 | * @see 14 | * http://www.ecma-international.org/ecma-262/5.1/ 15 | */ 16 | const QStringList ECMA_Keywords = QStringList() 17 | << "break" 18 | << "case" 19 | << "catch" 20 | << "continue" 21 | << "debugger" 22 | << "default" 23 | << "delete" 24 | << "do" 25 | << "else" 26 | << "finally" 27 | << "for" 28 | << "function" 29 | << "if" 30 | << "in" 31 | << "instanceof" 32 | << "new" 33 | << "return" 34 | << "switch" 35 | << "this" 36 | << "throw" 37 | << "try" 38 | << "typeof" 39 | << "var" 40 | << "void" 41 | << "while" 42 | << "with"; 43 | } 44 | 45 | 46 | namespace gloperate_qt 47 | { 48 | 49 | 50 | ECMA26251Completer::ECMA26251Completer() 51 | { 52 | registerWords(ECMA_Keywords); 53 | } 54 | 55 | ECMA26251Completer::~ECMA26251Completer() 56 | { 57 | } 58 | 59 | 60 | } // namespace gloperate_qt 61 | -------------------------------------------------------------------------------- /source/gloperate-qtquick/include/gloperate-qtquick/QmlScriptContext.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | 11 | 12 | namespace cppexpose 13 | { 14 | class Variant; 15 | } 16 | 17 | 18 | namespace gloperate_qtquick 19 | { 20 | 21 | 22 | class QmlEngine; 23 | class QmlObjectWrapper; 24 | 25 | 26 | /** 27 | * @brief 28 | * Scripting backend for use in conjunction with Qt quick 29 | */ 30 | class GLOPERATE_QTQUICK_API QmlScriptContext : public cppexpose::AbstractScriptBackend 31 | { 32 | public: 33 | /** 34 | * @brief 35 | * Constructor 36 | * 37 | * @param[in] engine 38 | * Qml engine (must NOT be null!) 39 | */ 40 | QmlScriptContext(QmlEngine * engine); 41 | 42 | /** 43 | * @brief 44 | * Destructor 45 | */ 46 | virtual ~QmlScriptContext(); 47 | 48 | // Virtual AbstractScriptBackend functions 49 | virtual void initialize(cppexpose::ScriptContext * scriptContext) override; 50 | virtual void addGlobalObject(cppexpose::Object * obj) override; 51 | virtual void removeGlobalObject(cppexpose::Object * obj) override; 52 | virtual cppexpose::Variant evaluate(const std::string & code) override; 53 | 54 | 55 | protected: 56 | QmlEngine * m_engine; ///< Qml engine with gloperate integration 57 | }; 58 | 59 | 60 | } // namespace gloperate_qtquick 61 | -------------------------------------------------------------------------------- /source/gloperate-qtquick/include/gloperate-qtquick/QmlScriptFunction.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | 13 | namespace gloperate_qtquick 14 | { 15 | 16 | 17 | class QmlEngine; 18 | 19 | 20 | /** 21 | * @brief 22 | * Script function wrapper 23 | * 24 | * This class represents a function inside the scripting environment 25 | * and makes it available to the reflection meta object system. 26 | */ 27 | class GLOPERATE_QTQUICK_API QmlScriptFunction : public cppexpose::AbstractFunction 28 | { 29 | public: 30 | /** 31 | * @brief 32 | * Constructor 33 | * 34 | * @param[in] engine 35 | * Qml engine 36 | * @param[in] func 37 | * The wrapped function object 38 | */ 39 | QmlScriptFunction(QmlEngine * engine, const QJSValue & func); 40 | 41 | /** 42 | * @brief 43 | * Destructor 44 | */ 45 | ~QmlScriptFunction(); 46 | 47 | // Virtual cppexpose::AbstractFunction functions 48 | virtual std::unique_ptr clone() override; 49 | virtual cppexpose::Variant call(const std::vector & args) override; 50 | 51 | 52 | protected: 53 | QmlEngine * m_engine; ///< Qml engine with gloperate integration 54 | QJSValue m_function; ///< The wrapped function object 55 | }; 56 | 57 | 58 | } // namespace gloperate_qtquick 59 | -------------------------------------------------------------------------------- /source/gloperate-qtquick/include/gloperate-qtquick/TextureItem.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | 13 | class QQuickWindow; 14 | 15 | namespace globjects 16 | { 17 | class Framebuffer; 18 | } 19 | 20 | 21 | namespace gloperate_qtquick 22 | { 23 | 24 | 25 | /** 26 | * @brief 27 | * Qt quick item for displaying a gloperate render stage 28 | */ 29 | class GLOPERATE_QTQUICK_API TextureItem : public QQuickFramebufferObject 30 | { 31 | Q_OBJECT 32 | Q_PROPERTY(QString path READ path WRITE setPath) 33 | 34 | 35 | public: 36 | /** 37 | * @brief 38 | * Constructor 39 | * 40 | * @param[in] parent 41 | * Parent item (can be null) 42 | */ 43 | TextureItem(QQuickItem * parent = nullptr); 44 | 45 | /** 46 | * @brief 47 | * Destructor 48 | */ 49 | virtual ~TextureItem(); 50 | 51 | /** 52 | * @brief 53 | * Get path 54 | * 55 | * @return 56 | * Path to texture slot 57 | */ 58 | const QString & path() const; 59 | 60 | /** 61 | * @brief 62 | * Set path 63 | * 64 | * @param[in] path 65 | * Path to texture slot 66 | */ 67 | void setPath(const QString & path); 68 | 69 | // Virtual QQuickFramebufferObject interface 70 | QQuickFramebufferObject::Renderer * createRenderer() const Q_DECL_OVERRIDE; 71 | 72 | 73 | protected: 74 | QString m_path; ///< Path to texture slot 75 | }; 76 | 77 | 78 | } // namespace gloperate_qtquick 79 | -------------------------------------------------------------------------------- /source/gloperate-qtquick/source/QmlScriptContext.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | 14 | #include 15 | 16 | 17 | namespace gloperate_qtquick 18 | { 19 | 20 | 21 | QmlScriptContext::QmlScriptContext(QmlEngine * engine) 22 | : m_engine(engine) 23 | { 24 | } 25 | 26 | QmlScriptContext::~QmlScriptContext() 27 | { 28 | } 29 | 30 | void QmlScriptContext::initialize(cppexpose::ScriptContext * scriptContext) 31 | { 32 | m_scriptContext = scriptContext; 33 | } 34 | 35 | void QmlScriptContext::addGlobalObject(cppexpose::Object * obj) 36 | { 37 | m_engine->addGlobalObject(obj); 38 | } 39 | 40 | void QmlScriptContext::removeGlobalObject(cppexpose::Object * obj) 41 | { 42 | m_engine->removeGlobalObject(obj); 43 | } 44 | 45 | cppexpose::Variant QmlScriptContext::evaluate(const std::string & code) 46 | { 47 | QQmlExpression expr(m_engine->rootContext(), nullptr, QString::fromStdString(code)); 48 | 49 | return m_engine->fromQVariant( 50 | expr.evaluate() 51 | ); 52 | } 53 | 54 | 55 | } // namespace gloperate_qtquick 56 | -------------------------------------------------------------------------------- /source/gloperate-qtquick/source/QmlScriptFunction.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | 7 | namespace gloperate_qtquick 8 | { 9 | 10 | 11 | QmlScriptFunction::QmlScriptFunction(QmlEngine * engine, const QJSValue & func) 12 | : cppexpose::AbstractFunction() 13 | , m_engine(engine) 14 | , m_function(func) 15 | { 16 | } 17 | 18 | QmlScriptFunction::~QmlScriptFunction() 19 | { 20 | } 21 | 22 | std::unique_ptr QmlScriptFunction::clone() 23 | { 24 | return cppassist::make_unique(m_engine, m_function); 25 | } 26 | 27 | cppexpose::Variant QmlScriptFunction::call(const std::vector & args) 28 | { 29 | QJSValueList argv; 30 | argv.reserve(args.size()); 31 | 32 | for (const cppexpose::Variant & var : args) 33 | { 34 | argv.append(m_engine->toScriptValue(var)); 35 | } 36 | 37 | if (m_function.isCallable()) { 38 | return m_engine->fromScriptValue(m_function.call(argv)); 39 | } else { 40 | return cppexpose::Variant(); 41 | } 42 | } 43 | 44 | 45 | } // namespace gloperate_qtquick 46 | -------------------------------------------------------------------------------- /source/gloperate-qtquick/source/TextureItem.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | 18 | namespace gloperate_qtquick 19 | { 20 | 21 | 22 | TextureItem::TextureItem(QQuickItem * parent) 23 | : QQuickFramebufferObject(parent) 24 | , m_path("") 25 | { 26 | } 27 | 28 | TextureItem::~TextureItem() 29 | { 30 | } 31 | 32 | const QString & TextureItem::path() const 33 | { 34 | return m_path; 35 | } 36 | 37 | void TextureItem::setPath(const QString & path) 38 | { 39 | m_path = path; 40 | } 41 | 42 | QQuickFramebufferObject::Renderer * TextureItem::createRenderer() const 43 | { 44 | // Get gloperate environment 45 | auto * engine = static_cast(QQmlEngine::contextForObject(this)->engine()); 46 | gloperate::Environment * environment = engine->environment(); 47 | 48 | // Create renderer 49 | return new TextureItemRenderer(const_cast(this), environment); 50 | } 51 | 52 | 53 | } // namespace gloperate_qtquick 54 | -------------------------------------------------------------------------------- /source/gloperate-qtquick/source/Utils.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate_qtquick 11 | { 12 | 13 | 14 | void Utils::initContext(glbinding::GetProcAddress functionPointerResolver) 15 | { 16 | // Initialize globjects and glbinding 17 | globjects::init(functionPointerResolver); 18 | #ifdef DEBUG 19 | globjects::DebugMessage::enable(true); 20 | #endif 21 | } 22 | 23 | void Utils::registerGlobjectsContext(glbinding::GetProcAddress functionPointerResolver) 24 | { 25 | globjects::registerCurrentContext(functionPointerResolver); 26 | } 27 | 28 | void Utils::setGlobjectsContext() 29 | { 30 | globjects::setCurrentContext(); 31 | } 32 | 33 | void Utils::clearScreen(float red, float green, float blue, float alpha, bool clearDepthBuffer) 34 | { 35 | gl::glClearColor(red, green, blue, alpha); 36 | 37 | if (clearDepthBuffer) gl::glClear(gl::GL_COLOR_BUFFER_BIT | gl::GL_DEPTH_BUFFER_BIT); 38 | else gl::glClear(gl::GL_COLOR_BUFFER_BIT); 39 | } 40 | 41 | 42 | } // namespace gloperate_qtquick 43 | -------------------------------------------------------------------------------- /source/gloperate-text/include/gloperate-text/stages/FontImporterStage.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | 11 | 12 | namespace openll 13 | { 14 | 15 | 16 | class FontFace; 17 | 18 | 19 | } 20 | 21 | 22 | namespace gloperate_text 23 | { 24 | 25 | 26 | class GLOPERATE_TEXT_API FontImporterStage : public gloperate::Stage 27 | { 28 | public: 29 | Input fontFilePath; 30 | 31 | Output font; 32 | 33 | 34 | public: 35 | explicit FontImporterStage(gloperate::Environment * environment, const std::string & name = ""); 36 | virtual ~FontImporterStage(); 37 | 38 | 39 | protected: 40 | virtual void onProcess() override; 41 | virtual void onContextInit(gloperate::AbstractGLContext * context) override; 42 | virtual void onContextDeinit(gloperate::AbstractGLContext * context) override; 43 | 44 | 45 | protected: 46 | std::unique_ptr m_font; 47 | }; 48 | 49 | 50 | } // namespace gloperate_text 51 | -------------------------------------------------------------------------------- /source/gloperate-text/include/gloperate-text/stages/GlyphPreparationStage.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | 11 | 12 | namespace openll 13 | { 14 | 15 | 16 | class FontFace; 17 | class Label; 18 | class GlyphVertexCloud; 19 | 20 | 21 | } // namespace openll 22 | 23 | 24 | namespace gloperate_text 25 | { 26 | 27 | 28 | class GLOPERATE_TEXT_API GlyphPreparationStage : public gloperate::Stage 29 | { 30 | public: 31 | Input font; 32 | Input *> sequences; 33 | Input optimized; 34 | 35 | Output vertexCloud; 36 | 37 | 38 | public: 39 | explicit GlyphPreparationStage(gloperate::Environment * environment, const std::string & name = ""); 40 | virtual ~GlyphPreparationStage(); 41 | 42 | 43 | protected: 44 | virtual void onContextInit(gloperate::AbstractGLContext * context) override; 45 | virtual void onContextDeinit(gloperate::AbstractGLContext * context) override; 46 | virtual void onProcess() override; 47 | 48 | 49 | protected: 50 | std::unique_ptr m_vertexCloud; 51 | }; 52 | 53 | 54 | } // namespace gloperate_text 55 | -------------------------------------------------------------------------------- /source/gloperate-text/include/gloperate-text/stages/GlyphRenderStage.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include 14 | 15 | 16 | namespace globjects 17 | { 18 | class Framebuffer; 19 | class AbstractStringSource; 20 | class Shader; 21 | class Program; 22 | } 23 | 24 | 25 | namespace openll 26 | { 27 | 28 | 29 | class GlyphRenderer; 30 | class GlyphVertexCloud; 31 | 32 | 33 | } // namespace 34 | 35 | 36 | namespace gloperate_text 37 | { 38 | 39 | 40 | class GLOPERATE_TEXT_API GlyphRenderStage : public gloperate::Stage 41 | { 42 | public: 43 | gloperate::RenderInterface renderInterface; ///< Interface to render into render targets 44 | 45 | Input vertexCloud; 46 | Input camera; 47 | 48 | 49 | public: 50 | explicit GlyphRenderStage(gloperate::Environment * environment, const std::string & name = ""); 51 | virtual ~GlyphRenderStage(); 52 | 53 | 54 | protected: 55 | virtual void onContextInit(gloperate::AbstractGLContext * context) override; 56 | virtual void onContextDeinit(gloperate::AbstractGLContext * context) override; 57 | virtual void onProcess() override; 58 | 59 | 60 | protected: 61 | std::unique_ptr m_renderer; 62 | }; 63 | 64 | 65 | } // namespace gloperate_text 66 | -------------------------------------------------------------------------------- /source/gloperate-text/source/FontLoader.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | 27 | namespace gloperate_text 28 | { 29 | 30 | 31 | CPPEXPOSE_COMPONENT(FontLoader, gloperate::AbstractLoader) 32 | 33 | 34 | FontLoader::FontLoader(gloperate::Environment * environment) 35 | : gloperate::Loader(environment) 36 | { 37 | } 38 | 39 | bool FontLoader::canLoad(const std::string & ext) const 40 | { 41 | return ext == "fnt"; 42 | } 43 | 44 | std::vector FontLoader::loadingTypes() const 45 | { 46 | return { "Bitmap Font (*.fnt)" }; 47 | } 48 | 49 | std::string FontLoader::allLoadingTypes() const 50 | { 51 | return "*.fnt"; 52 | } 53 | 54 | openll::FontFace * FontLoader::load(const std::string & filename 55 | , const cppexpose::Variant &, const std::function) const 56 | { 57 | return openll::FontLoader::load(filename).release(); 58 | } 59 | 60 | 61 | } // namespace gloperate_text 62 | -------------------------------------------------------------------------------- /source/gloperate-text/source/stages/FontImporterStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate_text 11 | { 12 | 13 | 14 | FontImporterStage::FontImporterStage(gloperate::Environment * environment, const std::string & name) 15 | : Stage{ environment, "FontImporterStage", name } 16 | , fontFilePath{ "fontFilePath", this } 17 | , font{ "font", this } 18 | { 19 | } 20 | 21 | FontImporterStage::~FontImporterStage() 22 | { 23 | } 24 | 25 | void FontImporterStage::onContextInit(gloperate::AbstractGLContext * /*context*/) 26 | { 27 | font.invalidate(); 28 | } 29 | 30 | void FontImporterStage::onContextDeinit(gloperate::AbstractGLContext * /*context*/) 31 | { 32 | m_font = nullptr; 33 | 34 | font.setValue(nullptr); 35 | } 36 | 37 | void FontImporterStage::onProcess() 38 | { 39 | cppassist::debug(0, "gloperate-text") << "Attempt to load font from " << fontFilePath.value().path(); 40 | 41 | auto newFont = std::unique_ptr{ m_environment->resourceManager()->load(fontFilePath.value().path())}; 42 | 43 | if (newFont) 44 | { 45 | cppassist::debug(0, "gloperate-text") << "Loaded font " << newFont.get() << " from " << fontFilePath.value().path(); 46 | 47 | m_font = std::move(newFont); 48 | font.setValue(m_font.get()); 49 | } 50 | } 51 | 52 | 53 | } // namespace gloperate_text 54 | -------------------------------------------------------------------------------- /source/gloperate-text/source/stages/GlyphPreparationStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | namespace gloperate_text 12 | { 13 | 14 | 15 | GlyphPreparationStage::GlyphPreparationStage(gloperate::Environment * environment, const std::string & name) 16 | : Stage(environment, name) 17 | , font("font", this) 18 | , sequences("sequences", this) 19 | , optimized("optimized", this) 20 | , vertexCloud("vertexCloud", this) 21 | { 22 | } 23 | 24 | GlyphPreparationStage::~GlyphPreparationStage() 25 | { 26 | } 27 | 28 | void GlyphPreparationStage::onContextInit(gloperate::AbstractGLContext *) 29 | { 30 | m_vertexCloud = cppassist::make_unique(); 31 | 32 | vertexCloud.invalidate(); 33 | } 34 | 35 | void GlyphPreparationStage::onContextDeinit(gloperate::AbstractGLContext *) 36 | { 37 | m_vertexCloud = nullptr; 38 | 39 | vertexCloud.setValue(nullptr); 40 | } 41 | 42 | void GlyphPreparationStage::onProcess() 43 | { 44 | openll::Typesetter::typeset(*m_vertexCloud.get(), *sequences.value(), optimized.value(), false); 45 | 46 | m_vertexCloud->update(); // update drawable 47 | m_vertexCloud->setTexture(font.value()->glyphTexture()); 48 | 49 | vertexCloud.setValue(m_vertexCloud.get()); 50 | } 51 | 52 | 53 | } // namespace gloperate_text 54 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/AbstractComponent.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | 11 | 12 | namespace gloperate 13 | { 14 | 15 | 16 | class Environment; 17 | class Stage; 18 | 19 | 20 | /** 21 | * @brief 22 | * Component base class for gloperate classes 23 | */ 24 | template 25 | class GLOPERATE_TEMPLATE_API AbstractComponent : public cppexpose::AbstractComponent 26 | { 27 | public: 28 | AbstractComponent(); 29 | virtual ~AbstractComponent(); 30 | 31 | virtual std::unique_ptr createInstance(gloperate::Environment * environment) = 0; 32 | }; 33 | 34 | 35 | /** 36 | * @brief 37 | * Component base class for pipelines and stages 38 | */ 39 | template <> 40 | class GLOPERATE_TEMPLATE_API AbstractComponent : public cppexpose::AbstractComponent 41 | { 42 | public: 43 | AbstractComponent() 44 | { 45 | } 46 | 47 | virtual ~AbstractComponent() 48 | { 49 | } 50 | 51 | virtual std::unique_ptr createInstance(gloperate::Environment * environment) = 0; 52 | virtual std::unique_ptr createInstance(gloperate::Environment * environment, const std::string & name) = 0; 53 | }; 54 | 55 | 56 | } // namespace gloperate 57 | 58 | 59 | #include 60 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/AbstractComponent.inl: -------------------------------------------------------------------------------- 1 | 2 | namespace gloperate 3 | { 4 | 5 | 6 | template 7 | AbstractComponent::AbstractComponent() 8 | { 9 | } 10 | 11 | template 12 | AbstractComponent::~AbstractComponent() 13 | { 14 | } 15 | 16 | 17 | } // namespace gloperate 18 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/AbstractContext.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | /** 13 | * @brief 14 | * Abstract base class for contexts 15 | * 16 | * This base class describes a common interface for contexts of any kind. 17 | * It is not meant for just OpenGL contexts, but can also be used for other 18 | * kind of contexts, such as CUDA, OpenAL, etc. 19 | */ 20 | class GLOPERATE_API AbstractContext 21 | { 22 | public: 23 | /** 24 | * @brief 25 | * Constructor 26 | */ 27 | AbstractContext(); 28 | 29 | /** 30 | * @brief 31 | * Destructor 32 | */ 33 | virtual ~AbstractContext(); 34 | 35 | /** 36 | * @brief 37 | * Activate context 38 | */ 39 | virtual void use() const = 0; 40 | 41 | /** 42 | * @brief 43 | * Release context 44 | */ 45 | virtual void release() const = 0; 46 | }; 47 | 48 | 49 | } // namespace gloperate 50 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/AutoTimer.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | 11 | namespace gloperate 12 | { 13 | 14 | 15 | class ChronoTimer; 16 | 17 | 18 | /** 19 | * @brief 20 | * Basic, scoped performance measurements with minimal interface 21 | * 22 | * AutoTimer can be used for quick performance measurements. 23 | * Just create an instance that, when deleted due to ending 24 | * scope, prints out the measured time. Example: 25 | * 26 | * \code{.cpp} 27 | * 28 | * { 29 | * AutoTimer t1("Initialization"); // starts timer 30 | * DoStuff(); 31 | * } // stops timer and prints out the elapsed time. 32 | * 33 | * \endcode 34 | * 35 | * If more control over time measurement is required, consider 36 | * using ChronoTimer directly. 37 | * 38 | * @see ChronoTimer 39 | */ 40 | class GLOPERATE_API AutoTimer 41 | { 42 | public: 43 | /** 44 | * @brief 45 | * Constructor 46 | * 47 | * @param[in] info 48 | * Information that is printed with the debug message 49 | */ 50 | AutoTimer(const std::string & info); 51 | 52 | /** 53 | * @brief 54 | * Destructor 55 | */ 56 | virtual ~AutoTimer(); 57 | 58 | 59 | protected: 60 | static int s_numActiveInstances; 61 | 62 | std::string m_info; 63 | int m_index; 64 | 65 | std::unique_ptr m_timer; 66 | }; 67 | 68 | 69 | } // namespace gloperate 70 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/CachedValue.inl: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | template 14 | CachedValue::CachedValue() 15 | : m_valid(false) 16 | , m_value(T()) 17 | { 18 | } 19 | 20 | template 21 | CachedValue::CachedValue(const T & value) 22 | : m_valid(true) 23 | , m_value(value) 24 | { 25 | } 26 | 27 | template 28 | CachedValue::CachedValue(T && value) 29 | : m_valid(true) 30 | , m_value(std::move(value)) 31 | { 32 | } 33 | 34 | template 35 | bool CachedValue::isValid() const 36 | { 37 | return m_valid; 38 | } 39 | 40 | template 41 | T & CachedValue::value() 42 | { 43 | return m_value; 44 | } 45 | 46 | template 47 | const T & CachedValue::value() const 48 | { 49 | assert(m_valid); 50 | 51 | return m_value; 52 | } 53 | 54 | template 55 | void CachedValue::setValue(const T & value, const bool validate) const 56 | { 57 | m_valid = validate; 58 | m_value = value; 59 | } 60 | 61 | template 62 | void CachedValue::setValue(T && value, const bool validate) const 63 | { 64 | m_valid = validate; 65 | m_value = std::move(value); 66 | } 67 | 68 | template 69 | void CachedValue::validate() const 70 | { 71 | m_valid = true; 72 | } 73 | 74 | template 75 | void CachedValue::invalidate() const 76 | { 77 | m_valid = false; 78 | } 79 | 80 | 81 | } // namespace gloperate 82 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/Component.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate 11 | { 12 | 13 | 14 | class Environment; 15 | class Stage; 16 | 17 | 18 | /** 19 | * @brief 20 | * Component class for gloperate classes 21 | */ 22 | template 23 | class GLOPERATE_TEMPLATE_API Component : public AbstractComponent 24 | { 25 | public: 26 | Component(); 27 | virtual ~Component(); 28 | 29 | virtual std::unique_ptr createInstance(gloperate::Environment * environment) override; 30 | }; 31 | 32 | 33 | /** 34 | * @brief 35 | * Component class for pipelines and stages 36 | */ 37 | template 38 | class GLOPERATE_TEMPLATE_API StageComponent : public AbstractComponent 39 | { 40 | public: 41 | StageComponent(); 42 | virtual ~StageComponent(); 43 | 44 | virtual std::unique_ptr createInstance(gloperate::Environment * environment) override; 45 | virtual std::unique_ptr createInstance(gloperate::Environment * environment, const std::string & name) override; 46 | }; 47 | 48 | 49 | } // namespace gloperate 50 | 51 | 52 | #include 53 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/Component.inl: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | template 10 | Component::Component() 11 | { 12 | } 13 | 14 | template 15 | Component::~Component() 16 | { 17 | } 18 | 19 | template 20 | std::unique_ptr Component::createInstance(gloperate::Environment * environment) 21 | { 22 | return cppassist::make_unique(environment); 23 | } 24 | 25 | 26 | template 27 | StageComponent::StageComponent() 28 | { 29 | } 30 | 31 | template 32 | StageComponent::~StageComponent() 33 | { 34 | } 35 | 36 | template 37 | std::unique_ptr StageComponent::createInstance(gloperate::Environment * environment) 38 | { 39 | return cppassist::make_unique(environment); 40 | } 41 | 42 | template 43 | std::unique_ptr StageComponent::createInstance(gloperate::Environment * environment, const std::string & name) 44 | { 45 | return cppassist::make_unique(environment, name); 46 | } 47 | 48 | 49 | } // namespace gloperate 50 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/ComponentManager.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | 11 | namespace cppexpose 12 | { 13 | class Variant; 14 | } 15 | 16 | 17 | namespace gloperate 18 | { 19 | 20 | 21 | /** 22 | * @brief 23 | * Component manager with script bindings 24 | */ 25 | class GLOPERATE_API ComponentManager : public cppexpose::Object, public cppexpose::ComponentManager 26 | { 27 | public: 28 | /** 29 | * @brief 30 | * Constructor 31 | */ 32 | ComponentManager(); 33 | 34 | /** 35 | * @brief 36 | * Destructor 37 | */ 38 | ~ComponentManager(); 39 | 40 | /** 41 | * @brief 42 | * Scan for gloperate plugins 43 | * 44 | * @remarks 45 | * This scans only for plugin libraries with the suffix "-plugins", 46 | * or "-plugins-debug" for debug builds. 47 | */ 48 | void scanPlugins(); 49 | 50 | 51 | protected: 52 | // Scripting functions 53 | std::string scr_getPluginPaths(); 54 | void scr_setPluginPaths(const std::string & allPaths); 55 | cppexpose::Variant scr_pluginPaths(); 56 | void scr_addPluginPath(const std::string & path); 57 | void scr_removePluginPath(const std::string & path); 58 | void scr_scanPlugins(); 59 | cppexpose::Variant scr_components(); 60 | void scr_printComponents(); 61 | }; 62 | 63 | 64 | } // namespace gloperate 65 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/Loader.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | 11 | namespace cppexpose 12 | { 13 | class Variant; 14 | } 15 | 16 | 17 | namespace gloperate 18 | { 19 | 20 | 21 | /** 22 | * @brief 23 | * Loader class template 24 | */ 25 | template 26 | class GLOPERATE_TEMPLATE_API Loader : public AbstractLoader 27 | { 28 | public: 29 | /** 30 | * @brief 31 | * Constructor 32 | * 33 | * @param[in] environment 34 | * Environment to which the loader belongs (must NOT be null!) 35 | */ 36 | Loader(Environment * environment); 37 | 38 | /** 39 | * @brief 40 | * Destructor 41 | */ 42 | virtual ~Loader(); 43 | 44 | /** 45 | * @brief 46 | * Load resource from file 47 | * 48 | * @param[in] filename 49 | * File name 50 | * @param[in] options 51 | * Options for loading resource, see documentation of specific loader for supported options 52 | * @param[in] progress 53 | * Callback function that is invoked on progress (can be empty) 54 | * 55 | * @return 56 | * Loaded resource (can be null) 57 | */ 58 | virtual T * load(const std::string & filename, const cppexpose::Variant & options, std::function progress) const = 0; 59 | }; 60 | 61 | 62 | } // namespace gloperate 63 | 64 | 65 | #include 66 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/Loader.inl: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | template 10 | Loader::Loader(Environment * environment) 11 | : AbstractLoader(environment) 12 | { 13 | } 14 | 15 | template 16 | Loader::~Loader() 17 | { 18 | } 19 | 20 | 21 | } // namespace gloperate 22 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/Range.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | /** 13 | * @brief 14 | * Pair of values that describe a range 15 | */ 16 | class GLOPERATE_API Range 17 | { 18 | public: 19 | /** 20 | * @brief 21 | * Constructor 22 | */ 23 | Range(); 24 | 25 | /** 26 | * @brief 27 | * Constructor 28 | * 29 | * @param[in] minValue 30 | * Minimum value 31 | * @param[in] maxValue 32 | * Maximum value 33 | */ 34 | Range(float minValue, float maxValue); 35 | 36 | /** 37 | * @brief 38 | * Get minimum value 39 | * 40 | * @return 41 | * Minimum value 42 | */ 43 | float minimumValue() const; 44 | 45 | /** 46 | * @brief 47 | * Set minimum value 48 | * 49 | * @param[in] minValue 50 | * Minimum value 51 | */ 52 | void setMinimumValue(float minValue); 53 | 54 | /** 55 | * @brief 56 | * Get maximum value 57 | * 58 | * @return 59 | * Maximum value 60 | */ 61 | float maximumValue() const; 62 | 63 | /** 64 | * @brief 65 | * Set maximum value 66 | * 67 | * @param[in] maxValue 68 | * Maximum value 69 | */ 70 | void setMaximumValue(float maxValue); 71 | 72 | 73 | protected: 74 | float m_minValue; 75 | float m_maxValue; 76 | }; 77 | 78 | 79 | } // namespace gloperate 80 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/Storer.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | 11 | namespace cppexpose { 12 | class Variant; 13 | } 14 | 15 | 16 | namespace gloperate 17 | { 18 | 19 | 20 | /** 21 | * @brief 22 | * Storer class template 23 | */ 24 | template 25 | class GLOPERATE_TEMPLATE_API Storer : public AbstractStorer 26 | { 27 | public: 28 | /** 29 | * @brief 30 | * Constructor 31 | * 32 | * @param[in] environment 33 | * Environment to which the storer belongs (must NOT be null!) 34 | */ 35 | Storer(Environment * environment); 36 | 37 | /** 38 | * @brief 39 | * Destructor 40 | */ 41 | virtual ~Storer(); 42 | 43 | /** 44 | * @brief 45 | * Store resource to file 46 | * 47 | * @param[in] filename 48 | * File name 49 | * @param[in] object 50 | * Resource 51 | * @param[in] options 52 | * Options for loading resource, see documentation of specific storer for supported options 53 | * @param[in] progress 54 | * Callback function that is invoked on progress (can be empty) 55 | * 56 | * @return 57 | * 'true' if storage was successful, else 'false' 58 | */ 59 | virtual bool store(const std::string & filename, const T * object, const cppexpose::Variant & options, std::function progress) const = 0; 60 | }; 61 | 62 | 63 | } // namespace gloperate 64 | 65 | 66 | #include 67 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/Storer.inl: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | template 10 | Storer::Storer(Environment * environment) 11 | : AbstractStorer(environment) 12 | { 13 | } 14 | 15 | template 16 | Storer::~Storer() 17 | { 18 | } 19 | 20 | 21 | } // namespace gloperate 22 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/base/System.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate 11 | { 12 | 13 | 14 | class Environment; 15 | 16 | 17 | /** 18 | * @brief 19 | * System functions for scripting 20 | */ 21 | class GLOPERATE_API System : public cppexpose::Object 22 | { 23 | public: 24 | /** 25 | * @brief 26 | * Constructor 27 | * 28 | * @param[in] environment 29 | * Environment (must NOT be null!) 30 | */ 31 | System(Environment * environment); 32 | 33 | /** 34 | * @brief 35 | * Destructor 36 | */ 37 | virtual ~System(); 38 | 39 | 40 | protected: 41 | // Scripting functions 42 | int scr_logLevel(); 43 | void scr_setLogLevel(int logLevel); 44 | bool scr_safeMode(); 45 | void scr_load(const std::string & filename); 46 | std::string scr_readFile(const std::string & filename); 47 | void scr_writeFile(const std::string & filename, const cppexpose::Variant & value); 48 | void scr_appendFile(const std::string & filename, const cppexpose::Variant & value); 49 | void scr_exit(int exitCode); 50 | 51 | 52 | protected: 53 | Environment * m_environment; ///< Gloperate environment (must NOT be null!) 54 | }; 55 | 56 | 57 | } // namespace gloperate 58 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/gloperate.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | /** 14 | * @brief 15 | * Get path to gloperate data files 16 | * 17 | * Uses cpplocate to locate the module 'gloperate' and reads the 18 | * data path from it's configuration. 19 | * 20 | * @return 21 | * Path to gloperate data files, or '' if module was not found 22 | */ 23 | GLOPERATE_API const std::string & dataPath(); 24 | 25 | /** 26 | * @brief 27 | * Get path to gloperate plugins 28 | * 29 | * Uses cpplocate to locate the module 'gloperate' and reads the 30 | * plugins path from it's configuration. 31 | * 32 | * @return 33 | * Path to gloperate plugins, or '' if module was not found 34 | */ 35 | GLOPERATE_API const std::string & pluginPath(); 36 | 37 | 38 | } // namespace gloperate 39 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/input/AbstractDeviceProvider.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | class InputManager; 13 | 14 | 15 | /** 16 | * @brief 17 | * Base class for input device providers 18 | * 19 | * A device provider is responsible for managing and updating input devices 20 | * of a certain kind. For example, a HID input device provider might manage 21 | * all HID devices is detects on the computer. 22 | * 23 | * A device provider registers and unregisters devices at the input manager 24 | * when it detects them and updates the devices (i.e., polling events). 25 | */ 26 | class GLOPERATE_API AbstractDeviceProvider 27 | { 28 | public: 29 | /** 30 | * @brief 31 | * Constructor 32 | */ 33 | AbstractDeviceProvider(); 34 | 35 | /** 36 | * @brief 37 | * Destructor 38 | */ 39 | virtual ~AbstractDeviceProvider(); 40 | 41 | /** 42 | * @brief 43 | * Update device list, add and remove devices on the input manager 44 | */ 45 | virtual void updateDevices() = 0; 46 | 47 | 48 | protected: 49 | InputManager * m_inputManager; ///< Input manager that owns the device provider 50 | }; 51 | 52 | 53 | } // namespace gloperate 54 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/input/AxisEvent.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | class GLOPERATE_API AxisEvent : public InputEvent 13 | { 14 | public: 15 | /** 16 | * @brief 17 | * Constructor 18 | * 19 | * @param[in] type 20 | * The type of the AxisEvent (must be InputEvent::Type::SpatialAxis) 21 | * @param[in] dispatchingDevice 22 | * Pointer to the device that generated the event (must NOT be null) 23 | * @param[in] value 24 | * The 3x3 matrix to be held by the event 25 | */ 26 | AxisEvent(Type type, AbstractDevice * dispatchingDevice, glm::mat3 value); 27 | 28 | /** 29 | * @brief 30 | * A getter for the value of the event 31 | * 32 | * @return 33 | * The value held by the event 34 | */ 35 | const glm::mat3 & value() const; 36 | 37 | // Virtual InputEvent interface 38 | virtual std::string asString() const override; 39 | 40 | 41 | protected: 42 | glm::mat3 m_value; 43 | }; 44 | 45 | 46 | } // namespace gloperate 47 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/input/ButtonEvent.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | class GLOPERATE_API ButtonEvent : public InputEvent 13 | { 14 | public: 15 | /** 16 | * @brief 17 | * Constructor 18 | * 19 | * @param[in] type 20 | * The type of the ButtonEvent (must be either of InputEvent::Type::ButtonPress or InputEvent::Type::ButtonRelease) 21 | * @param[in] dispatchingDevice 22 | * Pointer to the device that generated the event (must NOT be null) 23 | * @param[in] key 24 | * The key code 25 | * @param[in] modifier 26 | * Th active modifiers 27 | */ 28 | ButtonEvent(Type type, AbstractDevice * dispatchingDevice, int key, int modifier); 29 | 30 | /** 31 | * @brief 32 | * Get key code 33 | * 34 | * @return 35 | * The key code 36 | */ 37 | int key() const; 38 | 39 | /** 40 | * @brief 41 | * Get modifier 42 | * 43 | * @return 44 | * The modifier 45 | */ 46 | int modifier() const; 47 | 48 | 49 | // Virtual InputEvent interface 50 | virtual std::string asString() const override; 51 | 52 | protected: 53 | int m_key; 54 | int m_modifier; 55 | }; 56 | 57 | 58 | } // namespace gloperate 59 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/input/KeyboardDevice.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | class GLOPERATE_API KeyboardDevice : public AbstractDevice 13 | { 14 | public: 15 | /** 16 | * @brief 17 | * Constructor 18 | * 19 | * @param[in] inputManager 20 | * A pointer to the inputManager (must NOT be null) 21 | * @param[in] deviceDescriptor 22 | * [TODO] What is a device descriptor? 23 | */ 24 | KeyboardDevice(InputManager * inputManager, const std::string & deviceDescriptor); 25 | 26 | /** 27 | * @brief 28 | * Destructor 29 | */ 30 | virtual ~KeyboardDevice(); 31 | 32 | /** 33 | * @brief 34 | * Generate a ButtonEvent of type ButtonPress 35 | * 36 | * @param[in] key 37 | * The key that was pressed 38 | * 39 | * @param[in] modifier 40 | * The modifiers that apply to the key 41 | */ 42 | void keyPress(int key, int modifier); 43 | 44 | /** 45 | * @brief 46 | * Generate a ButtonEvent of type ButtonRelease 47 | * 48 | * @param[in] key 49 | * The key that was released 50 | * @param[in] modifier 51 | * The modifiers that apply to the key 52 | */ 53 | void keyRelease(int key, int modifier); 54 | 55 | // Virtual AbstractDevice interface 56 | virtual void update() override; 57 | }; 58 | 59 | 60 | } // namespace gloperate 61 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/input/PrintLineConsumer.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | class GLOPERATE_API PrintLineConsumer : public AbstractEventConsumer 13 | { 14 | public: 15 | PrintLineConsumer(InputManager * inputManager); 16 | virtual ~PrintLineConsumer(); 17 | 18 | virtual void onEvent(InputEvent * event) override; 19 | }; 20 | 21 | 22 | } // namespace gloperate 23 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/pipeline/AbstractSlot.inl: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | template 13 | class Slot; 14 | 15 | 16 | } // namespace gloperate 17 | 18 | 19 | namespace 20 | { 21 | 22 | 23 | template 24 | struct isOfAnyTypeHelper; 25 | 26 | template 27 | struct isOfAnyTypeHelper 28 | { 29 | static bool value(const gloperate::AbstractSlot * slot) 30 | { 31 | return isOfAnyTypeHelper::value(slot) || isOfAnyTypeHelper::value(slot); 32 | } 33 | }; 34 | 35 | template 36 | struct isOfAnyTypeHelper 37 | { 38 | static bool value(const gloperate::AbstractSlot * slot) 39 | { 40 | return dynamic_cast *>(slot) != nullptr; 41 | } 42 | }; 43 | 44 | template <> 45 | struct isOfAnyTypeHelper<> 46 | { 47 | static bool value(const gloperate::AbstractSlot * /*slot*/) 48 | { 49 | return false; 50 | } 51 | }; 52 | 53 | 54 | } // namespace 55 | 56 | 57 | namespace gloperate 58 | { 59 | 60 | 61 | template 62 | bool AbstractSlot::isOfAnyType() const 63 | { 64 | return isOfAnyTypeHelper::value(this); 65 | } 66 | 67 | 68 | } // namespace gloperate 69 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/AbstractColorGradient.inl: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | template 10 | std::array AbstractColorGradient::pixelData() const 11 | { 12 | std::array data; 13 | 14 | fillPixelData(data.data(), numPixels); 15 | 16 | return data; 17 | } 18 | 19 | 20 | } // namespace gloperate 21 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/AbstractDrawable.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | /** 13 | * @brief 14 | * Base class for drawables 15 | * 16 | * A drawable is any kind of geometry that can be rendered on the GPU. 17 | * Subclasses must implement the draw-method, which executes the actual rendering. 18 | */ 19 | class GLOPERATE_API AbstractDrawable 20 | { 21 | public: 22 | /** 23 | * @brief 24 | * Constructor 25 | */ 26 | AbstractDrawable(); 27 | 28 | /** 29 | * @brief 30 | * Destructor 31 | */ 32 | virtual ~AbstractDrawable(); 33 | 34 | /** 35 | * @brief 36 | * Draw geometry 37 | */ 38 | virtual void draw() const = 0; 39 | }; 40 | 41 | 42 | } // namespace gloperate 43 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/Box.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | 13 | namespace gloperate 14 | { 15 | 16 | 17 | /** 18 | * @brief 19 | * Box drawable 20 | */ 21 | class GLOPERATE_API Box : public Shape 22 | { 23 | public: 24 | /** 25 | * @brief 26 | * Constructor 27 | * 28 | * @param[in] size 29 | * Edge width, height, and depth 30 | * @param[in] options 31 | * Shape options 32 | */ 33 | Box(float size = 2.0f, cppassist::Flags options = ShapeOption::None); 34 | 35 | /** 36 | * @brief 37 | * Constructor 38 | * 39 | * @param[in] width 40 | * Edge width 41 | * @param[in] height 42 | * Edge height 43 | * @param[in] depth 44 | * Edge depth 45 | * @param[in] options 46 | * Shape options 47 | */ 48 | Box(float width, float height, float depth, cppassist::Flags options = ShapeOption::None); 49 | 50 | /** 51 | * @brief 52 | * Destructor 53 | */ 54 | virtual ~Box(); 55 | 56 | // Virtual AbstractDrawable functions 57 | virtual void draw() const override; 58 | 59 | 60 | protected: 61 | std::unique_ptr m_drawable; ///< Underlying drawable object 62 | std::unique_ptr m_vertices; ///< Vertex buffer 63 | std::unique_ptr m_texCoords; ///< Texture coordinate buffer 64 | }; 65 | 66 | 67 | } // namespace gloperate 68 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/ColorGradientList.inl: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | template 10 | ColorGradientList::ColorGradientList(AbstractColorGradient * gradient, Args... args) 11 | : ColorGradientList(args...) 12 | { 13 | add(std::unique_ptr(gradient)); 14 | } 15 | 16 | 17 | } // namespace gloperate 18 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/ColorRenderTarget.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate 11 | { 12 | 13 | 14 | /** 15 | * @brief 16 | * Color render target that represents one color target we can render into 17 | * 18 | * A render target can internally be: a texture, a renderbuffer, 19 | * a symbolic attachment of the default renderbuffer, or a user-defined 20 | * renderbuffer with attachment specification. 21 | */ 22 | class GLOPERATE_API ColorRenderTarget : public AbstractRenderTarget 23 | { 24 | public: 25 | using AbstractRenderTarget::AbstractRenderTarget; 26 | 27 | // Virtual AbstractRenderTarget interface 28 | virtual gl::GLint clearBufferDrawBuffer(size_t index) const override; 29 | virtual gl::GLenum drawBufferAttachment(size_t index) const override; 30 | virtual AttachmentType underlyingAttachmentType() const override; 31 | virtual gl::GLenum attachmentGLType() const override; 32 | }; 33 | 34 | 35 | } // namespace gloperate 36 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/DepthRenderTarget.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate 11 | { 12 | 13 | 14 | /** 15 | * @brief 16 | * Depth render target that represents one depth target for depth tests during rasterization 17 | * 18 | * A render target can internally be: a texture, a renderbuffer, 19 | * a symbolic attachment of the default renderbuffer, or a user-defined 20 | * renderbuffer with attachment specification. 21 | */ 22 | class GLOPERATE_API DepthRenderTarget : public AbstractRenderTarget 23 | { 24 | public: 25 | using AbstractRenderTarget::AbstractRenderTarget; 26 | 27 | // Virtual AbstractRenderTarget interface 28 | virtual gl::GLint clearBufferDrawBuffer(size_t index) const override; 29 | virtual gl::GLenum drawBufferAttachment(size_t index) const override; 30 | virtual AttachmentType underlyingAttachmentType() const override; 31 | virtual gl::GLenum attachmentGLType() const override; 32 | }; 33 | 34 | 35 | } // namespace gloperate 36 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/DepthStencilRenderTarget.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate 11 | { 12 | 13 | 14 | /** 15 | * @brief 16 | * Combined depth stencil render target that represents one depth stencil target for depth and stencil tests during rasterization 17 | * 18 | * A render target can internally be: a texture, a renderbuffer, 19 | * a symbolic attachment of the default renderbuffer, or a user-defined 20 | * renderbuffer with attachment specification. 21 | */ 22 | class GLOPERATE_API DepthStencilRenderTarget : public AbstractRenderTarget 23 | { 24 | public: 25 | using AbstractRenderTarget::AbstractRenderTarget; 26 | 27 | // Virtual AbstractRenderTarget interface 28 | virtual gl::GLint clearBufferDrawBuffer(size_t index) const override; 29 | virtual gl::GLenum drawBufferAttachment(size_t index) const override; 30 | virtual AttachmentType underlyingAttachmentType() const override; 31 | virtual gl::GLenum attachmentGLType() const override; 32 | }; 33 | 34 | 35 | } // namespace gloperate 36 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/Drawable.inl: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | template 10 | void Drawable::setData(size_t index, const std::vector & data, gl::GLenum usage) 11 | { 12 | buffer(index)->setData(data, usage); 13 | } 14 | 15 | template 16 | void Drawable::setData(size_t index, const std::array & data, gl::GLenum usage) 17 | { 18 | buffer(index)->setData(data, usage); 19 | } 20 | 21 | 22 | } // namespace gloperate 23 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/Light.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | struct Light 14 | { 15 | LightType type; 16 | glm::vec3 color; 17 | glm::vec3 position; 18 | glm::vec3 attenuationCoefficients; 19 | }; 20 | 21 | 22 | } // namespace gloperate 23 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/LightType.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | enum LightType { 10 | None = 0, 11 | Ambient, 12 | Directional, 13 | Point, 14 | PointAttenuated 15 | }; 16 | 17 | 18 | } // namespace gloperate 19 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/LinearColorGradient.inl: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | template 10 | LinearColorGradient::LinearColorGradient(const std::string & name, bool discrete, const std::array & colors) 11 | : AbstractColorGradient(name) 12 | , m_colors(colors.begin(), colors.end()) 13 | , m_discrete(discrete) 14 | { 15 | } 16 | 17 | template 18 | LinearColorGradient::LinearColorGradient(const std::string & name, bool discrete, const Color & color, Args... args) 19 | : LinearColorGradient(name, discrete, args...) 20 | { 21 | m_colors.insert(m_colors.begin(), color); 22 | } 23 | 24 | 25 | } // namespace gloperate 26 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/NoiseTexture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | 11 | namespace globjects 12 | { 13 | class Texture; 14 | } 15 | 16 | 17 | namespace gloperate 18 | { 19 | 20 | 21 | class GLOPERATE_API NoiseTexture 22 | { 23 | public: 24 | NoiseTexture( 25 | unsigned int inputDimensions, 26 | unsigned int outputDimensions, 27 | gl::GLsizei textureSize = 64); 28 | 29 | globjects::Texture *texture(); 30 | 31 | void bindActive(unsigned int index) const; 32 | void unbindActive(unsigned int index) const; 33 | 34 | 35 | protected: 36 | static gl::GLenum targetForDimensions(unsigned int dimensions); 37 | static gl::GLenum internalFormatForDimensions(unsigned int dimensions); 38 | static gl::GLenum formatForDimensions(unsigned int dimensions); 39 | 40 | static std::unique_ptr createTexture( 41 | unsigned int inputDimensions, 42 | unsigned int outputDimensions, 43 | gl::GLsizei textureSize); 44 | 45 | static std::vector generateNoise( 46 | unsigned int inputDimensions, 47 | unsigned int outputDimensions, 48 | gl::GLsizei textureSize); 49 | 50 | 51 | protected: 52 | std::unique_ptr m_texture; 53 | }; 54 | 55 | 56 | } // namespace gloperate 57 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/Point.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | 13 | namespace gloperate 14 | { 15 | 16 | 17 | /** 18 | * @brief 19 | * Point shape 20 | */ 21 | class GLOPERATE_API Point : public Shape 22 | { 23 | public: 24 | /** 25 | * @brief 26 | * Constructor 27 | * 28 | * @param[in] options 29 | * Shape options 30 | */ 31 | Point(cppassist::Flags options = ShapeOption::None); 32 | 33 | /** 34 | * @brief 35 | * Destructor 36 | */ 37 | virtual ~Point(); 38 | 39 | // Virtual AbstractDrawable functions 40 | virtual void draw() const override; 41 | 42 | 43 | protected: 44 | std::unique_ptr m_drawable; ///< Underlying drawable object 45 | std::unique_ptr m_vertices; ///< Vertex buffer 46 | std::unique_ptr m_texCoords; ///< Texture coordinate buffer 47 | }; 48 | 49 | 50 | } // namespace gloperate 51 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/Quad.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | 13 | namespace gloperate 14 | { 15 | 16 | 17 | /** 18 | * @brief 19 | * Quad shape 20 | */ 21 | class GLOPERATE_API Quad : public Shape 22 | { 23 | public: 24 | /** 25 | * @brief 26 | * Constructor 27 | * 28 | * @param[in] size 29 | * Edge width and height 30 | * @param[in] options 31 | * Shape options 32 | */ 33 | Quad(float size = 2.0f, cppassist::Flags options = ShapeOption::None); 34 | 35 | /** 36 | * @brief 37 | * Constructor 38 | * 39 | * @param[in] width 40 | * Edge width 41 | * @param[in] height 42 | * Edge height 43 | * @param[in] options 44 | * Shape options 45 | */ 46 | Quad(float width, float height, cppassist::Flags options = ShapeOption::None); 47 | 48 | /** 49 | * @brief 50 | * Destructor 51 | */ 52 | virtual ~Quad(); 53 | 54 | // Virtual AbstractDrawable functions 55 | virtual void draw() const override; 56 | 57 | 58 | protected: 59 | std::unique_ptr m_drawable; ///< Underlying drawable object 60 | std::unique_ptr m_vertices; ///< Vertex buffer 61 | std::unique_ptr m_texCoords; ///< Texture coordinate buffer 62 | }; 63 | 64 | 65 | } // namespace gloperate 66 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/ShapeType.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate 11 | { 12 | 13 | 14 | /** 15 | * @brief 16 | * Type of basic shapes 17 | */ 18 | enum class ShapeType : int 19 | { 20 | None, ///< No shape 21 | Point, ///< Single point 22 | Triangle, ///< 2D triangle 23 | Quad, ///< 2D rectangle or quad 24 | Box, ///< 3D box or cube 25 | Sphere ///< 3D sphere or ellipsoid 26 | }; 27 | 28 | /** 29 | * @brief 30 | * Options for basic shapes 31 | */ 32 | enum class ShapeOption : int 33 | { 34 | None = 0, ///< No option 35 | IncludeTexCoords = 1 ///< Include texture coordinates in geometry 36 | }; 37 | 38 | 39 | } // namespace gloperate 40 | 41 | 42 | namespace cppexpose 43 | { 44 | 45 | 46 | template <> 47 | struct EnumDefaultStrings 48 | { 49 | std::map operator()() 50 | { 51 | std::map values; 52 | values[gloperate::ShapeType::None] = "None"; 53 | values[gloperate::ShapeType::Point] = "Point"; 54 | values[gloperate::ShapeType::Quad] = "Quad"; 55 | values[gloperate::ShapeType::Triangle] = "Triangle"; 56 | values[gloperate::ShapeType::Box] = "Box"; 57 | values[gloperate::ShapeType::Sphere] = "Sphere"; 58 | 59 | return values; 60 | } 61 | }; 62 | 63 | 64 | } // namespace cppexpose 65 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/Sphere.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | namespace gloperate 15 | { 16 | 17 | 18 | /** 19 | * @brief 20 | * Sphere drawable 21 | */ 22 | class GLOPERATE_API Sphere : public Shape 23 | { 24 | public: 25 | /** 26 | * @brief 27 | * Constructor 28 | * 29 | * @param[in] radius 30 | * Sphere radius 31 | * @param[in] options 32 | * Shape options 33 | */ 34 | Sphere(float radius = 1.0f, cppassist::Flags options = ShapeOption::None); 35 | 36 | /** 37 | * @brief 38 | * Destructor 39 | */ 40 | virtual ~Sphere(); 41 | 42 | // Virtual AbstractDrawable functions 43 | virtual void draw() const override; 44 | 45 | 46 | protected: 47 | std::unique_ptr m_icosahedron; ///< Refinable icosahedron 48 | std::unique_ptr m_drawable; ///< Underlying drawable object 49 | std::unique_ptr m_vertices; ///< Vertex buffer 50 | std::unique_ptr m_texCoords; ///< Texture coordinate buffer 51 | std::unique_ptr m_indices; ///< Index buffer 52 | }; 53 | 54 | 55 | } // namespace gloperate 56 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/StencilRenderTarget.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate 11 | { 12 | 13 | 14 | /** 15 | * @brief 16 | * Depth stencil render target that represents one depth stencil target 17 | * for depth and stencil tests during rasterization 18 | * 19 | * A render target can internally be: a texture, a renderbuffer, 20 | * a symbolic attachment of the default renderbuffer, or a user-defined 21 | * renderbuffer with attachment specification. 22 | */ 23 | class GLOPERATE_API StencilRenderTarget : public AbstractRenderTarget 24 | { 25 | public: 26 | using AbstractRenderTarget::AbstractRenderTarget; 27 | 28 | // Virtual AbstractRenderTarget interface 29 | virtual gl::GLint clearBufferDrawBuffer(size_t index) const override; 30 | virtual gl::GLenum drawBufferAttachment(size_t index) const override; 31 | virtual AttachmentType underlyingAttachmentType() const override; 32 | virtual gl::GLenum attachmentGLType() const override; 33 | }; 34 | 35 | 36 | } // namespace gloperate 37 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/TransparencyMasksGenerator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | 11 | namespace gloperate 12 | { 13 | 14 | 15 | class GLOPERATE_API TransparencyMasksGenerator 16 | { 17 | public: 18 | static const auto s_alphaRes = 256u; 19 | static const auto s_numMasks = 1024u; 20 | 21 | using mask_t = unsigned char; 22 | using maskDistribution_t = std::array; 23 | 24 | using maskDistributions_t = std::array; 25 | 26 | public: 27 | static std::unique_ptr generateDistributions(unsigned int numSamples); 28 | 29 | public: 30 | TransparencyMasksGenerator(unsigned int numSamples); 31 | 32 | std::unique_ptr generateDistributions(); 33 | 34 | protected: 35 | void generateCombinations(); 36 | 37 | void generateCombinationsForK( 38 | const std::bitset<8> & combination, 39 | unsigned char offset, 40 | unsigned char k, 41 | std::vector & combinationMasks); 42 | 43 | void generateDistributionForAlpha( 44 | unsigned int alphaIndex, 45 | maskDistribution_t & masks); 46 | 47 | void copyMasks( 48 | unsigned int numMasks, 49 | const std::vector & fromMasks, 50 | maskDistribution_t::iterator & toMaskIt); 51 | 52 | private: 53 | const unsigned int m_numSamples; 54 | std::vector> m_combinationMasks; 55 | }; 56 | 57 | 58 | } // namespace gloperate 59 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/rendering/Triangle.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | 13 | namespace gloperate 14 | { 15 | 16 | 17 | /** 18 | * @brief 19 | * Triangle shape 20 | */ 21 | class GLOPERATE_API Triangle : public Shape 22 | { 23 | public: 24 | /** 25 | * @brief 26 | * Constructor 27 | * 28 | * @param[in] size 29 | * Edge width and height 30 | * @param[in] options 31 | * Shape options 32 | */ 33 | Triangle(float size = 2.0f, cppassist::Flags options = ShapeOption::None); 34 | 35 | /** 36 | * @brief 37 | * Constructor 38 | * 39 | * @param[in] width 40 | * Edge width 41 | * @param[in] height 42 | * Edge height 43 | * @param[in] options 44 | * Shape options 45 | */ 46 | Triangle(float width, float height, cppassist::Flags options = ShapeOption::None); 47 | 48 | /** 49 | * @brief 50 | * Destructor 51 | */ 52 | virtual ~Triangle(); 53 | 54 | // Virtual AbstractDrawable functions 55 | virtual void draw() const override; 56 | 57 | 58 | protected: 59 | std::unique_ptr m_drawable; ///< Underlying drawable object 60 | std::unique_ptr m_vertices; ///< Vertex buffer 61 | std::unique_ptr m_texCoords; ///< Texture coordinate buffer 62 | }; 63 | 64 | 65 | } // namespace gloperate 66 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/stages/base/CubeMapProjectionsStage.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | 17 | namespace gloperate 18 | { 19 | 20 | class GLOPERATE_API CubeMapProjectionsStage : public gloperate::Stage 21 | { 22 | public: 23 | CubeMapProjectionsStage(gloperate::Environment * environment, const std::string & name = "CubeMapProjectionsStage"); 24 | 25 | 26 | public: 27 | Input center; 28 | Input nearPlane; 29 | Input farPlane; 30 | 31 | Output*> projections; 32 | Output> projectionsDirect; 33 | 34 | 35 | protected: 36 | virtual void onProcess() override; 37 | 38 | 39 | protected: 40 | std::vector m_projections; 41 | }; 42 | 43 | 44 | } // namespace gloperate 45 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/stages/base/VectorSelectionStage.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | 17 | namespace gloperate 18 | { 19 | 20 | 21 | /** 22 | * @brief 23 | * Stage for blitting from one framebuffer to another 24 | */ 25 | template 26 | class VectorSelectionStage : public Stage 27 | { 28 | public: 29 | // Inputs 30 | Input *> elements; ///< Vector containing all possible elements 31 | Input index; ///< Target index of the selected element 32 | Input defaultValue; ///< Default value if index or vector is not valid 33 | 34 | // Outputs 35 | Output element; ///< Selected element 36 | 37 | 38 | public: 39 | /** 40 | * @brief 41 | * Constructor 42 | * 43 | * @param[in] environment 44 | * Environment to which the stage belongs (must NOT be null!) 45 | * @param[in] name 46 | * Stage name 47 | */ 48 | VectorSelectionStage(Environment * environment, const std::string & name = "VectorSelectionStage"); 49 | 50 | 51 | protected: 52 | // Virtual Stage interface 53 | virtual void onProcess() override; 54 | }; 55 | 56 | 57 | } // namespace gloperate 58 | 59 | 60 | #include 61 | -------------------------------------------------------------------------------- /source/gloperate/include/gloperate/stages/base/VectorSelectionStage.inl: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | template 10 | VectorSelectionStage::VectorSelectionStage(Environment * environment, const std::string & name) 11 | : Stage(environment, "VectorSelectionStage", name) 12 | , elements("elements", this) 13 | , index("index", this, 0) 14 | , defaultValue("defaultValue", this, T()) 15 | , element("element", this, defaultValue.value()) 16 | { 17 | } 18 | 19 | 20 | template 21 | void VectorSelectionStage::onProcess() 22 | { 23 | const auto i = index.value(); 24 | 25 | if (elements.value() == nullptr || i < 0 || i >= elements.value()->size()) 26 | { 27 | element.setValue(defaultValue.value()); 28 | 29 | return; 30 | } 31 | 32 | element.setValue(elements.value()->at(i)); 33 | } 34 | 35 | 36 | } // namespace gloperate 37 | -------------------------------------------------------------------------------- /source/gloperate/source/base/AbstractComponent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/source/gloperate/source/base/AbstractComponent.cpp -------------------------------------------------------------------------------- /source/gloperate/source/base/AbstractContext.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | AbstractContext::AbstractContext() 10 | { 11 | } 12 | 13 | AbstractContext::~AbstractContext() 14 | { 15 | } 16 | 17 | 18 | } // namespace gloperate 19 | -------------------------------------------------------------------------------- /source/gloperate/source/base/AbstractGLContext.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | 10 | namespace gloperate 11 | { 12 | 13 | 14 | AbstractGLContext::AbstractGLContext() 15 | { 16 | } 17 | 18 | AbstractGLContext::~AbstractGLContext() 19 | { 20 | } 21 | 22 | const GLContextFormat & AbstractGLContext::format() const 23 | { 24 | return m_format; 25 | } 26 | 27 | void AbstractGLContext::initializeBindings(glbinding::GetProcAddress functionPointerResolver) 28 | { 29 | // Initialize globjects and glbinding 30 | globjects::init(functionPointerResolver); 31 | 32 | // Enable debug messages 33 | #ifndef NDEBUG 34 | globjects::DebugMessage::enable(true); 35 | #endif 36 | } 37 | 38 | 39 | } // namespace gloperate 40 | -------------------------------------------------------------------------------- /source/gloperate/source/base/AbstractLoader.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | AbstractLoader::AbstractLoader(Environment * environment) 10 | : m_environment(environment) 11 | { 12 | } 13 | 14 | AbstractLoader::~AbstractLoader() 15 | { 16 | } 17 | 18 | 19 | } // namespace gloperate 20 | -------------------------------------------------------------------------------- /source/gloperate/source/base/AbstractStorer.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | AbstractStorer::AbstractStorer(Environment * environment) 10 | : m_environment(environment) 11 | { 12 | } 13 | 14 | AbstractStorer::~AbstractStorer() 15 | { 16 | } 17 | 18 | 19 | } // namespace gloperate 20 | -------------------------------------------------------------------------------- /source/gloperate/source/base/ExtendedProperties.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | const std::string & VectorPrefix::getPrefix() 10 | { 11 | static const auto prefix = std::string("i"); 12 | 13 | return prefix; 14 | } 15 | 16 | 17 | } // namespace gloperate 18 | -------------------------------------------------------------------------------- /source/gloperate/source/base/Range.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | Range::Range() 10 | : m_minValue(0.0f) 11 | , m_maxValue(0.0f) 12 | { 13 | } 14 | 15 | Range::Range(float minValue, float maxValue) 16 | : m_minValue(minValue) 17 | , m_maxValue(maxValue) 18 | { 19 | } 20 | 21 | float Range::minimumValue() const 22 | { 23 | return m_minValue; 24 | } 25 | 26 | void Range::setMinimumValue(float minValue) 27 | { 28 | m_minValue = minValue; 29 | } 30 | 31 | float Range::maximumValue() const 32 | { 33 | return m_maxValue; 34 | } 35 | 36 | void Range::setMaximumValue(float maxValue) 37 | { 38 | m_maxValue = maxValue; 39 | } 40 | 41 | 42 | } // namespace gloperate 43 | -------------------------------------------------------------------------------- /source/gloperate/source/gloperate.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace 10 | { 11 | 12 | std::string determineDataPath() 13 | { 14 | std::string path = cpplocate::locatePath("data/gloperate", "share/gloperate", reinterpret_cast(&gloperate::dataPath)); 15 | if (path.empty()) path = "./data"; 16 | else path = path + "/data"; 17 | 18 | return path; 19 | } 20 | 21 | std::string determinePluginPath() 22 | { 23 | std::string path = cppfs::FilePath(cpplocate::getLibraryPath(reinterpret_cast(&gloperate::dataPath))).directoryPath(); 24 | path = cppfs::FilePath(path).fullPath(); 25 | 26 | return path; 27 | } 28 | 29 | } // namespace 30 | 31 | 32 | namespace gloperate 33 | { 34 | 35 | 36 | const std::string & dataPath() 37 | { 38 | static const auto path = determineDataPath(); 39 | 40 | return path; 41 | } 42 | 43 | const std::string & pluginPath() 44 | { 45 | static const auto path = determinePluginPath(); 46 | 47 | return path; 48 | } 49 | 50 | 51 | } // namespace gloperate 52 | -------------------------------------------------------------------------------- /source/gloperate/source/input/AbstractDevice.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | AbstractDevice::AbstractDevice(InputManager * inputManager, const std::string & deviceDescriptor) 14 | : m_inputManager(inputManager) 15 | , m_deviceDescriptor(deviceDescriptor) 16 | { 17 | assert(m_inputManager != nullptr); 18 | 19 | m_inputManager->addDevice(this); 20 | } 21 | 22 | AbstractDevice::~AbstractDevice() 23 | { 24 | } 25 | 26 | const std::string & AbstractDevice::deviceDescriptor() const 27 | { 28 | return m_deviceDescriptor; 29 | } 30 | 31 | 32 | } // namespace gloperate 33 | -------------------------------------------------------------------------------- /source/gloperate/source/input/AbstractDeviceProvider.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | AbstractDeviceProvider::AbstractDeviceProvider() 10 | { 11 | } 12 | 13 | AbstractDeviceProvider::~AbstractDeviceProvider() 14 | { 15 | } 16 | 17 | 18 | } // namespace gloperate 19 | -------------------------------------------------------------------------------- /source/gloperate/source/input/AbstractEventConsumer.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | 7 | namespace gloperate 8 | { 9 | 10 | 11 | AbstractEventConsumer::AbstractEventConsumer(InputManager * inputManager) 12 | : m_inputManager(inputManager) 13 | { 14 | m_inputManager->registerConsumer(this); 15 | } 16 | 17 | AbstractEventConsumer::~AbstractEventConsumer() 18 | { 19 | m_inputManager->deregisterConsumer(this); 20 | } 21 | 22 | 23 | } // namespace gloperate 24 | -------------------------------------------------------------------------------- /source/gloperate/source/input/AxisEvent.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | AxisEvent::AxisEvent(InputEvent::Type type, AbstractDevice * dispatchingDevice, glm::mat3 value) 10 | : InputEvent(type, dispatchingDevice) 11 | , m_value(value) 12 | { 13 | assert(type == Type::SpatialAxis); 14 | } 15 | 16 | const glm::mat3 & AxisEvent::value() const 17 | { 18 | return m_value; 19 | } 20 | 21 | std::string AxisEvent::asString() const 22 | { 23 | return std::to_string(static_cast(m_type)); 24 | } 25 | 26 | 27 | } // namespace gloperate 28 | -------------------------------------------------------------------------------- /source/gloperate/source/input/ButtonEvent.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | ButtonEvent::ButtonEvent(Type type, AbstractDevice * dispatchingDevice, int key, int modifier) 10 | : InputEvent(type, dispatchingDevice) 11 | , m_key(key) 12 | , m_modifier(modifier) 13 | { 14 | assert(type == Type::ButtonPress || 15 | type == Type::ButtonRelease); 16 | } 17 | 18 | 19 | int ButtonEvent::key() const 20 | { 21 | return m_key; 22 | } 23 | 24 | 25 | int ButtonEvent::modifier() const 26 | { 27 | return m_modifier; 28 | } 29 | 30 | 31 | std::string ButtonEvent::asString() const 32 | { 33 | return (type() == Type::ButtonPress ? "Press " : "Release ") + std::to_string(m_key) + ":" + std::to_string(m_modifier); 34 | } 35 | 36 | 37 | } // namespace gloperate 38 | -------------------------------------------------------------------------------- /source/gloperate/source/input/InputEvent.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | InputEvent::InputEvent(Type type, AbstractDevice * dispatchingDevice) 14 | : m_type(type) 15 | , m_dispatchingDevice(dispatchingDevice) 16 | { 17 | assert(dispatchingDevice != nullptr); 18 | } 19 | 20 | InputEvent::~InputEvent() 21 | { 22 | } 23 | 24 | InputEvent::Type InputEvent::type() const 25 | { 26 | return m_type; 27 | } 28 | 29 | AbstractDevice * InputEvent::device() const 30 | { 31 | return m_dispatchingDevice; 32 | } 33 | 34 | std::string InputEvent::asString() const 35 | { 36 | return std::to_string(static_cast(m_type)); 37 | } 38 | 39 | 40 | } // namespace gloperate 41 | -------------------------------------------------------------------------------- /source/gloperate/source/input/KeyboardDevice.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | KeyboardDevice::KeyboardDevice(InputManager * inputManager, const std::string & deviceDescriptor) 13 | : AbstractDevice(inputManager, deviceDescriptor) 14 | { 15 | } 16 | 17 | KeyboardDevice::~KeyboardDevice() 18 | { 19 | } 20 | 21 | void KeyboardDevice::keyPress(int key, int modifier) 22 | { 23 | auto inputEvent = cppassist::make_unique( 24 | InputEvent::Type::ButtonPress, 25 | this, 26 | key, 27 | modifier 28 | ); 29 | 30 | m_inputManager->onEvent(std::move(inputEvent)); 31 | } 32 | 33 | void KeyboardDevice::keyRelease(int key, int modifier) 34 | { 35 | auto inputEvent = cppassist::make_unique( 36 | InputEvent::Type::ButtonRelease, 37 | this, 38 | key, 39 | modifier 40 | ); 41 | 42 | m_inputManager->onEvent(std::move(inputEvent)); 43 | } 44 | 45 | void KeyboardDevice::update() 46 | { 47 | } 48 | 49 | 50 | } // namespace gloperate 51 | -------------------------------------------------------------------------------- /source/gloperate/source/input/MouseEvent.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | MouseEvent::MouseEvent(Type type, AbstractDevice * dispatchingDevice, const glm::ivec2 & pos, int button, int modifiers) 10 | : InputEvent(type, dispatchingDevice) 11 | , m_pos(pos) 12 | , m_button(button) 13 | , m_modifiers(modifiers) 14 | , m_wheelDelta(glm::vec2(.0f, .0f)) 15 | { 16 | assert(type == Type::MouseMove || 17 | type == Type::MouseButtonPress || 18 | type == Type::MouseButtonRelease); 19 | } 20 | 21 | MouseEvent::MouseEvent(InputEvent::Type type, AbstractDevice * dispatchingDevice, const glm::ivec2 & pos, const glm::vec2 & wheelDelta, int modifiers) 22 | : InputEvent(type, dispatchingDevice) 23 | , m_pos(pos) 24 | , m_button(0) 25 | , m_modifiers(modifiers) 26 | , m_wheelDelta(wheelDelta) 27 | { 28 | assert(type == Type::MouseWheelScroll); 29 | } 30 | 31 | const glm::ivec2 & MouseEvent::pos() const 32 | { 33 | return m_pos; 34 | } 35 | 36 | int MouseEvent::button() const 37 | { 38 | return m_button; 39 | } 40 | 41 | int MouseEvent::modifiers() const 42 | { 43 | return m_modifiers; 44 | } 45 | 46 | const glm::vec2 & MouseEvent::wheelDelta() const 47 | { 48 | return m_wheelDelta; 49 | } 50 | 51 | std::string MouseEvent::asString() const 52 | { 53 | return std::to_string(static_cast(m_type)); 54 | } 55 | 56 | 57 | } // namespace gloperate 58 | -------------------------------------------------------------------------------- /source/gloperate/source/input/PrintLineConsumer.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | PrintLineConsumer::PrintLineConsumer(InputManager * inputManager) 14 | : AbstractEventConsumer(inputManager) 15 | { 16 | } 17 | 18 | PrintLineConsumer::~PrintLineConsumer() 19 | { 20 | } 21 | 22 | void PrintLineConsumer::onEvent(gloperate::InputEvent * event) 23 | { 24 | cppassist::info() << event->asString(); 25 | } 26 | 27 | 28 | } // namespace gloperate 29 | -------------------------------------------------------------------------------- /source/gloperate/source/rendering/AbstractDrawable.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | AbstractDrawable::AbstractDrawable() 10 | { 11 | } 12 | 13 | AbstractDrawable::~AbstractDrawable() 14 | { 15 | } 16 | 17 | 18 | } // namespace gloperate 19 | -------------------------------------------------------------------------------- /source/gloperate/source/rendering/CameraUtils.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | CameraUtils::CameraUtils() 13 | { 14 | } 15 | 16 | glm::mat4 CameraUtils::orthographicFromPerspective(float fovy, float aspectRatio, float zNear, float zFar, float syncDist) 17 | { 18 | //compute ortho params from fovy and aspect assuming symmetry 19 | const auto right = zNear*glm::tan(fovy/2.f); 20 | const auto top = right / aspectRatio; 21 | const auto left = -right; 22 | const auto bottom = -top; 23 | 24 | const auto c = syncDist / zNear; 25 | 26 | return glm::ortho(c*left, c*right, c*bottom, c*top, zNear, zFar); 27 | } 28 | 29 | glm::mat4 CameraUtils::perspectiveFromOrthographic(float /*left*/, float right, float /*bottom*/, float top, float zNear, float zFar, float syncDist) 30 | { 31 | const auto c = zNear / syncDist; 32 | 33 | const auto r = c*right; 34 | const auto t = c*top; 35 | 36 | const auto fovy = glm::atan(r / zNear) * 2.f; //assuming right = -left and bottom = -top 37 | const auto aspectRatio = (2.f * r) / (2.f * t); 38 | 39 | return glm::perspective(fovy, aspectRatio, zNear, zFar); 40 | } 41 | 42 | 43 | } // namespace gloperate 44 | -------------------------------------------------------------------------------- /source/gloperate/source/rendering/ColorRenderTarget.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | 10 | namespace gloperate 11 | { 12 | 13 | 14 | AttachmentType ColorRenderTarget::underlyingAttachmentType() const 15 | { 16 | return AttachmentType::Color; 17 | } 18 | 19 | gl::GLenum ColorRenderTarget::attachmentGLType() const 20 | { 21 | return gl::GL_COLOR; 22 | } 23 | 24 | gl::GLint ColorRenderTarget::clearBufferDrawBuffer(size_t index) const 25 | { 26 | return attachmentRequiresUserDefinedFramebuffer() ? index : 0; 27 | } 28 | 29 | gl::GLenum ColorRenderTarget::drawBufferAttachment(size_t index) const 30 | { 31 | return attachmentRequiresUserDefinedFramebuffer() 32 | ? gl::GL_COLOR_ATTACHMENT0 + index 33 | : m_defaultFBOAttachment; 34 | } 35 | 36 | 37 | } // namespace gloperate 38 | -------------------------------------------------------------------------------- /source/gloperate/source/rendering/DepthRenderTarget.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | AttachmentType DepthRenderTarget::underlyingAttachmentType() const 14 | { 15 | return AttachmentType::Depth; 16 | } 17 | 18 | gl::GLenum DepthRenderTarget::attachmentGLType() const 19 | { 20 | return gl::GL_DEPTH; 21 | } 22 | 23 | gl::GLint DepthRenderTarget::clearBufferDrawBuffer(size_t /*index*/) const 24 | { 25 | return 0; 26 | } 27 | 28 | gl::GLenum DepthRenderTarget::drawBufferAttachment(size_t /*index*/) const 29 | { 30 | return gl::GL_NONE; 31 | } 32 | 33 | 34 | } // namespace gloperate 35 | -------------------------------------------------------------------------------- /source/gloperate/source/rendering/DepthStencilRenderTarget.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | AttachmentType DepthStencilRenderTarget::underlyingAttachmentType() const 14 | { 15 | return AttachmentType::DepthStencil; 16 | } 17 | 18 | gl::GLenum DepthStencilRenderTarget::attachmentGLType() const 19 | { 20 | return gl::GL_DEPTH_STENCIL; 21 | } 22 | 23 | gl::GLint DepthStencilRenderTarget::clearBufferDrawBuffer(size_t /*index*/) const 24 | { 25 | return 0; 26 | } 27 | 28 | gl::GLenum DepthStencilRenderTarget::drawBufferAttachment(size_t /*index*/) const 29 | { 30 | return gl::GL_NONE; 31 | } 32 | 33 | 34 | } // namespace gloperate 35 | -------------------------------------------------------------------------------- /source/gloperate/source/rendering/Shape.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | Shape::Shape(ShapeType shapeType, cppassist::Flags options) 10 | : m_type(shapeType) 11 | , m_options(options) 12 | { 13 | } 14 | 15 | Shape::~Shape() 16 | { 17 | } 18 | 19 | ShapeType Shape::type() const 20 | { 21 | return m_type; 22 | } 23 | 24 | cppassist::Flags Shape::options() const 25 | { 26 | return m_options; 27 | } 28 | 29 | void Shape::draw() const 30 | { 31 | } 32 | 33 | Shape::Shape(cppassist::Flags options) 34 | : Shape(ShapeType::None, options) 35 | { 36 | } 37 | 38 | 39 | } // namespace gloperate 40 | -------------------------------------------------------------------------------- /source/gloperate/source/rendering/StencilRenderTarget.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | AttachmentType StencilRenderTarget::underlyingAttachmentType() const 14 | { 15 | return AttachmentType::Stencil; 16 | } 17 | 18 | gl::GLenum StencilRenderTarget::attachmentGLType() const 19 | { 20 | return gl::GL_STENCIL; 21 | } 22 | 23 | gl::GLint StencilRenderTarget::clearBufferDrawBuffer(size_t /*index*/) const 24 | { 25 | return 0; 26 | } 27 | 28 | gl::GLenum StencilRenderTarget::drawBufferAttachment(size_t /*index*/) const 29 | { 30 | return gl::GL_NONE; 31 | } 32 | 33 | 34 | } // namespace gloperate 35 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/base/ColorGradientSelectionStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | CPPEXPOSE_COMPONENT(ColorGradientSelectionStage, gloperate::Stage) 14 | 15 | 16 | ColorGradientSelectionStage::ColorGradientSelectionStage(gloperate::Environment * environment, const std::string & name) 17 | : Stage(environment, "ColorGradientSelectionStage", name) 18 | , gradients("gradients", this) 19 | , name("name", this) 20 | , gradient("gradient", this) 21 | , index("index", this) 22 | { 23 | } 24 | 25 | ColorGradientSelectionStage::~ColorGradientSelectionStage() 26 | { 27 | } 28 | 29 | void ColorGradientSelectionStage::onProcess() 30 | { 31 | // Update outputs 32 | index.setValue(gradients->indexOf(*name)); 33 | gradient.setValue(gradients->at(*name)); 34 | } 35 | 36 | 37 | } // namespace gloperate 38 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/base/ColorGradientStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | CPPEXPOSE_COMPONENT(ColorGradientStage, gloperate::Stage) 14 | 15 | 16 | ColorGradientStage::ColorGradientStage(Environment * environment, const std::string & name) 17 | : Stage(environment, "ColorGradientStage", name) 18 | , filePath("filePath", this) 19 | , gradients("gradients", this) 20 | , size("size", this, 0) 21 | { 22 | } 23 | 24 | ColorGradientStage::~ColorGradientStage() 25 | { 26 | } 27 | 28 | void ColorGradientStage::onProcess() 29 | { 30 | // Load color gradient list 31 | m_colorGradientList = std::unique_ptr(environment()->resourceManager()->load((*filePath).path())); 32 | 33 | // Update outputs 34 | gradients.setValue(m_colorGradientList.get()); 35 | size.setValue(m_colorGradientList->size()); 36 | } 37 | 38 | 39 | } // namespace gloperate 40 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/base/ColorGradientTextureStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | CPPEXPOSE_COMPONENT(ColorGradientTextureStage, gloperate::Stage) 14 | 15 | 16 | ColorGradientTextureStage::ColorGradientTextureStage(gloperate::Environment * environment, const std::string & name) 17 | : Stage(environment, "ColorGradientTextureStage", name) 18 | , gradients("gradients", this) 19 | , textureWidth("textureWidth", this, 128) 20 | , texture("texture", this) 21 | { 22 | } 23 | 24 | ColorGradientTextureStage::~ColorGradientTextureStage() 25 | { 26 | } 27 | 28 | void ColorGradientTextureStage::onContextInit(AbstractGLContext *) 29 | { 30 | texture.invalidate(); 31 | } 32 | 33 | void ColorGradientTextureStage::onContextDeinit(AbstractGLContext *) 34 | { 35 | // Clean up OpenGL objects 36 | m_gradientTexture = nullptr; 37 | 38 | texture.setValue(nullptr); 39 | } 40 | 41 | void ColorGradientTextureStage::onProcess() 42 | { 43 | std::vector gradientLists; 44 | 45 | for (auto input : inputs()) 46 | { 47 | if (input->type() == typeid(ColorGradientList *)) 48 | { 49 | gradientLists.push_back(static_cast *>(input)->value()); 50 | } 51 | } 52 | 53 | m_gradientTexture = ColorGradientList::generateTexture(gradientLists, *textureWidth); 54 | 55 | // Update output 56 | this->texture.setValue(m_gradientTexture.get()); 57 | } 58 | 59 | 60 | } // namespace gloperate 61 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/base/CubeMapProjectionsStage.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | 6 | namespace 7 | { 8 | 9 | const glm::vec3 viewDirs[] = { glm::vec3(1, 0, 0), glm::vec3(-1, 0, 0), glm::vec3(0, 1, 0), glm::vec3(0, -1, 0), glm::vec3(0, 0, 1), glm::vec3(0, 0, -1) }; 10 | const glm::vec3 ups[] = { glm::vec3(0, -1, 0), glm::vec3(0, -1, 0), glm::vec3(0, 0, 1), glm::vec3(0, 0, -1), glm::vec3(0, -1, 0), glm::vec3(0, -1, 0) }; 11 | 12 | } // namespace 13 | 14 | 15 | namespace gloperate 16 | { 17 | 18 | CubeMapProjectionsStage::CubeMapProjectionsStage(gloperate::Environment * environment, const std::string & name) 19 | : Stage(environment, name) 20 | , center("center", this, glm::vec3(0.0f, 0.0f, 0.0f)) 21 | , nearPlane("nearPlane", this, 0.1f) 22 | , farPlane("farPlane", this, 4.0f) 23 | , projections("projections", this) 24 | , projectionsDirect("projectionsDirect", this) 25 | { 26 | m_projections.resize(6); 27 | } 28 | 29 | void CubeMapProjectionsStage::onProcess() 30 | { 31 | const auto c = *center; 32 | const auto projection = glm::perspective(glm::radians(90.0f), 1.0f, *nearPlane, *farPlane); 33 | 34 | for (int i = 0; i < 6; ++i) 35 | { 36 | m_projections.at(i) = projection * glm::lookAt(c, c + viewDirs[i], ups[i]); 37 | } 38 | 39 | projections.setValue(&m_projections); 40 | projectionsDirect.setValue(m_projections); 41 | } 42 | 43 | } // namespace gloperate 44 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/base/FloatSelectionStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | 7 | namespace gloperate 8 | { 9 | 10 | 11 | CPPEXPOSE_COMPONENT(FloatSelectionStage, gloperate::Stage) 12 | 13 | 14 | FloatSelectionStage::FloatSelectionStage(gloperate::Environment * environment, const std::string & name) 15 | : Stage(environment, "FloatSelectionStage", name) 16 | , index("index", this, 0) 17 | , value("value", this, 0.0f) 18 | { 19 | inputAdded.connect([this](AbstractSlot * slot) { 20 | auto floatInput = dynamic_cast *>(slot); 21 | 22 | if (floatInput) 23 | { 24 | m_floatInputs.push_back(floatInput); 25 | } 26 | }); 27 | 28 | inputRemoved.connect([this](AbstractSlot * slot) { 29 | const auto it = std::find(m_floatInputs.begin(), m_floatInputs.end(), static_cast *>(slot)); 30 | 31 | if (it == m_floatInputs.end()) 32 | { 33 | return; 34 | } 35 | 36 | m_floatInputs.erase(it); 37 | }); 38 | } 39 | 40 | FloatSelectionStage::~FloatSelectionStage() 41 | { 42 | } 43 | 44 | void FloatSelectionStage::onProcess() 45 | { 46 | if (m_floatInputs.size() <= *index) 47 | { 48 | value.setValue(0.0f); 49 | 50 | return; 51 | } 52 | 53 | value.setValue(**m_floatInputs.at(*index)); 54 | } 55 | 56 | 57 | } // namespace gloperate 58 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/base/ShaderStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | 12 | namespace gloperate 13 | { 14 | 15 | 16 | CPPEXPOSE_COMPONENT(ShaderStage, gloperate::Stage) 17 | 18 | 19 | ShaderStage::ShaderStage(Environment * environment, const std::string & name) 20 | : Stage(environment, "ShaderStage", name) 21 | , filePath("filePath", this) 22 | , shader("shader", this) 23 | { 24 | } 25 | 26 | ShaderStage::~ShaderStage() 27 | { 28 | } 29 | 30 | void ShaderStage::onContextInit(AbstractGLContext *) 31 | { 32 | shader.invalidate(); 33 | } 34 | 35 | void ShaderStage::onContextDeinit(AbstractGLContext *) 36 | { 37 | // Clean up OpenGL objects 38 | m_shader = nullptr; 39 | 40 | shader.setValue(nullptr); 41 | } 42 | 43 | void ShaderStage::onProcess() 44 | { 45 | cppassist::warning("gloperate") << "Load shader " << (*filePath).path(); 46 | 47 | // Load shader 48 | m_shader = std::unique_ptr(environment()->resourceManager()->load((*filePath).path())); 49 | 50 | // Update outputs 51 | shader.setValue(m_shader.get()); 52 | } 53 | 54 | 55 | } // namespace gloperate 56 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/base/TextureLoadStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gloperate 10 | { 11 | 12 | 13 | CPPEXPOSE_COMPONENT(TextureLoadStage, gloperate::Stage) 14 | 15 | 16 | TextureLoadStage::TextureLoadStage(Environment * environment, const std::string & name) 17 | : Stage(environment, "TextureLoadStage", name) 18 | , filename("filename", this) 19 | , texture ("texture", this) 20 | { 21 | } 22 | 23 | TextureLoadStage::~TextureLoadStage() 24 | { 25 | } 26 | 27 | void TextureLoadStage::onContextInit(AbstractGLContext *) 28 | { 29 | texture.invalidate(); 30 | } 31 | 32 | void TextureLoadStage::onContextDeinit(AbstractGLContext *) 33 | { 34 | // Clean up OpenGL objects 35 | m_texture = nullptr; 36 | 37 | texture.setValue(nullptr); 38 | } 39 | 40 | void TextureLoadStage::onProcess() 41 | { 42 | // Load texture 43 | auto tex = m_environment->resourceManager()->load((*filename).path()); 44 | m_texture = tex ? std::unique_ptr(tex) : globjects::Texture::createDefault(gl::GL_TEXTURE_2D); 45 | 46 | // Update outputs 47 | texture.setValue(m_texture.get()); 48 | } 49 | 50 | 51 | } // namespace gloperate 52 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/base/TimerStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | 7 | namespace gloperate 8 | { 9 | 10 | 11 | CPPEXPOSE_COMPONENT(TimerStage, gloperate::Stage) 12 | 13 | 14 | TimerStage::TimerStage(gloperate::Environment * environment, const std::string & name) 15 | : Stage(environment, "TimerStage", name) 16 | , timeDelta ("timeDelta", this, 0.0f) 17 | , factor ("factor", this, 1.0f) 18 | , interval ("interval", this, 0.0f) 19 | , virtualTime("virtualTime", this, 0.0f) 20 | , m_time(0.0f) 21 | { 22 | } 23 | 24 | TimerStage::~TimerStage() 25 | { 26 | } 27 | 28 | void TimerStage::onProcess() 29 | { 30 | m_time += (*timeDelta) * (*factor); 31 | 32 | if (*interval > 0.0f && m_time >= *interval) 33 | { 34 | m_time = 0.0f; 35 | } 36 | 37 | virtualTime.setValue(m_time); 38 | } 39 | 40 | 41 | } // namespace gloperate 42 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/base/TransformStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | 8 | namespace gloperate 9 | { 10 | 11 | 12 | CPPEXPOSE_COMPONENT(TransformStage, gloperate::Stage) 13 | 14 | 15 | TransformStage::TransformStage(gloperate::Environment * environment, const std::string & name) 16 | : Stage(environment, "TransformStage", name) 17 | , rotationAxis("rotationAxis", this, glm::vec3(0.0f, 1.0f, 0.0f)) 18 | , rotationAngle("rotationAngle", this, 0.0f) 19 | , translation("translation", this, glm::vec3(0.0f, 0.0f, 0.0f)) 20 | , scale("scale", this, glm::vec3(1.0f, 1.0f, 1.0f)) 21 | , modelMatrix("modelMatrix", this) 22 | { 23 | } 24 | 25 | TransformStage::~TransformStage() 26 | { 27 | } 28 | 29 | void TransformStage::onProcess() 30 | { 31 | // Calculate model matrix 32 | m_modelMatrix = glm::mat4(1.0); 33 | m_modelMatrix = glm::translate(m_modelMatrix, *translation); 34 | m_modelMatrix = glm::scale(m_modelMatrix, *scale); 35 | m_modelMatrix = glm::rotate(m_modelMatrix, *rotationAngle, *rotationAxis); 36 | 37 | // Update output matrix 38 | modelMatrix.setValue(m_modelMatrix); 39 | } 40 | 41 | 42 | } // namespace gloperate 43 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/base/ViewportScaleStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | 6 | 7 | namespace gloperate 8 | { 9 | 10 | 11 | CPPEXPOSE_COMPONENT(ViewportScaleStage, gloperate::Stage) 12 | 13 | 14 | ViewportScaleStage::ViewportScaleStage(Environment * environment, const std::string & name) 15 | : Stage(environment, "ViewportScaleStage", name) 16 | , viewport ("viewport", this) 17 | , scaleFactor ("scaleFactor", this) 18 | , scaledViewport("scaledViewport", this) 19 | { 20 | } 21 | 22 | ViewportScaleStage::~ViewportScaleStage() 23 | { 24 | } 25 | 26 | void ViewportScaleStage::onProcess() 27 | { 28 | 29 | const auto & viewport = this->viewport.value(); 30 | const auto scaleFactor = this->scaleFactor.value(); 31 | 32 | this->scaledViewport.setValue(glm::vec4( 33 | viewport.x, 34 | viewport.y, 35 | glm::max(scaleFactor * viewport.z, 1.0f), 36 | glm::max(scaleFactor * viewport.w, 1.0f) 37 | )); 38 | } 39 | 40 | 41 | } // namespace gloperate 42 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/interfaces/CanvasInterface.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | CanvasInterface::CanvasInterface(Stage * stage) 10 | : RenderInterface(stage) 11 | , backgroundColor("backgroundColor", stage, Color(0, 0, 0, 255)) 12 | , frameCounter ("frameCounter", stage) 13 | , timeDelta ("timeDelta", stage) 14 | { 15 | // Hide inputs in property editor 16 | backgroundColor.setOption("hidden", true); 17 | frameCounter .setOption("hidden", true); 18 | timeDelta .setOption("hidden", true); 19 | } 20 | 21 | CanvasInterface::~CanvasInterface() 22 | { 23 | } 24 | 25 | 26 | } // namespace gloperate 27 | -------------------------------------------------------------------------------- /source/gloperate/source/stages/lights/LightCreationStage.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | CPPEXPOSE_COMPONENT(LightCreationStage, gloperate::Stage) 10 | 11 | 12 | LightCreationStage::LightCreationStage(Environment * environment, const std::string & name) 13 | : Stage(environment, "LightCreationStage", name) 14 | , type("type", this) 15 | , color("color", this) 16 | , position("position", this) 17 | , attenuationCoefficients("attenuationCoefficients", this) 18 | , light("light", this) 19 | { 20 | } 21 | 22 | LightCreationStage::~LightCreationStage() 23 | { 24 | } 25 | 26 | void LightCreationStage::onProcess() 27 | { 28 | light.setValue(Light{LightType(*type), *color, *position, *attenuationCoefficients}); 29 | } 30 | 31 | 32 | } // namespace gloperate 33 | -------------------------------------------------------------------------------- /source/gloperate/source/tools/AbstractVideoExporter.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | namespace gloperate 6 | { 7 | 8 | 9 | AbstractVideoExporter::AbstractVideoExporter() 10 | { 11 | } 12 | 13 | AbstractVideoExporter::~AbstractVideoExporter() 14 | { 15 | } 16 | 17 | int AbstractVideoExporter::progress() const 18 | { 19 | return 0; 20 | } 21 | 22 | 23 | } // namespace gloperate 24 | -------------------------------------------------------------------------------- /source/plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Exporters 3 | add_subdirectory(gloperate-ffmpeg-exporter) 4 | -------------------------------------------------------------------------------- /source/tests/googletest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6.2) 2 | 3 | project( googletest-distribution ) 4 | 5 | enable_testing() 6 | 7 | option(BUILD_GTEST "Builds the googletest subproject" OFF) 8 | 9 | #Note that googlemock target already builds googletest 10 | option(BUILD_GMOCK "Builds the googlemock subproject" ON) 11 | 12 | if(BUILD_GMOCK) 13 | add_subdirectory( googlemock ) 14 | elseif(BUILD_GTEST) 15 | add_subdirectory( googletest ) 16 | endif() 17 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Mocking Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Benoit Sigoure 7 | Bogdan Piloca 8 | Chandler Carruth 9 | Dave MacLachlan 10 | David Anderson 11 | Dean Sturtevant 12 | Gene Volovich 13 | Hal Burch 14 | Jeffrey Yasskin 15 | Jim Keller 16 | Joe Walnes 17 | Jon Wray 18 | Keir Mierle 19 | Keith Ray 20 | Kostya Serebryany 21 | Lev Makhlis 22 | Manuel Klimek 23 | Mario Tanev 24 | Mark Paskin 25 | Markus Heule 26 | Matthew Simmons 27 | Mike Bland 28 | Neal Norwitz 29 | Nermin Ozkiranartli 30 | Owen Carlsen 31 | Paneendra Ba 32 | Paul Menage 33 | Piotr Kaminski 34 | Russ Rufer 35 | Sverre Sundsdal 36 | Takeshi Yoshino 37 | Vadim Berman 38 | Vlad Losev 39 | Wolfgang Klier 40 | Zhanyong Wan 41 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/docs/Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Mock **(the SVN trunk version)** 2 | - **if you use a released version of Google Mock, please read the documentation for that specific version instead.** 3 | 4 | * [ForDummies](ForDummies.md) -- start here if you are new to Google Mock. 5 | * [CheatSheet](CheatSheet.md) -- a quick reference. 6 | * [CookBook](CookBook.md) -- recipes for doing various tasks using Google Mock. 7 | * [FrequentlyAskedQuestions](FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list. 8 | 9 | To contribute code to Google Mock, read: 10 | 11 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 12 | * [Pump Manual](http://code.google.com/p/googletest/wiki/PumpManual) -- how we generate some of Google Mock's source files. -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/docs/KnownIssues.md: -------------------------------------------------------------------------------- 1 | As any non-trivial software system, Google Mock has some known limitations and problems. We are working on improving it, and welcome your help! The follow is a list of issues we know about. 2 | 3 | 4 | 5 | ## README contains outdated information on Google Mock's compatibility with other testing frameworks ## 6 | 7 | The `README` file in release 1.1.0 still says that Google Mock only works with Google Test. Actually, you can configure Google Mock to work with any testing framework you choose. 8 | 9 | ## Tests failing on machines using Power PC CPUs (e.g. some Macs) ## 10 | 11 | `gmock_output_test` and `gmock-printers_test` are known to fail with Power PC CPUs. This is due to portability issues with these tests, and is not an indication of problems in Google Mock itself. You can safely ignore them. 12 | 13 | ## Failed to resolve libgtest.so.0 in tests when built against installed Google Test ## 14 | 15 | This only applies if you manually built and installed Google Test, and then built a Google Mock against it (either explicitly, or because gtest-config was in your path post-install). In this situation, Libtool has a known issue with certain systems' ldconfig setup: 16 | 17 | http://article.gmane.org/gmane.comp.sysutils.automake.general/9025 18 | 19 | This requires a manual run of "sudo ldconfig" after the "sudo make install" for Google Test before any binaries which link against it can be executed. This isn't a bug in our install, but we should at least have documented it or hacked a work-around into our install. We should have one of these solutions in our next release. -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/docs/v1_5/Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Mock **version 1.5.0** -- **if you use a different version of Google Mock, please read the documentation for that specific version instead.** 2 | 3 | * [ForDummies](V1_5_ForDummies.md) -- start here if you are new to Google Mock. 4 | * [CheatSheet](V1_5_CheatSheet.md) -- a quick reference. 5 | * [CookBook](V1_5_CookBook.md) -- recipes for doing various tasks using Google Mock. 6 | * [FrequentlyAskedQuestions](V1_5_FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list. 7 | 8 | To contribute code to Google Mock, read: 9 | 10 | * DevGuide -- read this _before_ writing your first patch. 11 | * [Pump Manual](http://code.google.com/p/googletest/wiki/PumpManual) -- how we generate some of Google Mock's source files. -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/docs/v1_6/Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Mock **1.6** 2 | - **if you use a released version of Google Mock, please read the documentation for that specific version instead.** 3 | 4 | * [ForDummies](V1_6_ForDummies.md) -- start here if you are new to Google Mock. 5 | * [CheatSheet](V1_6_CheatSheet.md) -- a quick reference. 6 | * [CookBook](V1_6_CookBook.md) -- recipes for doing various tasks using Google Mock. 7 | * [FrequentlyAskedQuestions](V1_6_FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list. 8 | 9 | To contribute code to Google Mock, read: 10 | 11 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 12 | * [Pump Manual](http://code.google.com/p/googletest/wiki/V1_6_PumpManual) -- how we generate some of Google Mock's source files. -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/docs/v1_7/Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Mock **(the SVN trunk version)** 2 | - **if you use a released version of Google Mock, please read the documentation for that specific version instead.** 3 | 4 | * [ForDummies](V1_7_ForDummies.md) -- start here if you are new to Google Mock. 5 | * [CheatSheet](V1_7_CheatSheet.md) -- a quick reference. 6 | * [CookBook](V1_7_CookBook.md) -- recipes for doing various tasks using Google Mock. 7 | * [FrequentlyAskedQuestions](V1_7_FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list. 8 | 9 | To contribute code to Google Mock, read: 10 | 11 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 12 | * [Pump Manual](http://code.google.com/p/googletest/wiki/PumpManual) -- how we generate some of Google Mock's source files. -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h: -------------------------------------------------------------------------------- 1 | // This file was GENERATED by command: 2 | // pump.py gmock-generated-actions.h.pump 3 | // DO NOT EDIT BY HAND!!! 4 | 5 | #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 6 | #define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 7 | 8 | #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 9 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump: -------------------------------------------------------------------------------- 1 | $$ -*- mode: c++; -*- 2 | $$ This is a Pump source file (http://go/pump). Please use Pump to convert 3 | $$ it to callback-actions.h. 4 | $$ 5 | $var max_callback_arity = 5 6 | $$}} This meta comment fixes auto-indentation in editors. 7 | #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 8 | #define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 9 | 10 | #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 11 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/msvc/2005/gmock_config.vsprops: -------------------------------------------------------------------------------- 1 | 2 | 7 | 11 | 15 | 16 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/msvc/2010/gmock_config.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ../../gtest 5 | 6 | 7 | <_ProjectFileVersion>10.0.30319.1 8 | 9 | 10 | 11 | $(GTestDir)/include;%(AdditionalIncludeDirectories) 12 | 13 | 14 | 15 | 16 | $(GTestDir) 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/scripts/generator/README: -------------------------------------------------------------------------------- 1 | 2 | The Google Mock class generator is an application that is part of cppclean. 3 | For more information about cppclean, see the README.cppclean file or 4 | visit http://code.google.com/p/cppclean/ 5 | 6 | cppclean requires Python 2.3.5 or later. If you don't have Python installed 7 | on your system, you will also need to install it. You can download Python 8 | from: http://www.python.org/download/releases/ 9 | 10 | To use the Google Mock class generator, you need to call it 11 | on the command line passing the header file and class for which you want 12 | to generate a Google Mock class. 13 | 14 | Make sure to install the scripts somewhere in your path. Then you can 15 | run the program. 16 | 17 | gmock_gen.py header-file.h [ClassName]... 18 | 19 | If no ClassNames are specified, all classes in the file are emitted. 20 | 21 | To change the indentation from the default of 2, set INDENT in 22 | the environment. For example to use an indent of 4 spaces: 23 | 24 | INDENT=4 gmock_gen.py header-file.h ClassName 25 | 26 | This version was made from SVN revision 281 in the cppclean repository. 27 | 28 | Known Limitations 29 | ----------------- 30 | Not all code will be generated properly. For example, when mocking templated 31 | classes, the template information is lost. You will need to add the template 32 | information manually. 33 | 34 | Not all permutations of using multiple pointers/references will be rendered 35 | properly. These will also have to be fixed manually. 36 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/scripts/generator/cpp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cginternals/gloperate/376f5f37c81fabcb39b704bf3d7e42880ac19837/source/tests/googletest/googlemock/scripts/generator/cpp/__init__.py -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/scripts/generator/cpp/utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2007 Neal Norwitz 4 | # Portions Copyright 2007 Google Inc. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | """Generic utilities for C++ parsing.""" 19 | 20 | __author__ = 'nnorwitz@google.com (Neal Norwitz)' 21 | 22 | 23 | import sys 24 | 25 | 26 | # Set to True to see the start/end token indices. 27 | DEBUG = True 28 | 29 | 30 | def ReadFile(filename, print_error=True): 31 | """Returns the contents of a file.""" 32 | try: 33 | fp = open(filename) 34 | try: 35 | return fp.read() 36 | finally: 37 | fp.close() 38 | except IOError: 39 | if print_error: 40 | print('Error reading %s: %s' % (filename, sys.exc_info()[1])) 41 | return None 42 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/scripts/generator/gmock_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2008 Google Inc. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | """Driver for starting up Google Mock class generator.""" 18 | 19 | __author__ = 'nnorwitz@google.com (Neal Norwitz)' 20 | 21 | import os 22 | import sys 23 | 24 | if __name__ == '__main__': 25 | # Add the directory of this script to the path so we can import gmock_class. 26 | sys.path.append(os.path.dirname(__file__)) 27 | 28 | from cpp import gmock_class 29 | # Fix the docstring in case they require the usage. 30 | gmock_class.__doc__ = gmock_class.__doc__.replace('gmock_class.py', __file__) 31 | gmock_class.main() 32 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Testing Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Ajay Joshi 7 | Balázs Dán 8 | Bharat Mediratta 9 | Chandler Carruth 10 | Chris Prince 11 | Chris Taylor 12 | Dan Egnor 13 | Eric Roman 14 | Hady Zalek 15 | Jeffrey Yasskin 16 | Jói Sigurðsson 17 | Keir Mierle 18 | Keith Ray 19 | Kenton Varda 20 | Manuel Klimek 21 | Markus Heule 22 | Mika Raento 23 | Miklós Fazekas 24 | Pasi Valminen 25 | Patrick Hanna 26 | Patrick Riley 27 | Peter Kaminski 28 | Preston Jackson 29 | Rainer Klaffenboeck 30 | Russ Cox 31 | Russ Rufer 32 | Sean Mcafee 33 | Sigurður Ásgeirsson 34 | Tracy Bialik 35 | Vadim Berman 36 | Vlad Losev 37 | Zhanyong Wan 38 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/docs/Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Test **(the SVN trunk version)** 2 | -- **if you use a released version of Google Test, please read the 3 | documentation for that specific version instead.** 4 | 5 | * [Primer](Primer.md) -- start here if you are new to Google Test. 6 | * [Samples](Samples.md) -- learn from examples. 7 | * [AdvancedGuide](AdvancedGuide.md) -- learn more about Google Test. 8 | * [XcodeGuide](XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 9 | * [Frequently-Asked Questions](FAQ.md) -- check here before asking a question on the mailing list. 10 | 11 | To contribute code to Google Test, read: 12 | 13 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 14 | * [PumpManual](PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /source/tests/googletest/googletest/docs/Samples.md: -------------------------------------------------------------------------------- 1 | If you're like us, you'd like to look at some Google Test sample code. The 2 | [samples folder](../samples) has a number of well-commented samples showing how to use a 3 | variety of Google Test features. 4 | 5 | * [Sample #1](../samples/sample1_unittest.cc) shows the basic steps of using Google Test to test C++ functions. 6 | * [Sample #2](../samples/sample2_unittest.cc) shows a more complex unit test for a class with multiple member functions. 7 | * [Sample #3](../samples/sample3_unittest.cc) uses a test fixture. 8 | * [Sample #4](../samples/sample4_unittest.cc) is another basic example of using Google Test. 9 | * [Sample #5](../samples/sample5_unittest.cc) teaches how to reuse a test fixture in multiple test cases by deriving sub-fixtures from it. 10 | * [Sample #6](../samples/sample6_unittest.cc) demonstrates type-parameterized tests. 11 | * [Sample #7](../samples/sample7_unittest.cc) teaches the basics of value-parameterized tests. 12 | * [Sample #8](../samples/sample8_unittest.cc) shows using `Combine()` in value-parameterized tests. 13 | * [Sample #9](../samples/sample9_unittest.cc) shows use of the listener API to modify Google Test's console output and the use of its reflection API to inspect test results. 14 | * [Sample #10](../samples/sample10_unittest.cc) shows use of the listener API to implement a primitive memory leak checker. 15 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/docs/V1_5_Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all official documentation wiki pages for Google Test **1.5.0** -- **if you use a different version of Google Test, make sure to read the documentation for that version instead.** 2 | 3 | * [Primer](V1_5_Primer.md) -- start here if you are new to Google Test. 4 | * [Samples](Samples.md) -- learn from examples. 5 | * [AdvancedGuide](V1_5_AdvancedGuide.md) -- learn more about Google Test. 6 | * [XcodeGuide](V1_5_XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 7 | * [Frequently-Asked Questions](V1_5_FAQ.md) -- check here before asking a question on the mailing list. 8 | 9 | To contribute code to Google Test, read: 10 | 11 | * DevGuide -- read this _before_ writing your first patch. 12 | * [PumpManual](V1_5_PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /source/tests/googletest/googletest/docs/V1_6_Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Test **1.6** 2 | -- **if you use a released version of Google Test, please read the 3 | documentation for that specific version instead.** 4 | 5 | * [Primer](V1_6_Primer.md) -- start here if you are new to Google Test. 6 | * [Samples](V1_6_Samples.md) -- learn from examples. 7 | * [AdvancedGuide](V1_6_AdvancedGuide.md) -- learn more about Google Test. 8 | * [XcodeGuide](V1_6_XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 9 | * [Frequently-Asked Questions](V1_6_FAQ.md) -- check here before asking a question on the mailing list. 10 | 11 | To contribute code to Google Test, read: 12 | 13 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 14 | * [PumpManual](V1_6_PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /source/tests/googletest/googletest/docs/V1_7_Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Test **(the SVN trunk version)** 2 | -- **if you use a released version of Google Test, please read the 3 | documentation for that specific version instead.** 4 | 5 | * [Primer](V1_7_Primer.md) -- start here if you are new to Google Test. 6 | * [Samples](V1_7_Samples.md) -- learn from examples. 7 | * [AdvancedGuide](V1_7_AdvancedGuide.md) -- learn more about Google Test. 8 | * [XcodeGuide](V1_7_XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 9 | * [Frequently-Asked Questions](V1_7_FAQ.md) -- check here before asking a question on the mailing list. 10 | 11 | To contribute code to Google Test, read: 12 | 13 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 14 | * [PumpManual](V1_7_PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /source/tests/googletest/googletest/xcode/Config/DebugProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // DebugProject.xcconfig 3 | // 4 | // These are Debug Configuration project settings for the gtest framework and 5 | // examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // No optimization 14 | GCC_OPTIMIZATION_LEVEL = 0 15 | 16 | // Deployment postprocessing is what triggers Xcode to strip, turn it off 17 | DEPLOYMENT_POSTPROCESSING = NO 18 | 19 | // Dead code stripping off 20 | DEAD_CODE_STRIPPING = NO 21 | 22 | // Debug symbols should be on obviously 23 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES 24 | 25 | // Define the DEBUG macro in all debug builds 26 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DDEBUG=1 27 | 28 | // These are turned off to avoid STL incompatibilities with client code 29 | // // Turns on special C++ STL checks to "encourage" good STL use 30 | // GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) _GLIBCXX_DEBUG_PEDANTIC _GLIBCXX_DEBUG _GLIBCPP_CONCEPT_CHECKS 31 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/xcode/Config/FrameworkTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // FrameworkTarget.xcconfig 3 | // 4 | // These are Framework target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Dynamic libs need to be position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Dynamic libs should not have their external symbols stripped. 14 | STRIP_STYLE = non-global 15 | 16 | // Let the user install by specifying the $DSTROOT with xcodebuild 17 | SKIP_INSTALL = NO 18 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/xcode/Config/General.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // General.xcconfig 3 | // 4 | // These are General configuration settings for the gtest framework and 5 | // examples. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Build for PPC and Intel, 32- and 64-bit 11 | ARCHS = i386 x86_64 ppc ppc64 12 | 13 | // Zerolink prevents link warnings so turn it off 14 | ZERO_LINK = NO 15 | 16 | // Prebinding considered unhelpful in 10.3 and later 17 | PREBINDING = NO 18 | 19 | // Strictest warning policy 20 | WARNING_CFLAGS = -Wall -Werror -Wendif-labels -Wnewline-eof -Wno-sign-compare -Wshadow 21 | 22 | // Work around Xcode bugs by using external strip. See: 23 | // http://lists.apple.com/archives/Xcode-users/2006/Feb/msg00050.html 24 | SEPARATE_STRIP = YES 25 | 26 | // Force C99 dialect 27 | GCC_C_LANGUAGE_STANDARD = c99 28 | 29 | // not sure why apple defaults this on, but it's pretty risky 30 | ALWAYS_SEARCH_USER_PATHS = NO 31 | 32 | // Turn on position dependent code for most cases (overridden where appropriate) 33 | GCC_DYNAMIC_NO_PIC = YES 34 | 35 | // Default SDK and minimum OS version is 10.4 36 | SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk 37 | MACOSX_DEPLOYMENT_TARGET = 10.4 38 | GCC_VERSION = 4.0 39 | 40 | // VERSIONING BUILD SETTINGS (used in Info.plist) 41 | GTEST_VERSIONINFO_ABOUT = © 2008 Google Inc. 42 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/xcode/Config/ReleaseProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // ReleaseProject.xcconfig 3 | // 4 | // These are Release Configuration project settings for the gtest framework 5 | // and examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // subconfig/Release.xcconfig 14 | 15 | // Optimize for space and size (Apple recommendation) 16 | GCC_OPTIMIZATION_LEVEL = s 17 | 18 | // Deploment postprocessing is what triggers Xcode to strip 19 | DEPLOYMENT_POSTPROCESSING = YES 20 | 21 | // No symbols 22 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO 23 | 24 | // Dead code strip does not affect ObjC code but can help for C 25 | DEAD_CODE_STRIPPING = YES 26 | 27 | // NDEBUG is used by things like assert.h, so define it for general compat. 28 | // ASSERT going away in release tends to create unused vars. 29 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DNDEBUG=1 -Wno-unused-variable 30 | 31 | // When we strip we want to strip all symbols in release, but save externals. 32 | STRIP_STYLE = all 33 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/xcode/Config/StaticLibraryTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // StaticLibraryTarget.xcconfig 3 | // 4 | // These are static library target settings for libgtest.a. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Static libs can be included in bundles so make them position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Static libs should not have their internal globals or external symbols 14 | // stripped. 15 | STRIP_STYLE = debugging 16 | 17 | // Let the user install by specifying the $DSTROOT with xcodebuild 18 | SKIP_INSTALL = NO 19 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/xcode/Config/TestTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // TestTarget.xcconfig 3 | // 4 | // These are Test target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | 7 | PRODUCT_NAME = $(TARGET_NAME) 8 | HEADER_SEARCH_PATHS = ../include 9 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/xcode/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.${PRODUCT_NAME} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | GTEST_VERSIONINFO_LONG 21 | CFBundleShortVersionString 22 | GTEST_VERSIONINFO_SHORT 23 | CFBundleGetInfoString 24 | ${PRODUCT_NAME} GTEST_VERSIONINFO_LONG, ${GTEST_VERSIONINFO_ABOUT} 25 | NSHumanReadableCopyright 26 | ${GTEST_VERSIONINFO_ABOUT} 27 | CSResourcesFileMapped 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/xcode/Samples/FrameworkSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.gtest.${PRODUCT_NAME:identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /source/tests/googletest/travis.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -evx 3 | env | sort 4 | 5 | mkdir build || true 6 | mkdir build/$GTEST_TARGET || true 7 | cd build/$GTEST_TARGET 8 | cmake -Dgtest_build_samples=ON \ 9 | -Dgmock_build_samples=ON \ 10 | -Dgtest_build_tests=ON \ 11 | -Dgmock_build_tests=ON \ 12 | -DCMAKE_CXX_FLAGS=$CXX_FLAGS \ 13 | ../../$GTEST_TARGET 14 | make 15 | make test 16 | -------------------------------------------------------------------------------- /source/version.h.in: -------------------------------------------------------------------------------- 1 | 2 | #define ${META_PROJECT_ID}_PROJECT_NAME "@META_PROJECT_NAME@" 3 | #define ${META_PROJECT_ID}_PROJECT_DESCRIPTION "@META_PROJECT_DESCRIPTION@" 4 | 5 | #define ${META_PROJECT_ID}_AUTHOR_ORGANIZATION "@META_AUTHOR_ORGANIZATION@" 6 | #define ${META_PROJECT_ID}_AUTHOR_DOMAIN "@META_AUTHOR_DOMAIN@" 7 | #define ${META_PROJECT_ID}_AUTHOR_MAINTAINER "@META_AUTHOR_MAINTAINER@" 8 | 9 | #define ${META_PROJECT_ID}_VERSION_MAJOR "@META_VERSION_MAJOR@" 10 | #define ${META_PROJECT_ID}_VERSION_MINOR "@META_VERSION_MINOR@" 11 | #define ${META_PROJECT_ID}_VERSION_PATCH "@META_VERSION_PATCH@" 12 | #define ${META_PROJECT_ID}_VERSION_REVISION "@META_VERSION_REVISION@" 13 | 14 | #define ${META_PROJECT_ID}_VERSION "@META_VERSION@" 15 | #define ${META_PROJECT_ID}_NAME_VERSION "@META_NAME_VERSION@" 16 | --------------------------------------------------------------------------------