├── .gitignore ├── COPYING ├── Makefile ├── Makefile.common.post ├── Makefile.common.pre ├── Makefile.functions ├── Makefile.qt.post ├── Makefile.qt.pre ├── Makefile.sdl.post ├── Makefile.sdl.pre ├── Makefile.settings ├── Makefile.sources ├── QtDemo.pro.in ├── QtLib.pro.in ├── QtLibConf.pri.in ├── README.1st ├── README.build.txt ├── README.buildsystem.txt ├── README.demos.txt ├── README.md ├── TODO.txt ├── demos ├── Rules.mk ├── archive │ └── qpainter_demo │ │ ├── .gitignore │ │ ├── draw_item.cpp │ │ ├── draw_item.hpp │ │ ├── generic_command_line.cpp │ │ ├── generic_command_line.hpp │ │ ├── image_item.cpp │ │ ├── image_item.hpp │ │ ├── main.cpp │ │ ├── qpainter_demo.pro │ │ ├── simple_2d_transformation.cpp │ │ ├── simple_2d_transformation.hpp │ │ ├── test_list.cpp │ │ ├── test_list.hpp │ │ ├── test_widget.cpp │ │ ├── test_widget.hpp │ │ ├── test_widgetGL.cpp │ │ ├── test_widgetGL.hpp │ │ ├── text_item.cpp │ │ ├── text_item.hpp │ │ ├── transformation_node.cpp │ │ └── transformation_node.hpp ├── cells │ ├── Cell.cpp │ ├── Cell.hpp │ ├── NodePacker.cpp │ ├── NodePacker.hpp │ ├── Rules.mk │ ├── Table.cpp │ ├── Table.hpp │ ├── main.cpp │ └── shaders │ │ ├── Rules.mk │ │ ├── simple_ui_shape.frag.glsl │ │ └── simple_ui_shape_translate_layer.vert.glsl ├── common │ ├── Rules.mk │ ├── generic_command_line.cpp │ ├── generic_command_line.hpp │ ├── qt_demo.cpp │ ├── qt_demo.hpp │ ├── sdl_demo.cpp │ ├── sdl_demo.hpp │ ├── wrath_demo.hpp │ └── wrath_demo_image_support.hpp ├── examples │ ├── Rules.mk │ ├── augmented_node │ │ ├── Rules.mk │ │ ├── augmented_node.cpp │ │ ├── augmented_node.hpp │ │ ├── item.cpp │ │ ├── item.hpp │ │ ├── item_packer.cpp │ │ ├── item_packer.hpp │ │ └── shaders │ │ │ ├── Rules.mk │ │ │ ├── item.frag.glsl │ │ │ └── item.vert.glsl │ ├── augmented_node2 │ │ ├── Rules.mk │ │ ├── augmented_node2.cpp │ │ ├── augmented_node2.hpp │ │ ├── item.cpp │ │ ├── item.hpp │ │ ├── item_packer.cpp │ │ ├── item_packer.hpp │ │ └── shaders │ │ │ ├── Rules.mk │ │ │ ├── item.frag.glsl │ │ │ └── item.vert.glsl │ ├── brush_example │ │ ├── Rules.mk │ │ ├── brush_example.cpp │ │ ├── item.cpp │ │ ├── item.hpp │ │ ├── item_packer.cpp │ │ ├── item_packer.hpp │ │ └── shaders │ │ │ ├── Rules.mk │ │ │ ├── item.frag.glsl │ │ │ └── item.vert.glsl │ ├── clip │ │ ├── Rules.mk │ │ ├── augmented_node.hpp │ │ ├── clip.cpp │ │ ├── item.cpp │ │ ├── item.hpp │ │ ├── item_packer.cpp │ │ ├── item_packer.hpp │ │ └── shaders │ │ │ ├── Rules.mk │ │ │ ├── item.frag.glsl │ │ │ └── item.vert.glsl │ ├── clip2 │ │ ├── Rules.mk │ │ ├── augmented_node.hpp │ │ ├── clip2.cpp │ │ ├── item.cpp │ │ ├── item.hpp │ │ ├── item_packer.cpp │ │ ├── item_packer.hpp │ │ └── shaders │ │ │ ├── Rules.mk │ │ │ ├── item.frag.glsl │ │ │ └── item.vert.glsl │ ├── counter │ │ ├── Rules.mk │ │ └── counter.cpp │ ├── hello_widget_generator │ │ ├── Rules.mk │ │ └── hello_widget_generator.cpp │ ├── hello_widget_generator2 │ │ ├── Rules.mk │ │ └── hello_widget_generator2.cpp │ ├── hello_wrathlayer │ │ ├── Rules.mk │ │ └── hello_wrathlayer.cpp │ ├── item_example │ │ ├── Rules.mk │ │ ├── item.cpp │ │ ├── item.hpp │ │ ├── item_example.cpp │ │ └── shaders │ │ │ ├── Rules.mk │ │ │ ├── item.frag.glsl │ │ │ └── item.vert.glsl │ ├── item_example2 │ │ ├── Rules.mk │ │ ├── item.cpp │ │ ├── item.hpp │ │ ├── item_example2.cpp │ │ ├── item_packer.cpp │ │ ├── item_packer.hpp │ │ └── shaders │ │ │ ├── Rules.mk │ │ │ ├── item.frag.glsl │ │ │ └── item.vert.glsl │ ├── rect │ │ ├── Rules.mk │ │ └── rect.cpp │ ├── rect2 │ │ ├── Rules.mk │ │ ├── rect2.cpp │ │ ├── shaders │ │ │ ├── Rules.mk │ │ │ ├── wobbly.frag.glsl │ │ │ └── wobbly.vert.glsl │ │ └── wobbly_node.hpp │ ├── rect3 │ │ ├── Rules.mk │ │ ├── augmented_node.hpp │ │ ├── rect3.cpp │ │ ├── rect_attribute_packer.cpp │ │ ├── rect_attribute_packer.hpp │ │ ├── shaders │ │ │ ├── Rules.mk │ │ │ ├── wobbly.frag.glsl │ │ │ └── wobbly.vert.glsl │ │ └── wobbly_node.hpp │ ├── shape │ │ ├── Rules.mk │ │ └── shape.cpp │ ├── text │ │ ├── Rules.mk │ │ └── text.cpp │ ├── wavy-text │ │ ├── Rules.mk │ │ ├── shaders │ │ │ ├── Rules.mk │ │ │ ├── wobbly.frag.glsl │ │ │ └── wobbly.vert.glsl │ │ ├── wavy-text.cpp │ │ └── wobbly_node.hpp │ └── wavy_clip2 │ │ ├── Rules.mk │ │ ├── augmented_node.hpp │ │ ├── rect_attribute_packer.cpp │ │ ├── rect_attribute_packer.hpp │ │ ├── shaders │ │ ├── Rules.mk │ │ ├── wobbly.frag.glsl │ │ └── wobbly.vert.glsl │ │ ├── wavy_clip2.cpp │ │ └── wobbly_node.hpp ├── image_demo │ ├── NodePacker.cpp │ ├── NodePacker.hpp │ ├── Rules.mk │ └── image_demo.cpp └── text_viewer │ ├── FileData.cpp │ ├── FileData.hpp │ ├── FilePacket.cpp │ ├── FilePacket.hpp │ ├── FileType.hpp │ ├── NodePacker.cpp │ ├── NodePacker.hpp │ ├── Rules.mk │ ├── TextChunk.cpp │ ├── TextChunk.hpp │ ├── TextViewer.cpp │ └── shaders │ ├── Rules.mk │ ├── distance_image.frag.glsl │ ├── font_animated.frag.glsl │ ├── simple.frag.glsl │ ├── simple_const_color.frag.glsl │ ├── simple_ui.vert.glsl │ ├── simple_ui_font.vert.glsl │ ├── simple_ui_line.vert.glsl │ ├── simple_ui_shape.frag.glsl │ └── simple_ui_shape.vert.glsl ├── docs ├── CodingConventions.txt ├── Doxyfile ├── DoxygenLayout.xml ├── Makefile ├── WRATH-Arch.txt ├── about-WRATH │ ├── WRATH-about-material.txt │ ├── WRATH-studio.tex │ └── browser │ │ └── WebBrowsers, Qt and GL.txt ├── documentation │ └── WRATH │ │ ├── wrath_in_numbers.doxy │ │ └── wrath_intro.doxy ├── doxy │ ├── .gitignore │ └── readme.txt ├── failed_experiments │ └── distance_texture_edge_sharpening │ │ ├── 2distance_values_per_texel │ │ ├── KANTextureFontTTF.cpp │ │ ├── KANTextureFontTTF.hpp │ │ └── reason_of_failure.txt │ │ └── distance_types_per_channel │ │ ├── KANTextureFontTTF.cpp │ │ ├── KANTextureFontTTF.hpp │ │ └── data.txt ├── generate_example_docs.sh ├── readme.txt ├── screenshots │ ├── augmented_node.png │ ├── augmented_node2.png │ ├── brush_example.png │ ├── clip.png │ ├── clip2.png │ ├── hello_widget_generator.png │ ├── hello_widget_generator2.png │ ├── hello_wrathlayer.png │ ├── item_example.png │ ├── item_example2.png │ ├── noimage.png │ ├── rect.png │ ├── rect2.png │ ├── rect3.png │ ├── shape.png │ ├── text.png │ ├── traditional_renderer.png │ ├── wavy_clip2.png │ └── wrath_renderer.png └── thoughts │ ├── WRATHServer.txt │ └── WRATH_inGL3.txt ├── images ├── 1024x1024.png ├── 512.512.color.diagnol.png ├── 512.512.diagonal.png ├── 512.512.png ├── eye.jpg ├── hands.jpg ├── image.png ├── image1.jpg ├── image_cp1.png ├── image_cp2.png ├── image_cp3.png ├── image_cp4.png ├── image_cp5.png ├── image_cp6.png ├── license.txt ├── light5.jpg └── white.png ├── inc ├── 3rd_party │ ├── Rules.mk │ ├── ieeehalfprecision │ │ ├── Rules.mk │ │ ├── ieeehalfprecision.h │ │ └── uint128.h │ └── wrath-glu-tess │ │ ├── Rules.mk │ │ └── wrath-glu-tess.hpp ├── FURY │ ├── Qt │ │ ├── FURYQTKeyCode.values.tcc │ │ ├── FURYQTKeyCodeMadnessQt3Notdefined.tcc │ │ ├── FURYQTKeyCodeMadnessQt3defined.tcc │ │ ├── FURYQtEvent.hpp │ │ ├── Rules.mk │ │ └── readme.txt │ ├── Rules.mk │ ├── SDL │ │ ├── FURYSDLEvent.hpp │ │ ├── FURYSDLKeyCode.values.tcc │ │ ├── Rules.mk │ │ └── readme.txt │ └── event │ │ ├── FURYEvent.hpp │ │ ├── FURYJoystickEvent.hpp │ │ ├── FURYKeyEvent.hpp │ │ ├── FURYMouseEvent.hpp │ │ ├── FURYResizeEvent.hpp │ │ ├── FURYTextEvent.hpp │ │ ├── FURYTouchEvent.hpp │ │ └── Rules.mk ├── Rules.mk └── WRATH │ ├── Qt │ ├── Rules.mk │ ├── WRATHQTFontSupport.hpp │ └── WRATHQTImageSupport.hpp │ ├── Rules.mk │ ├── SDL │ ├── Rules.mk │ ├── WRATHSDLImageSupport.hpp │ └── ngl_backend_sdl.hpp │ ├── WRATH.hpp │ ├── WRATHConfig.hpp │ ├── drawgroup │ ├── Rules.mk │ ├── WRATHAttributePacker.hpp │ ├── WRATHAttributePackerHelper.hpp │ ├── WRATHAttributeStore.hpp │ ├── WRATHAttributeStoreImplement.tcc │ ├── WRATHBaseSource.hpp │ ├── WRATHCanvas.hpp │ ├── WRATHCanvasHandle.hpp │ ├── WRATHDrawType.hpp │ ├── WRATHIndexGroupAllocator.hpp │ ├── WRATHItemDrawState.hpp │ ├── WRATHItemDrawer.hpp │ ├── WRATHItemDrawerFactory.hpp │ ├── WRATHItemGroup.hpp │ ├── WRATHShaderSpecifier.hpp │ ├── WRATHShaderSpecifierImplement.tcc │ ├── WRATHTwoPassDrawer.hpp │ └── drawgroup.doxy │ ├── gl │ ├── Rules.mk │ ├── WRATHAbstractDataSink.hpp │ ├── WRATHBufferAllocator.hpp │ ├── WRATHBufferBindingPoint.hpp │ ├── WRATHBufferObject.hpp │ ├── WRATHDrawCommand.hpp │ ├── WRATHDrawCommandIndexBuffer.hpp │ ├── WRATHGLExtensionList.hpp │ ├── WRATHGLProgram.hpp │ ├── WRATHGLStateChange.hpp │ ├── WRATHGLStateStack.hpp │ ├── WRATHGPUConfig.hpp │ ├── WRATHMultiGLProgram.hpp │ ├── WRATHRawDrawData.hpp │ ├── WRATHShaderSourceResource.hpp │ ├── WRATHTextureChoice.hpp │ ├── WRATHUniformData.hpp │ ├── WRATHgl.hpp │ ├── WRATHglGet.hpp │ ├── WRATHglShaderBits.hpp │ ├── WRATHgluniform.hpp │ ├── WRATHgluniform_implement.tcc │ ├── glutility.doxy │ ├── kernel.doxy │ ├── ngl_backend.hpp │ ├── ngl_backend_lib.hpp │ ├── opengl_trait.hpp │ └── opengl_trait_implement.tcc │ ├── image │ ├── Rules.mk │ ├── WRATHBrush.hpp │ ├── WRATHColorValueSource.hpp │ ├── WRATHDefaultRectAttributePacker.hpp │ ├── WRATHDefaultRectShader.hpp │ ├── WRATHGradient.hpp │ ├── WRATHGradientSource.hpp │ ├── WRATHGradientSourceBase.hpp │ ├── WRATHGradientValueBase.hpp │ ├── WRATHImage.hpp │ ├── WRATHLinearGradientValue.hpp │ ├── WRATHRadialGradientValue.hpp │ ├── WRATHRectAttributePacker.hpp │ ├── WRATHRepeatGradientValue.hpp │ ├── WRATHShaderBrushSourceHoard.hpp │ ├── WRATHTextureCoordinate.hpp │ ├── WRATHTextureCoordinateDynamic.hpp │ ├── WRATHTextureCoordinateSource.hpp │ ├── WRATHTextureCoordinateSourceBase.hpp │ └── image.doxy │ ├── items │ ├── Rules.mk │ ├── WRATHBaseItem.hpp │ ├── WRATHBasicTextItem.hpp │ ├── WRATHCanvasItem.hpp │ ├── WRATHEmptyItem.hpp │ ├── WRATHItemTypes.hpp │ ├── WRATHRectItem.hpp │ ├── WRATHShapeItem.hpp │ ├── WRATHShapeItemImplement.tcc │ ├── WRATHTextItem.hpp │ ├── WRATHTextItemTypes.hpp │ └── items.doxy │ ├── layer │ ├── Rules.mk │ ├── WRATHLayer.hpp │ ├── WRATHLayerBase.hpp │ ├── WRATHLayerClipDrawer.hpp │ ├── WRATHLayerClipDrawerMesh.hpp │ ├── WRATHLayerIntermediateTransformation.hpp │ ├── WRATHLayerItemDrawerFactory.hpp │ ├── WRATHLayerItemNodeBase.hpp │ ├── WRATHLayerItemNodeDepthOrder.hpp │ ├── WRATHLayerItemNodeDepthOrderPrivate.tcc │ ├── WRATHLayerItemWidgets.hpp │ ├── WRATHLayerNodeValuePackerBase.hpp │ ├── layer.doxy │ ├── node │ │ ├── Rules.mk │ │ ├── WRATHLayerItemNodeColorValue.hpp │ │ ├── WRATHLayerItemNodeColorValueImplement.tcc │ │ ├── WRATHLayerItemNodeFunctionPacketT.hpp │ │ ├── WRATHLayerItemNodeLinearGradient.hpp │ │ ├── WRATHLayerItemNodeRadialGradient.hpp │ │ ├── WRATHLayerItemNodeRepeatGradient.hpp │ │ ├── WRATHLayerItemNodeTexture.hpp │ │ ├── rotate_translate │ │ │ ├── Rules.mk │ │ │ ├── WRATHLayerItemNodeRotateTranslate.hpp │ │ │ └── WRATHLayerItemWidgetsRotateTranslate.hpp │ │ └── translate │ │ │ ├── Rules.mk │ │ │ ├── WRATHLayerItemNodeTranslate.hpp │ │ │ └── WRATHLayerItemWidgetsTranslate.hpp │ └── node_packers │ │ ├── Rules.mk │ │ ├── WRATHLayerNodeValuePackerHybrid.hpp │ │ ├── WRATHLayerNodeValuePackerHybridImplement.tcc │ │ ├── WRATHLayerNodeValuePackerTexture.hpp │ │ └── WRATHLayerNodeValuePackerUniformArrays.hpp │ ├── shape │ ├── Rules.mk │ ├── WRATHDefaultFillShapeAttributePacker.hpp │ ├── WRATHDefaultShapeShader.hpp │ ├── WRATHDefaultStrokeAttributePacker.hpp │ ├── WRATHDynamicStrokeAttributePacker.hpp │ ├── WRATHFillRule.hpp │ ├── WRATHGenericStrokeAttributePacker.hpp │ ├── WRATHOutline.hpp │ ├── WRATHShape.hpp │ ├── WRATHShapeAttributePacker.hpp │ ├── WRATHShapeDistanceFieldGPU.hpp │ ├── WRATHShapeDistanceFieldGPUutil.hpp │ ├── WRATHShapeDistanceFieldImplement.tcc │ ├── WRATHShapeDistanceFieldImplementTypes.tcc │ ├── WRATHShapePreStroker.hpp │ ├── WRATHShapeSimpleTessellator.hpp │ ├── WRATHShapeSimpleTessellatorImplement.tcc │ ├── WRATHShapeTriangulator.hpp │ ├── WRATHTessGLU.hpp │ ├── WRATHTessGLUPrivate.tcc │ ├── WRATHTriangulation.hpp │ ├── WRATHTriangulationImplement.tcc │ ├── WRATHTriangulationTypes.tcc │ └── shape.doxy │ ├── text │ ├── Rules.mk │ ├── WRATHColumnFormatter.hpp │ ├── WRATHDefaultTextAttributePacker.hpp │ ├── WRATHFontConfig.hpp │ ├── WRATHFontDatabase.hpp │ ├── WRATHFontFetch.hpp │ ├── WRATHFontShaderSpecifier.hpp │ ├── WRATHFontSupport.hpp │ ├── WRATHFormattedTextStream.hpp │ ├── WRATHFormatter.hpp │ ├── WRATHFormatterImplement.tcc │ ├── WRATHFreeTypeSupport.hpp │ ├── WRATHGenericTextAttributePacker.hpp │ ├── WRATHTextAttributePacker.hpp │ ├── WRATHTextData.hpp │ ├── WRATHTextDataStream.hpp │ ├── WRATHTextDataStreamManipulator.hpp │ ├── WRATHTextDataStreamManipulatorsImplement.tcc │ ├── WRATHTextureFont.hpp │ ├── WRATHTextureFontDrawer.hpp │ ├── WRATHTextureFontFreeType.hpp │ ├── WRATHTextureFontFreeType_Analytic.hpp │ ├── WRATHTextureFontFreeType_Coverage.hpp │ ├── WRATHTextureFontFreeType_CurveAnalytic.hpp │ ├── WRATHTextureFontFreeType_DetailedCoverage.hpp │ ├── WRATHTextureFontFreeType_Distance.hpp │ ├── WRATHTextureFontFreeType_Mix.hpp │ ├── WRATHTextureFontFreeType_MixImplement.tcc │ ├── WRATHTextureFontFreeType_MixTypes.tcc │ ├── WRATHTextureFontUtil.hpp │ ├── WRATHUTF16.hpp │ ├── WRATHUTF8.hpp │ └── text.doxy │ ├── util │ ├── Rules.mk │ ├── WRATH2DRigidTransformation.hpp │ ├── WRATH2DTransformation.hpp │ ├── WRATHAtlas.hpp │ ├── WRATHAtlasBase.hpp │ ├── WRATHBBox.hpp │ ├── WRATHBBoxForwardDeclare.hpp │ ├── WRATHInterleavedAttributes.hpp │ ├── WRATHInterleavedAttributesPrivate.tcc │ ├── WRATHMutex.hpp │ ├── WRATHNew.hpp │ ├── WRATHPolynomial.hpp │ ├── WRATHPolynomialImplement.tcc │ ├── WRATHReferenceCountedObject.hpp │ ├── WRATHResourceManager.hpp │ ├── WRATHScaleTranslate.hpp │ ├── WRATHScaleXYTranslate.hpp │ ├── WRATHSlotAllocator.hpp │ ├── WRATHStateStream.hpp │ ├── WRATHStateStreamManipulators.hpp │ ├── WRATHStaticInit.hpp │ ├── WRATHTime.hpp │ ├── WRATHTripleBufferEnabler.hpp │ ├── WRATHUtil.hpp │ ├── WRATHWrapper.hpp │ ├── WRATHWrapperImplement.tcc │ ├── WRATHassert.hpp │ ├── WRATHatomic.hpp │ ├── WRATHmalloc.hpp │ ├── c_array.hpp │ ├── matrixGL.hpp │ ├── ostream_utility.hpp │ ├── reorder_c_array.hpp │ ├── type_tag.hpp │ ├── utility.doxy │ ├── vecN.hpp │ └── vectorGL.hpp │ └── widgets │ ├── Rules.mk │ ├── WRATHFamily.hpp │ ├── WRATHFamilySet.hpp │ ├── WRATHGenericWidget.hpp │ ├── WRATHWidget.hpp │ ├── WRATHWidgetEnums.hpp │ ├── WRATHWidgetGenerator.hpp │ ├── WRATHWidgetGeneratorImplement.tcc │ ├── WRATHWidgetHandle.hpp │ └── widgets.doxy ├── makedepend.sh ├── ngl ├── .gitignore ├── Rules.mk └── readme.txt ├── ngl_generator ├── .gitignore ├── HeaderCreator.cpp ├── HeaderCreator.hpp ├── Rules.mk ├── filter.cpp ├── gl_flex.fl.cpp └── makefile ├── shell_scripts ├── create_cpp_hpp_from_file.sh └── decode_file_chars_to_numbers.pl ├── source.sh ├── src ├── 3rd_party │ ├── Rules.mk │ ├── ieeehalfprecision │ │ ├── Rules.mk │ │ └── ieeehalfprecision.c │ └── wrath-glu-tess │ │ ├── README │ │ ├── README2 │ │ ├── Rules.mk │ │ ├── alg-outline │ │ ├── dict-list.hpp │ │ ├── dict.cpp │ │ ├── dict.hpp │ │ ├── geom.cpp │ │ ├── geom.hpp │ │ ├── gluos.hpp │ │ ├── memalloc.cpp │ │ ├── memalloc.hpp │ │ ├── mesh.cpp │ │ ├── mesh.hpp │ │ ├── normal.cpp │ │ ├── normal.hpp │ │ ├── priorityq-heap.c.inc │ │ ├── priorityq-heap.hpp │ │ ├── priorityq-sort.hpp │ │ ├── priorityq.cpp │ │ ├── priorityq.hpp │ │ ├── render.cpp │ │ ├── render.hpp │ │ ├── sweep.cpp │ │ ├── sweep.hpp │ │ ├── tess.cpp │ │ ├── tess.hpp │ │ ├── tessmono.cpp │ │ └── tessmono.hpp ├── FURY │ ├── Qt │ │ ├── FURYQtEvent.cpp │ │ └── Rules.mk │ ├── Rules.mk │ ├── SDL │ │ ├── FURYSDLEvent.cpp │ │ └── Rules.mk │ └── event │ │ ├── FURYEvent.cpp │ │ └── Rules.mk ├── Rules.mk └── WRATH │ ├── Qt │ ├── Rules.mk │ ├── WRATHQTFontSupport.cpp │ ├── WRATHQTImageSupport.cpp │ └── ngl_backend_qt.cpp │ ├── Rules.mk │ ├── SDL │ ├── Rules.mk │ ├── WRATHSDLImageSupport.cpp │ └── ngl_backend_sdl.cpp │ ├── drawgroup │ ├── Rules.mk │ ├── WRATHAttributePacker.cpp │ ├── WRATHAttributeStore.cpp │ ├── WRATHBaseSource.cpp │ ├── WRATHCanvas.cpp │ ├── WRATHCanvasHandle.cpp │ ├── WRATHIndexGroupAllocator.cpp │ ├── WRATHItemDrawState.cpp │ ├── WRATHItemDrawer.cpp │ ├── WRATHItemGroup.cpp │ ├── WRATHShaderSpecifier.cpp │ └── WRATHTwoPassDrawer.cpp │ ├── gl │ ├── Rules.mk │ ├── WRATHBufferAllocator.cpp │ ├── WRATHBufferBindingPoint.cpp │ ├── WRATHBufferObject.cpp │ ├── WRATHGLExtensionList.cpp │ ├── WRATHGLProgram.cpp │ ├── WRATHGLStateChange.cpp │ ├── WRATHGLStateStack.cpp │ ├── WRATHGPUConfig.cpp │ ├── WRATHMultiGLProgram.cpp │ ├── WRATHRawDrawData.cpp │ ├── WRATHShaderSourceResource.cpp │ ├── WRATHTextureChoice.cpp │ ├── WRATHUniformData.cpp │ ├── ngl_backend.cpp │ └── ngl_backend_lib.cpp │ ├── image │ ├── Rules.mk │ ├── WRATHBrush.cpp │ ├── WRATHColorValueSource.cpp │ ├── WRATHDefaultRectAttributePacker.cpp │ ├── WRATHDefaultRectShader.cpp │ ├── WRATHGradient.cpp │ ├── WRATHGradientSource.cpp │ ├── WRATHGradientSourceBase.cpp │ ├── WRATHGradientValueBase.cpp │ ├── WRATHImage.cpp │ ├── WRATHLinearGradientValue.cpp │ ├── WRATHRadialGradientValue.cpp │ ├── WRATHRepeatGradientValue.cpp │ ├── WRATHShaderBrushSourceHoard.cpp │ ├── WRATHTextureCoordinate.cpp │ ├── WRATHTextureCoordinateDynamic.cpp │ ├── WRATHTextureCoordinateSource.cpp │ ├── WRATHTextureCoordinateSourceBase.cpp │ ├── WRATHTransformGradientValue.cpp │ └── shaders │ │ ├── Rules.mk │ │ ├── empty_pre_compute_shader_code_highp.wrath-shader.glsl │ │ ├── empty_pre_compute_shader_code_mediump.wrath-shader.glsl │ │ ├── empty_pre_compute_shader_code_noprec.wrath-shader.glsl │ │ ├── empty_pre_compute_tex_shader_code_highp.wrath-shader.glsl │ │ ├── empty_pre_compute_tex_shader_code_mediump.wrath-shader.glsl │ │ ├── empty_pre_compute_tex_shader_code_noprec.wrath-shader.glsl │ │ ├── image-repeat-mode-functions.wrath-shader.glsl │ │ ├── image-value-normalized-coordinate-dynamic.compute.wrath-shader.glsl │ │ ├── image-value-normalized-coordinate-dynamic.pre-compute.wrath-shader.glsl │ │ ├── image-value-normalized-coordinate.compute.wrath-shader.glsl │ │ ├── image-value-normalized-coordinate.pre-compute.wrath-shader.glsl │ │ ├── image.frag.wrath-shader.glsl │ │ ├── image.vert.wrath-shader.glsl │ │ ├── linear-gradient-values.compute.wrath-shader.glsl │ │ ├── linear-gradient-values.pre-compute.wrath-shader.glsl │ │ ├── radial-gradient-values.compute.wrath-shader.glsl │ │ ├── radial-gradient-values.pre_compute.wrath-shader.glsl │ │ ├── repeat-gradient.pre-compute.wrath-shader.glsl │ │ ├── repeat-gradient.wrath-shader.glsl │ │ ├── wrath-brush.frag.wrath-shader.glsl │ │ └── wrath-brush.vert.wrath-shader.glsl │ ├── items │ ├── Rules.mk │ ├── WRATHBaseItem.cpp │ ├── WRATHBasicTextItem.cpp │ ├── WRATHRectItem.cpp │ ├── WRATHShapeItem.cpp │ └── WRATHTextItem.cpp │ ├── layer │ ├── Rules.mk │ ├── WRATHLayer.cpp │ ├── WRATHLayerBase.cpp │ ├── WRATHLayerClipDrawerMesh.cpp │ ├── WRATHLayerItemDrawerFactory.cpp │ ├── WRATHLayerItemNodeBase.cpp │ ├── WRATHLayerNodeValuePackerBase.cpp │ ├── node │ │ ├── Rules.mk │ │ ├── WRATHLayerItemNodeColorValue.cpp │ │ ├── rotate_translate │ │ │ ├── Rules.mk │ │ │ ├── WRATHLayerItemNodeRotateTranslate.cpp │ │ │ └── shaders │ │ │ │ ├── Rules.mk │ │ │ │ ├── transformation_layer_rotate_translate.frag.wrath-shader.glsl │ │ │ │ └── transformation_layer_rotate_translate.vert.wrath-shader.glsl │ │ └── translate │ │ │ ├── Rules.mk │ │ │ ├── WRATHLayerItemNodeTranslate.cpp │ │ │ └── shaders │ │ │ ├── Rules.mk │ │ │ ├── layer_translate_clip_rect.frag.wrath-shader.glsl │ │ │ ├── layer_translate_clip_rect.vert.wrath-shader.glsl │ │ │ ├── transformation_layer_translate.frag.wrath-shader.glsl │ │ │ └── transformation_layer_translate.vert.wrath-shader.glsl │ └── node_packers │ │ ├── Rules.mk │ │ ├── WRATHLayerNodeValuePackerHybrid.cpp │ │ ├── WRATHLayerNodeValuePackerTexture.cpp │ │ └── WRATHLayerNodeValuePackerUniformArrays.cpp │ ├── shape │ ├── Rules.mk │ ├── WRATHDefaultFillShapeAttributePacker.cpp │ ├── WRATHDefaultShapeShader.cpp │ ├── WRATHDefaultStrokeAttributePacker.cpp │ ├── WRATHDynamicStrokeAttributePacker.cpp │ ├── WRATHGenericStrokeAttributePacker.cpp │ ├── WRATHShapeDistanceFieldGPU.cpp │ ├── WRATHShapeDistanceFieldGPUutil.cpp │ ├── WRATHShapePreStroker.cpp │ ├── WRATHShapeSimpleTessellator.cpp │ ├── WRATHShapeTriangulator.cpp │ ├── WRATHTessGLU.cpp │ └── shaders │ │ ├── Rules.mk │ │ ├── distance_field_draw_distance_points.frag.wrath-shader.glsl │ │ ├── distance_field_draw_distance_points.vert.wrath-shader.glsl │ │ ├── distance_field_draw_distance_rects.frag.wrath-shader.glsl │ │ ├── distance_field_draw_distance_rects.vert.wrath-shader.glsl │ │ ├── distance_field_simple_shader.frag.wrath-shader.glsl │ │ ├── distance_field_simple_shader.vert.wrath-shader.glsl │ │ ├── shape.frag.wrath-shader.glsl │ │ └── shape.vert.wrath-shader.glsl │ ├── text │ ├── Rules.mk │ ├── WRATHColumnFormatter.cpp │ ├── WRATHDefaultTextAttributePacker.cpp │ ├── WRATHFontConfig.cpp │ ├── WRATHFontDatabase.cpp │ ├── WRATHFontFetch.cpp │ ├── WRATHFontShaderSpecifier.cpp │ ├── WRATHFormattedTextStream.cpp │ ├── WRATHFreeTypeSupport.cpp │ ├── WRATHGenericTextAttributePacker.cpp │ ├── WRATHSVGFont.cpp │ ├── WRATHTextAttributePacker.cpp │ ├── WRATHTextDataStream.cpp │ ├── WRATHTextDataStreamManipulator.cpp │ ├── WRATHTextureFont.cpp │ ├── WRATHTextureFontDrawer.cpp │ ├── WRATHTextureFontFreeType_Analytic.cpp │ ├── WRATHTextureFontFreeType_Coverage.cpp │ ├── WRATHTextureFontFreeType_CurveAnalytic.cpp │ ├── WRATHTextureFontFreeType_DetailedCoverage.cpp │ ├── WRATHTextureFontFreeType_Distance.cpp │ ├── WRATHTextureFontFreeType_Mix.cpp │ ├── WRATHTextureFontUtil.cpp │ └── shaders │ │ ├── Rules.mk │ │ ├── analytic │ │ ├── Rules.mk │ │ ├── font_analytic_base.frag.wrath-shader.glsl │ │ ├── font_analytic_linear.frag.wrath-shader.glsl │ │ ├── font_analytic_linear.vert.wrath-shader.glsl │ │ ├── font_analytic_nonlinear.frag.wrath-shader.glsl │ │ └── font_analytic_nonlinear.vert.wrath-shader.glsl │ │ ├── common │ │ ├── Rules.mk │ │ ├── font_generic.frag.wrath-shader.glsl │ │ ├── font_generic_aa.frag.wrath-shader.glsl │ │ ├── font_shader_texture_page_data.wrath-shader.glsl │ │ ├── font_shader_wrath_prepare_glyph_vs.vert.wrath-shader.glsl │ │ └── simple_ui_font.vert.wrath-shader.glsl │ │ ├── coverage │ │ ├── Rules.mk │ │ ├── font_coverage_linear.frag.wrath-shader.glsl │ │ ├── font_coverage_linear.vert.wrath-shader.glsl │ │ ├── font_coverage_nonlinear.frag.wrath-shader.glsl │ │ └── font_coverage_nonlinear.vert.wrath-shader.glsl │ │ ├── curve_analytic │ │ ├── Rules.mk │ │ ├── font_curve_analytic_base.frag.wrath-shader.glsl │ │ ├── font_curve_analytic_linear.frag.wrath-shader.glsl │ │ ├── font_curve_analytic_linear.vert.wrath-shader.glsl │ │ ├── font_curve_analytic_nonlinear.frag.wrath-shader.glsl │ │ └── font_curve_analytic_nonlinear.vert.wrath-shader.glsl │ │ ├── detailed_coverage │ │ ├── Rules.mk │ │ ├── font_detailed_base.frag.wrath-shader.glsl │ │ ├── font_detailed_linear.frag.wrath-shader.glsl │ │ ├── font_detailed_linear.vert.wrath-shader.glsl │ │ ├── font_detailed_nonlinear.frag.wrath-shader.glsl │ │ └── font_detailed_nonlinear.vert.wrath-shader.glsl │ │ ├── distance │ │ ├── Rules.mk │ │ ├── font_distance_base.frag.glsl │ │ ├── font_distance_linear.frag.wrath-shader.glsl │ │ ├── font_distance_linear.vert.wrath-shader.glsl │ │ ├── font_distance_nonlinear.frag.wrath-shader.glsl │ │ └── font_distance_nonlinear.vert.wrath-shader.glsl │ │ └── mix │ │ ├── Rules.mk │ │ ├── font_mix_linear.frag.wrath-shader.glsl │ │ ├── font_mix_linear.vert.wrath-shader.glsl │ │ ├── font_mix_nonlinear.frag.wrath-shader.glsl │ │ ├── font_mix_nonlinear.vert.wrath-shader.glsl │ │ └── font_mix_page_data_func.wrath-shader.glsl │ └── util │ ├── Rules.mk │ ├── WRATH2DRigidTransformation.cpp │ ├── WRATHAtlas.cpp │ ├── WRATHAtlasBase.cpp │ ├── WRATHMutex.cpp │ ├── WRATHNew.cpp │ ├── WRATHPolynomial.cpp │ ├── WRATHReferenceCountedObject.cpp │ ├── WRATHResourceManager.cpp │ ├── WRATHStateStream.cpp │ ├── WRATHStaticInit.cpp │ ├── WRATHTripleBufferEnabler.cpp │ ├── WRATHUtil.cpp │ └── WRATHmalloc.cpp ├── text_viewer_data ├── directoy_listing_example.txt ├── examples │ ├── ALPHABET │ ├── UTF-8-demo.wutf8 │ ├── abbrev_revel_red.txt │ ├── abbrev_revlations.wutf8 │ ├── example_font_size.txt │ ├── font_test.txt │ ├── font_test_small.txt │ ├── image_test.txt │ ├── kk.txt │ ├── little_column.txt │ ├── little_column2.txt │ ├── lots_of_images.txt │ ├── revel_green.txt │ ├── revel_red.txt │ ├── revelation.wutf8 │ ├── shapes.txt │ ├── simple_shape.txt │ ├── tt.txt │ ├── underline.txt │ └── utf8.txt ├── nested_script_example.txt ├── qt_text_viewer_commandline.txt ├── qt_text_viewer_help_output ├── test.txt ├── tutorial.txt └── using_qt_text_viewer.txt ├── unfinished ├── Readme.txt ├── WRATHAntiAliasFillShapeAttributePacker.cpp ├── WRATHAntiAliasFillShapeAttributePacker.hpp ├── WRATHLayerNodeValuePackerTextureFixed.cpp ├── WRATHLayerNodeValuePackerTextureFixed.hpp ├── WRATHSVGFont.hpp ├── WRATHShapeDistanceField.hpp └── imperative │ ├── Rules.mk │ └── WRATHImperative.hpp ├── unix_util ├── kill_links.sh ├── readme.txt ├── remove_tab.sh └── sed_replace_all.sh ├── wrath-config.in └── wrath.spec /Makefile: -------------------------------------------------------------------------------- 1 | # Main top-level Makefile 2 | # 3 | 4 | # Build target names 5 | # 6 | # For every specified build target, files 7 | # 8 | # Makefile.lib.NAME.pre 9 | # Makefile.demos.NAME.pre 10 | # Makefile.lib.NAME.post 11 | # Makefile.demos.NAME.post 12 | # 13 | # get included. See existing files for examples. 14 | # 15 | # This variable is also overrideable from the environment or from make 16 | # command line. 17 | BUILDTARGETS ?= qt sdl 18 | 19 | include Makefile.settings 20 | include Makefile.functions 21 | 22 | include Makefile.common.pre 23 | 24 | define preinclude 25 | include Makefile.$(1).pre 26 | endef 27 | 28 | $(foreach target,$(BUILDTARGETS),$(eval $(call preinclude,$(target)))) 29 | 30 | include Makefile.sources 31 | 32 | define postinclude 33 | include Makefile.$(1).post 34 | endef 35 | 36 | $(foreach target,$(BUILDTARGETS),$(eval $(call postinclude,$(target)))) 37 | 38 | include Makefile.common.post 39 | -------------------------------------------------------------------------------- /Makefile.common.pre: -------------------------------------------------------------------------------- 1 | 2 | # Initialize these variables to be simply-expanded types 3 | LIB_SOURCES := 4 | SHADERS := 5 | INCLUDES := 6 | DEMOS := 7 | DEMOS_INCLUDES := 8 | EXTRA_CLEAN := 9 | 10 | RELEASE_ALL_TARGETS = 11 | DEBUG_ALL_TARGETS = 12 | -------------------------------------------------------------------------------- /Makefile.functions: -------------------------------------------------------------------------------- 1 | 2 | # Function that adds a target name to the help output target 3 | define addtargetname 4 | $(eval 5 | TARGETLIST += " $(strip $(1))" 6 | ) 7 | endef 8 | 9 | TARGETLIST := 10 | 11 | # Function that expands to the list of files with the correct path 12 | filelist = $(foreach filename,$(1),$(d)/$(filename)) 13 | -------------------------------------------------------------------------------- /Makefile.qt.pre: -------------------------------------------------------------------------------- 1 | 2 | QT_LIB_SOURCES := 3 | -------------------------------------------------------------------------------- /Makefile.sdl.pre: -------------------------------------------------------------------------------- 1 | 2 | SDL_LIB_SOURCES := 3 | 4 | LIBSDL_CXXFLAGS = `sdl2-config --cflags` 5 | LIBSDL_LDFLAGS := $(shell sdl2-config --libs) -lSDL2_image 6 | 7 | ifeq ($(MINGW_BUILD),1) 8 | ifeq ($(MINGW_CONSOLE_BUILD),1) 9 | TEMP := $(LIBSDL_LDFLAGS) 10 | LIBSDL_LDFLAGS := $(subst -mwindows, ,$(TEMP)) 11 | endif 12 | $(info SDL2 Link Flags:$(LIBSDL_LDFLAGS)) 13 | endif 14 | 15 | 16 | # Link SDL builds to libX11 for GLES2 builds 17 | ifeq ($(GL_TYPE),0) 18 | LIBSDL_LDFLAGS += -lX11 19 | endif 20 | 21 | -------------------------------------------------------------------------------- /Makefile.sources: -------------------------------------------------------------------------------- 1 | 2 | dir := ngl_generator 3 | include $(dir)/Rules.mk 4 | dir := ngl 5 | include $(dir)/Rules.mk 6 | dir := inc 7 | include $(dir)/Rules.mk 8 | dir := src 9 | include $(dir)/Rules.mk 10 | dir := demos 11 | include $(dir)/Rules.mk 12 | 13 | 14 | SHADER_SOURCES := $(addsuffix .cpp,$(SHADERS)) 15 | RELEASE_SHADERS := $(addprefix release/,$(SHADER_SOURCES)) 16 | DEBUG_SHADERS := $(addprefix debug/,$(SHADER_SOURCES)) 17 | 18 | DEPS := 19 | -------------------------------------------------------------------------------- /QtDemo.pro.in: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | DESTDIR = .. 3 | 4 | #CONFIG+=HARMATTAN 5 | HARMATTAN { 6 | ############################### 7 | # GRAB them volume keys on N9 8 | INCLUDEPATH+=/usr/include/resource/qt4 \ 9 | /usr/include/dbus-1.0 \ 10 | /usr/lib/dbus-1.0/include \ 11 | /usr/include/resource 12 | LIBS+=-lresourceqt 13 | 14 | ############################# 15 | ## also N9's GPU does not like branching 16 | ## in the fragment shader for texture lookup. 17 | DEFINES+=HARMATTAN MIX_SHADER_AVOID_BRANCHING 18 | } 19 | 20 | DEFINES += WRATH_QT 21 | 22 | QT += opengl 23 | CONFIG += qt warn_on exceptions stl rtti 24 | 25 | debug { 26 | DEFINES += 27 | } 28 | 29 | release { 30 | DEFINES += NDEBUG 31 | } 32 | -------------------------------------------------------------------------------- /QtLib.pro.in: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib 2 | CONFIG += dll 3 | VERSION = 0.0.0 4 | MAKEFILE = QtLib.Makefile 5 | OBJECTS_DIR = qt_obj 6 | 7 | #CONFIG+=HARMATTAN 8 | HARMATTAN { 9 | ############################### 10 | # GRAB them volume keys on N9 11 | INCLUDEPATH+=/usr/include/resource/qt4 \ 12 | /usr/include/dbus-1.0 \ 13 | /usr/lib/dbus-1.0/include \ 14 | /usr/include/resource 15 | LIBS+=-lresourceqt 16 | 17 | ############################# 18 | ## also N9's GPU does not like branching 19 | ## in the fragment shader for texture lookup. 20 | DEFINES+=HARMATTAN MIX_SHADER_AVOID_BRANCHING 21 | } 22 | 23 | DEFINES += WRATH_QT 24 | 25 | QT += opengl 26 | CONFIG += qt warn_on exceptions stl rtti 27 | 28 | debug { 29 | DEFINES += 30 | } 31 | 32 | release { 33 | DEFINES += NDEBUG 34 | } 35 | -------------------------------------------------------------------------------- /QtLibConf.pri.in: -------------------------------------------------------------------------------- 1 | #CONFIG+=HARMATTAN 2 | HARMATTAN { 3 | ############################### 4 | # GRAB them volume keys on N9 5 | INCLUDEPATH+=/usr/include/resource/qt4 \ 6 | /usr/include/dbus-1.0 \ 7 | /usr/lib/dbus-1.0/include \ 8 | /usr/include/resource 9 | LIBS+=-lresourceqt 10 | 11 | ############################# 12 | ## also N9's GPU does not like branching 13 | ## in the fragment shader for texture lookup. 14 | DEFINES+=HARMATTAN MIX_SHADER_AVOID_BRANCHING 15 | } 16 | 17 | DEFINES += WRATH_QT 18 | 19 | QT += opengl 20 | CONFIG += qt warn_on exceptions stl rtti 21 | 22 | debug { 23 | DEFINES += 24 | } 25 | 26 | release { 27 | DEFINES += NDEBUG 28 | } 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | wrath 2 | ===== 3 | 4 | WRATH is a library to facilitate drawing user interfaces with GL in 5 | an optimized fashion. It does not address window creation or event 6 | handling for that matter. It only handles drawing and creation of 7 | objects that represent that drawing. To that end WRATH can be made 8 | to work in a variety of toolkits that allow drawing with OpenGL or 9 | OpenGL ES. 10 | 11 | WRATH is a data based library; UI items and widgets by their 12 | existence have their content presented to the screen. The items and 13 | widgets themselves do NOT have a paint method. Instead, how 14 | they are drawn and what they draw is data and that data is assembled 15 | by WRATH into common units to reduce CPU load on drawing. 16 | 17 | WRATH provides the following features for UI drawing 18 | * text rendering and formatting 19 | * image, gradients and brushes 20 | * paths: filling and stroking 21 | * transformation hierarchy system allowing for user defined transformation node types 22 | * a set of classes that allows one to create new item types drawn with one's shaders 23 | that will work on an transformation node type using the transformation hierarchy system 24 | of WRATH 25 | * a set of classes to apply brush (image, gradient, etc) linearly and non-linearly 26 | to items 27 | 28 | and more. 29 | 30 | 31 | -------------------------------------------------------------------------------- /demos/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | # This dir must be first, others don't matter 8 | dir := $(d)/common 9 | include $(dir)/Rules.mk 10 | 11 | dir := $(d)/text_viewer 12 | include $(dir)/Rules.mk 13 | 14 | dir := $(d)/image_demo 15 | include $(dir)/Rules.mk 16 | 17 | dir := $(d)/cells 18 | include $(dir)/Rules.mk 19 | 20 | dir := $(d)/examples 21 | include $(dir)/Rules.mk 22 | 23 | # Begin standard footer 24 | d := $(dirstack_$(sp)) 25 | sp := $(basename $(sp)) 26 | # End standard footer 27 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | Makefile 3 | moc_* 4 | qpainter_image_demo 5 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/draw_item.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file draw_item.cpp 3 | * \brief file draw_item.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "draw_item.hpp" 21 | 22 | DrawItem:: 23 | DrawItem(DrawList *parent): 24 | QObject(parent) 25 | {} 26 | 27 | 28 | DrawItem:: 29 | ~DrawItem() 30 | {} 31 | 32 | DrawList:: 33 | DrawList(QObject *parent): 34 | QObject(parent) 35 | {} 36 | 37 | DrawList:: 38 | ~DrawList() 39 | {} 40 | 41 | 42 | void 43 | DrawList:: 44 | draw(QPainter *p) 45 | { 46 | for(QObjectList::const_iterator iter=children().begin(), 47 | end=children().end(); iter!=end; ++iter) 48 | { 49 | DrawItem *ptr; 50 | 51 | ptr=qobject_cast(*iter); 52 | if(ptr!=NULL) 53 | { 54 | ptr->drawItem(p); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/draw_item.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file draw_item.hpp 3 | * \brief file draw_item.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef DRAW_ITEM_HPP 21 | #define DRAW_ITEM_HPP 22 | 23 | #include 24 | #include 25 | 26 | class DrawList; 27 | class DrawItem:public QObject 28 | { 29 | Q_OBJECT; 30 | 31 | public: 32 | 33 | DrawItem(DrawList *parent); 34 | ~DrawItem(); 35 | 36 | virtual 37 | void 38 | drawItem(QPainter*)=0; 39 | 40 | 41 | }; 42 | 43 | class DrawList:public QObject 44 | { 45 | Q_OBJECT; 46 | 47 | public: 48 | DrawList(QObject *parent); 49 | ~DrawList(); 50 | 51 | void 52 | draw(QPainter *p); 53 | }; 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/image_item.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file image_item.cpp 3 | * \brief file image_item.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "image_item.hpp" 21 | #include "test_widget.hpp" 22 | 23 | ImageItem:: 24 | ImageItem(QImage img, 25 | const QRectF &location_to_draw, 26 | DrawList *drawer, 27 | TransformationNode *transformation): 28 | DrawItem(drawer), 29 | m_image(img), 30 | m_rect(location_to_draw), 31 | m_transformation(transformation) 32 | {} 33 | 34 | ImageItem:: 35 | ~ImageItem() 36 | {} 37 | 38 | void 39 | ImageItem:: 40 | drawItem(QPainter *painter) 41 | { 42 | //save painter transformation state: 43 | //painter->save(); 44 | 45 | //draw image, QPainter API does not seem 46 | //to include the ability to modulate the color of an image. 47 | painter->setTransform(m_transformation->getGlobalValue().transformation()); 48 | painter->drawImage(m_rect, m_image); 49 | 50 | //restore transformation state: 51 | //painter->restore(); 52 | } 53 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/image_item.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file image_item.hpp 3 | * \brief file image_item.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef IMAGE_ITEM_HPP 21 | #define IMAGE_ITEM_HPP 22 | 23 | #include 24 | #include 25 | #include "draw_item.hpp" 26 | #include "transformation_node.hpp" 27 | 28 | 29 | class TransformationNode; 30 | 31 | class ImageItem:public DrawItem 32 | { 33 | public: 34 | 35 | ImageItem(QImage img, const QRectF &location_to_draw, 36 | DrawList *drawer, 37 | TransformationNode *transformation); 38 | 39 | ~ImageItem(); 40 | 41 | virtual 42 | void 43 | drawItem(QPainter *painter); 44 | 45 | const QRectF& 46 | rect(void) const 47 | { 48 | return m_rect; 49 | } 50 | 51 | void 52 | setRect(const QRectF &R) 53 | { 54 | m_rect=R; 55 | } 56 | 57 | private: 58 | QImage m_image; 59 | QRectF m_rect; 60 | TransformationNode *m_transformation; 61 | }; 62 | 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/qpainter_demo.pro: -------------------------------------------------------------------------------- 1 | TARGET = qpainter_image_demo 2 | TEMPLATE = app 3 | SOURCES += transformation_node.cpp \ 4 | text_item.cpp \ 5 | image_item.cpp \ 6 | draw_item.cpp \ 7 | generic_command_line.cpp \ 8 | test_list.cpp \ 9 | test_widget.cpp \ 10 | test_widgetGL.cpp \ 11 | simple_2d_transformation.cpp \ 12 | main.cpp 13 | 14 | HEADERS += transformation_node.hpp \ 15 | text_item.hpp \ 16 | image_item.hpp \ 17 | draw_item.hpp \ 18 | test_list.hpp \ 19 | test_widget.hpp \ 20 | test_widgetGL.hpp \ 21 | simple_2d_transformation.hpp \ 22 | generic_command_line.hpp 23 | 24 | 25 | 26 | QT += opengl 27 | #CONFIG += qt warn_on debug exceptions stl rtti 28 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/simple_2d_transformation.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file simple_2d_transformation.cpp 3 | * \brief file simple_2d_transformation.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "simple_2d_transformation.hpp" 21 | 22 | void 23 | Simple2DTransform:: 24 | rotation(const std::complex &r) 25 | { 26 | float m; 27 | 28 | m=std::abs(r); 29 | if(m>=0.00001) 30 | { 31 | m_rotation=r/m; 32 | } 33 | } 34 | 35 | QTransform 36 | Simple2DTransform:: 37 | transformation(void) const 38 | { 39 | QTransform R(m_scale*m_rotation.real(), m_scale*m_rotation.imag(), 0.0f, 40 | -m_scale*m_rotation.imag(), m_scale*m_rotation.real(), 0.0f, 41 | m_translation.real(), m_translation.imag(), 1.0f); 42 | 43 | return R; 44 | } 45 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/test_widget.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file test_widget.hpp 3 | * \brief file test_widget.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef TEST_WIDGET_HPP 21 | #define TEST_WIDGET_HPP 22 | 23 | #include 24 | #include "test_list.hpp" 25 | 26 | class TestWidget:public QWidget 27 | { 28 | public: 29 | 30 | explicit 31 | TestWidget(const main_widget_command_line &cmd); 32 | ~TestWidget(void); 33 | 34 | protected: 35 | 36 | virtual 37 | void 38 | keyPressEvent(QKeyEvent *event); 39 | 40 | virtual 41 | void 42 | mousePressEvent(QMouseEvent *event); 43 | 44 | void 45 | paintEvent(QPaintEvent*); 46 | 47 | void 48 | resizeEvent(QResizeEvent*); 49 | 50 | private: 51 | 52 | TestList *m_list; 53 | }; 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/test_widgetGL.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file test_widgetGL.hpp 3 | * \brief file test_widgetGL.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef TEST_WIDGET_GL_HPP 21 | #define TEST_WIDGET_GL_HPP 22 | 23 | #include 24 | #include "test_list.hpp" 25 | 26 | class TestWidgetGL:public QGLWidget 27 | { 28 | public: 29 | 30 | TestWidgetGL(const main_widget_command_line &cmd, 31 | const QGLFormat &fmt); 32 | ~TestWidgetGL(void); 33 | 34 | protected: 35 | 36 | virtual 37 | void 38 | keyPressEvent(QKeyEvent *event); 39 | 40 | virtual 41 | void 42 | mousePressEvent(QMouseEvent *event); 43 | 44 | void 45 | paintEvent(QPaintEvent*); 46 | 47 | void 48 | resizeEvent(QResizeEvent*); 49 | 50 | private: 51 | 52 | TestList *m_list; 53 | }; 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/text_item.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file text_item.cpp 3 | * \brief file text_item.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "text_item.hpp" 21 | #include "test_widget.hpp" 22 | #include 23 | 24 | TextItem:: 25 | TextItem(QFont pfont, const QColor &pcolor, QString ptext, 26 | DrawList *drawer, 27 | TransformationNode *transformation): 28 | DrawItem(drawer), 29 | m_font(pfont), 30 | m_text(ptext), 31 | m_color(pcolor), 32 | m_transformation(transformation) 33 | {} 34 | 35 | TextItem:: 36 | ~TextItem() 37 | {} 38 | 39 | 40 | void 41 | TextItem:: 42 | setColor(const QColor &c) 43 | { 44 | m_color=c; 45 | } 46 | 47 | const QColor& 48 | TextItem:: 49 | color(void) const 50 | { 51 | return m_color; 52 | } 53 | 54 | void 55 | TextItem:: 56 | setText(const QString &ptext) 57 | { 58 | m_text=ptext; 59 | } 60 | 61 | const QString& 62 | TextItem:: 63 | text(void) const 64 | { 65 | return m_text; 66 | } 67 | 68 | 69 | void 70 | TextItem:: 71 | drawItem(QPainter *painter) 72 | { 73 | //save painter transformation state: 74 | //painter->save(); 75 | 76 | painter->setTransform(m_transformation->getGlobalValue().transformation()); 77 | painter->setFont(m_font); 78 | painter->setPen(m_color); 79 | painter->drawText(QPointF(10.0f, 10.0f), m_text); 80 | 81 | //restore transformation state: 82 | //painter->restore(); 83 | } 84 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/text_item.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file text_item.hpp 3 | * \brief file text_item.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef TEXT_ITEM_HPP 21 | #define TEXT_ITEM_HPP 22 | 23 | 24 | 25 | #include 26 | #include 27 | #include "draw_item.hpp" 28 | #include "transformation_node.hpp" 29 | 30 | 31 | class TransformationNode; 32 | 33 | class TextItem:public DrawItem 34 | { 35 | public: 36 | TextItem(QFont pfont, const QColor &pcolor, QString ptext, 37 | DrawList *drawer, 38 | TransformationNode *transformation); 39 | ~TextItem(); 40 | 41 | void 42 | setColor(const QColor &c); 43 | 44 | const QColor& 45 | color(void) const; 46 | 47 | void 48 | setText(const QString &ptext); 49 | 50 | const QString& 51 | text(void) const; 52 | 53 | virtual 54 | void 55 | drawItem(QPainter*); 56 | 57 | private: 58 | QFont m_font; 59 | QString m_text; 60 | QColor m_color; 61 | TransformationNode *m_transformation; 62 | }; 63 | 64 | 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /demos/archive/qpainter_demo/transformation_node.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file transformation_node.hpp 3 | * \brief file transformation_node.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef TRANSFORMATION_NODE_HPP 21 | #define TRANSFORMATION_NODE_HPP 22 | 23 | #include 24 | #include "simple_2d_transformation.hpp" 25 | 26 | typedef Simple2DTransform TransformNodeType; 27 | 28 | class TransformationNode:public QObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | 34 | TransformationNode(TransformationNode *parent=NULL); 35 | ~TransformationNode(void); 36 | 37 | void 38 | setValue(const TransformNodeType &v); 39 | 40 | //do NOT save the reference past setting/modifying the value! 41 | TransformNodeType& 42 | getRefValue(void); 43 | 44 | const TransformNodeType& 45 | getValue(void) const; 46 | 47 | const TransformNodeType& 48 | getGlobalValue(void); 49 | 50 | 51 | private: 52 | 53 | void 54 | walk_update_values(void); 55 | 56 | TransformationNode *m_parent, *m_root; 57 | TransformNodeType m_local_value, m_global_value; 58 | bool m_dirty; 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /demos/cells/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/shaders 8 | include $(dir)/Rules.mk 9 | 10 | DEMOS += cells 11 | 12 | cells_SOURCES := $(call filelist, Cell.cpp main.cpp Table.cpp NodePacker.cpp) $(COMMON_DEMO_SOURCES) 13 | 14 | # Begin standard footer 15 | d := $(dirstack_$(sp)) 16 | sp := $(basename $(sp)) 17 | # End standard footer 18 | -------------------------------------------------------------------------------- /demos/cells/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | cells_SHADERS :=$(call filelist, simple_ui_shape.frag.glsl simple_ui_shape_translate_layer.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /demos/cells/shaders/simple_ui_shape.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file simple_ui_shape.frag.glsl 3 | * \brief file simple_ui_shape.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifdef AA_HINT 21 | shader_in mediump float aa_hint; 22 | #endif 23 | 24 | 25 | 26 | shader_in mediump vec4 tex_color; 27 | 28 | 29 | 30 | void 31 | shader_main(void) 32 | { 33 | 34 | mediump vec4 color; 35 | 36 | #ifdef WRATH_NON_LINEAR_GRADIENT 37 | mediump vec2 tex_coord; 38 | #endif 39 | 40 | //#ifdef CLIPPING_USES_DISCARD 41 | discard_if_clipped(); 42 | //#endif 43 | 44 | color=tex_color; 45 | 46 | 47 | 48 | 49 | #if defined(AA_HINT) && defined(WRATH_DERIVATIVES_SUPPORTED) 50 | { 51 | mediump float alpha, abs_aa, dd; 52 | abs_aa=1.0 - abs(aa_hint); 53 | dd=fwidth(abs_aa); 54 | alpha=color.w*min(1.0, abs_aa/dd); 55 | 56 | 57 | #if defined(WRATH_IS_OPAQUE_PASS) 58 | if(alpha=float(WRATH_TRANSLUCENT_THRESHOLD)) 62 | alpha=0.0; 63 | #endif 64 | 65 | wrath_FragColor=vec4(color.xyz*alpha, alpha); 66 | } 67 | #else 68 | 69 | wrath_FragColor=vec4(color.xyz, 1.0)*color.w; 70 | 71 | #endif 72 | } 73 | -------------------------------------------------------------------------------- /demos/common/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | DEMOS_INCLUDES += -I$(d) 8 | 9 | COMMON_DEMO_SOURCES := $(call filelist, generic_command_line.cpp) 10 | COMMON_SDL_DEMO_SOURCES := $(call filelist, sdl_demo.cpp) 11 | COMMON_QT_DEMO_SOURCES := $(call filelist, qt_demo.cpp) 12 | 13 | # Begin standard footer 14 | d := $(dirstack_$(sp)) 15 | sp := $(basename $(sp)) 16 | # End standard footer 17 | -------------------------------------------------------------------------------- /demos/common/wrath_demo.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file wrath_demo.hpp 3 | * \brief file wrath_demo.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "WRATHConfig.hpp" 21 | 22 | 23 | #ifdef WRATH_QT 24 | #include "qt_demo.hpp" 25 | #else 26 | #include "sdl_demo.hpp" 27 | #endif 28 | -------------------------------------------------------------------------------- /demos/common/wrath_demo_image_support.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file wrath_demo_image_support.hpp 3 | * \brief file wrath_demo_image_support.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef WRATH_DEMO_IMAGE_SUPPORT_HPP 21 | #define WRATH_DEMO_IMAGE_SUPPORT_HPP 22 | 23 | #include "WRATHConfig.hpp" 24 | 25 | 26 | #ifdef WRATH_QT 27 | #include "WRATHQTImageSupport.hpp" 28 | namespace WRATHDemo 29 | { 30 | using namespace WRATHQT; 31 | } 32 | 33 | #else 34 | 35 | #include "WRATHSDLImageSupport.hpp" 36 | namespace WRATHDemo 37 | { 38 | using namespace WRATHSDL; 39 | } 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /demos/examples/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/clip 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/clip2 11 | include $(dir)/Rules.mk 12 | 13 | dir := $(d)/augmented_node 14 | include $(dir)/Rules.mk 15 | 16 | dir := $(d)/augmented_node2 17 | include $(dir)/Rules.mk 18 | 19 | dir := $(d)/hello_widget_generator 20 | include $(dir)/Rules.mk 21 | 22 | dir := $(d)/hello_widget_generator2 23 | include $(dir)/Rules.mk 24 | 25 | dir := $(d)/hello_wrathlayer 26 | include $(dir)/Rules.mk 27 | 28 | dir := $(d)/shape 29 | include $(dir)/Rules.mk 30 | 31 | dir := $(d)/text 32 | include $(dir)/Rules.mk 33 | 34 | dir := $(d)/item_example 35 | include $(dir)/Rules.mk 36 | 37 | dir := $(d)/item_example2 38 | include $(dir)/Rules.mk 39 | 40 | dir := $(d)/brush_example 41 | include $(dir)/Rules.mk 42 | 43 | dir := $(d)/rect 44 | include $(dir)/Rules.mk 45 | 46 | dir := $(d)/rect2 47 | include $(dir)/Rules.mk 48 | 49 | dir := $(d)/rect3 50 | include $(dir)/Rules.mk 51 | 52 | dir := $(d)/wavy_clip2 53 | include $(dir)/Rules.mk 54 | 55 | dir := $(d)/wavy-text 56 | include $(dir)/Rules.mk 57 | 58 | dir := $(d)/counter 59 | include $(dir)/Rules.mk 60 | 61 | 62 | 63 | # Begin standard footer 64 | d := $(dirstack_$(sp)) 65 | sp := $(basename $(sp)) 66 | # End standard footer 67 | -------------------------------------------------------------------------------- /demos/examples/augmented_node/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | dir := $(d)/shaders 9 | include $(dir)/Rules.mk 10 | 11 | DEMOS += augmented-node 12 | 13 | augmented-node_SOURCES := $(call filelist, augmented_node.cpp item.cpp item_packer.cpp) $(COMMON_DEMO_SOURCES) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /demos/examples/augmented_node/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | augmented-node_SHADERS :=$(call filelist, item.frag.glsl item.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer -------------------------------------------------------------------------------- /demos/examples/augmented_node/shaders/item.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file item.frag.glsl 3 | * \brief file item.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | void 21 | shader_main(void) 22 | { 23 | // the transformation node GLSL code defines 24 | // this function which will issue a discard 25 | // if the node comptues the fragment to be 26 | // discarded, if the node does not define 27 | // any clipping or if the node's clipping is 28 | // determined by another means (for example 29 | // using GL clip planes) then this function 30 | // is a no-op. 31 | discard_if_clipped(); 32 | 33 | // WRATHShaderBrushSourceHoard defines the macro 34 | // WRATH_LINEAR_BRUSH_PRESENT if an donly if it defines 35 | // a brush where the brush input coordinates are 36 | // determined by the vertex shader. 37 | #ifdef WRATH_LINEAR_BRUSH_PRESENT 38 | { 39 | wrath_FragColor=wrath_shader_brush_color(); 40 | } 41 | #else 42 | { 43 | wrath_FragColor=vec4(0.5, 0.0, 1.0, 1.0); 44 | } 45 | #endif 46 | } 47 | -------------------------------------------------------------------------------- /demos/examples/augmented_node2/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | dir := $(d)/shaders 9 | include $(dir)/Rules.mk 10 | 11 | DEMOS += augmented-node2 12 | 13 | augmented-node2_SOURCES := $(call filelist, augmented_node2.cpp item.cpp item_packer.cpp) $(COMMON_DEMO_SOURCES) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /demos/examples/augmented_node2/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | augmented-node2_SHADERS :=$(call filelist, item.frag.glsl item.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer -------------------------------------------------------------------------------- /demos/examples/augmented_node2/shaders/item.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file item.frag.glsl 3 | * \brief file item.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | void 21 | shader_main(void) 22 | { 23 | // the transformation node GLSL code defines 24 | // this function which will issue a discard 25 | // if the node comptues the fragment to be 26 | // discarded, if the node does not define 27 | // any clipping or if the node's clipping is 28 | // determined by another means (for example 29 | // using GL clip planes) then this function 30 | // is a no-op. 31 | discard_if_clipped(); 32 | 33 | // WRATHShaderBrushSourceHoard defines the macro 34 | // WRATH_LINEAR_BRUSH_PRESENT if an donly if it defines 35 | // a brush where the brush input coordinates are 36 | // determined by the vertex shader. 37 | #ifdef WRATH_LINEAR_BRUSH_PRESENT 38 | { 39 | wrath_FragColor=wrath_shader_brush_color(); 40 | } 41 | #else 42 | { 43 | wrath_FragColor=vec4(0.5, 0.0, 1.0, 1.0); 44 | } 45 | #endif 46 | } 47 | -------------------------------------------------------------------------------- /demos/examples/brush_example/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | dir := $(d)/shaders 9 | include $(dir)/Rules.mk 10 | 11 | DEMOS += brush-example 12 | 13 | brush-example_SOURCES := $(call filelist, brush_example.cpp item.cpp item_packer.cpp) $(COMMON_DEMO_SOURCES) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /demos/examples/brush_example/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | brush-example_SHADERS :=$(call filelist, item.frag.glsl item.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer -------------------------------------------------------------------------------- /demos/examples/brush_example/shaders/item.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file item.frag.glsl 3 | * \brief file item.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | void 21 | shader_main(void) 22 | { 23 | // the transformation node GLSL code defines 24 | // this function which will issue a discard 25 | // if the node comptues the fragment to be 26 | // discarded, if the node does not define 27 | // any clipping or if the node's clipping is 28 | // determined by another means (for example 29 | // using GL clip planes) then this function 30 | // is a no-op. 31 | discard_if_clipped(); 32 | 33 | // WRATHShaderBrushSourceHoard defines the macro 34 | // WRATH_LINEAR_BRUSH_PRESENT if an donly if it defines 35 | // a brush where the brush input coordinates are 36 | // determined by the vertex shader. 37 | #ifdef WRATH_LINEAR_BRUSH_PRESENT 38 | { 39 | wrath_FragColor=wrath_shader_brush_color(); 40 | } 41 | #else 42 | { 43 | wrath_FragColor=vec4(0.5, 0.0, 1.0, 1.0); 44 | } 45 | #endif 46 | } 47 | -------------------------------------------------------------------------------- /demos/examples/brush_example/shaders/item.vert.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file item.vert.glsl 3 | * \brief file item.vert.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | //pos meanings: 21 | // .xy: location in UI co-ordinates (2D) 22 | shader_in mediump vec2 pos; 23 | 24 | void 25 | shader_main(void) 26 | { 27 | // WRATHShaderBrushSourceHoard defines the macro 28 | // WRATH_LINEAR_BRUSH_PRESENT if an donly if it defines 29 | // a brush where the brush input coordinates are 30 | // determined by the vertex shader. 31 | #ifdef WRATH_LINEAR_BRUSH_PRESENT 32 | { 33 | wrath_shader_brush_prepare(pos.xy); 34 | } 35 | #endif 36 | 37 | gl_Position= compute_gl_position_and_apply_clipping( vec3(pos, -1.0) ); 38 | } 39 | -------------------------------------------------------------------------------- /demos/examples/clip/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/shaders 8 | include $(dir)/Rules.mk 9 | 10 | DEMOS += clip 11 | 12 | clip_SOURCES := $(call filelist, clip.cpp item.cpp item_packer.cpp) $(COMMON_DEMO_SOURCES) 13 | 14 | # Begin standard footer 15 | d := $(dirstack_$(sp)) 16 | sp := $(basename $(sp)) 17 | # End standard footer 18 | -------------------------------------------------------------------------------- /demos/examples/clip/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | clip_SHADERS :=$(call filelist, item.frag.glsl item.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer -------------------------------------------------------------------------------- /demos/examples/clip/shaders/item.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file item.frag.glsl 3 | * \brief file item.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | void 21 | shader_main(void) 22 | { 23 | // the transformation node GLSL code defines 24 | // this function which will issue a discard 25 | // if the node comptues the fragment to be 26 | // discarded, if the node does not define 27 | // any clipping or if the node's clipping is 28 | // determined by another means (for example 29 | // using GL clip planes) then this function 30 | // is a no-op. 31 | discard_if_clipped(); 32 | 33 | // WRATHShaderBrushSourceHoard defines the macro 34 | // WRATH_LINEAR_BRUSH_PRESENT if an donly if it defines 35 | // a brush where the brush input coordinates are 36 | // determined by the vertex shader. 37 | #ifdef WRATH_LINEAR_BRUSH_PRESENT 38 | { 39 | wrath_FragColor=wrath_shader_brush_color(); 40 | } 41 | #else 42 | { 43 | wrath_FragColor=vec4(0.5, 0.0, 1.0, 1.0); 44 | } 45 | #endif 46 | } 47 | -------------------------------------------------------------------------------- /demos/examples/clip2/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/shaders 8 | include $(dir)/Rules.mk 9 | 10 | DEMOS += clip2 11 | 12 | clip2_SOURCES := $(call filelist, clip2.cpp item.cpp item_packer.cpp) $(COMMON_DEMO_SOURCES) 13 | 14 | # Begin standard footer 15 | d := $(dirstack_$(sp)) 16 | sp := $(basename $(sp)) 17 | # End standard footer 18 | -------------------------------------------------------------------------------- /demos/examples/clip2/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | clip2_SHADERS :=$(call filelist, item.frag.glsl item.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer -------------------------------------------------------------------------------- /demos/examples/clip2/shaders/item.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file item.frag.glsl 3 | * \brief file item.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | void 21 | shader_main(void) 22 | { 23 | // the transformation node GLSL code defines 24 | // this function which will issue a discard 25 | // if the node comptues the fragment to be 26 | // discarded, if the node does not define 27 | // any clipping or if the node's clipping is 28 | // determined by another means (for example 29 | // using GL clip planes) then this function 30 | // is a no-op. 31 | discard_if_clipped(); 32 | 33 | // WRATHShaderBrushSourceHoard defines the macro 34 | // WRATH_LINEAR_BRUSH_PRESENT if an donly if it defines 35 | // a brush where the brush input coordinates are 36 | // determined by the vertex shader. 37 | #ifdef WRATH_LINEAR_BRUSH_PRESENT 38 | { 39 | wrath_FragColor=wrath_shader_brush_color(); 40 | } 41 | #else 42 | { 43 | wrath_FragColor=vec4(0.5, 0.0, 1.0, 1.0); 44 | } 45 | #endif 46 | } 47 | -------------------------------------------------------------------------------- /demos/examples/counter/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | DEMOS += counter 8 | 9 | counter_SOURCES := $(call filelist, counter.cpp) $(COMMON_DEMO_SOURCES) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /demos/examples/hello_widget_generator/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | DEMOS += hello-widget-generator 8 | 9 | hello-widget-generator_SOURCES := $(call filelist, hello_widget_generator.cpp) $(COMMON_DEMO_SOURCES) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /demos/examples/hello_widget_generator2/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | DEMOS += hello-widget-generator2 8 | 9 | hello-widget-generator2_SOURCES := $(call filelist, hello_widget_generator2.cpp) $(COMMON_DEMO_SOURCES) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /demos/examples/hello_wrathlayer/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | DEMOS += hello-wrathlayer 8 | 9 | hello-wrathlayer_SOURCES := $(call filelist, hello_wrathlayer.cpp) $(COMMON_DEMO_SOURCES) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /demos/examples/item_example/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | dir := $(d)/shaders 9 | include $(dir)/Rules.mk 10 | 11 | DEMOS += item-example 12 | 13 | item-example_SOURCES := $(call filelist, item_example.cpp item.cpp) $(COMMON_DEMO_SOURCES) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /demos/examples/item_example/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | item-example_SHADERS :=$(call filelist, item.frag.glsl item.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer -------------------------------------------------------------------------------- /demos/examples/item_example/shaders/item.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file item.frag.glsl 3 | * \brief file item.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | void 21 | shader_main(void) 22 | { 23 | // the transformation node GLSL code defines 24 | // this function which will issue a discard 25 | // if the node comptues the fragment to be 26 | // discarded, if the node does not define 27 | // any clipping or if the node's clipping is 28 | // determined by another means (for example 29 | // using GL clip planes) then this function 30 | // is a no-op. 31 | discard_if_clipped(); 32 | 33 | //minimalistic fragment shader 34 | wrath_FragColor=vec4(0.5, 0.0, 1.0, 1.0); 35 | } 36 | -------------------------------------------------------------------------------- /demos/examples/item_example/shaders/item.vert.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file item.vert.glsl 3 | * \brief file item.vert.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | //pos meanings: 21 | // .xy: location in UI co-ordinates (2D) 22 | shader_in mediump vec2 pos; 23 | 24 | void 25 | shader_main(void) 26 | { 27 | gl_Position= compute_gl_position_and_apply_clipping( vec3(pos, -1.0) ); 28 | } 29 | -------------------------------------------------------------------------------- /demos/examples/item_example2/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | dir := $(d)/shaders 9 | include $(dir)/Rules.mk 10 | 11 | DEMOS += item-example2 12 | 13 | item-example2_SOURCES := $(call filelist, item_example2.cpp item_packer.cpp item.cpp) $(COMMON_DEMO_SOURCES) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /demos/examples/item_example2/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | item-example2_SHADERS :=$(call filelist, item.frag.glsl item.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer -------------------------------------------------------------------------------- /demos/examples/item_example2/shaders/item.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file item.frag.glsl 3 | * \brief file item.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | void 21 | shader_main(void) 22 | { 23 | // the transformation node GLSL code defines 24 | // this function which will issue a discard 25 | // if the node comptues the fragment to be 26 | // discarded, if the node does not define 27 | // any clipping or if the node's clipping is 28 | // determined by another means (for example 29 | // using GL clip planes) then this function 30 | // is a no-op. 31 | discard_if_clipped(); 32 | 33 | //minimalistic fragment shader 34 | wrath_FragColor=vec4(0.5, 0.0, 1.0, 1.0); 35 | } 36 | -------------------------------------------------------------------------------- /demos/examples/item_example2/shaders/item.vert.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file item.vert.glsl 3 | * \brief file item.vert.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | //pos meanings: 21 | // .xy: location in UI co-ordinates (2D) 22 | shader_in mediump vec2 pos; 23 | 24 | void 25 | shader_main(void) 26 | { 27 | gl_Position= compute_gl_position_and_apply_clipping( vec3(pos, -1.0) ); 28 | } 29 | -------------------------------------------------------------------------------- /demos/examples/rect/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | DEMOS += rect 8 | 9 | rect_SOURCES := $(call filelist, rect.cpp) $(COMMON_DEMO_SOURCES) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /demos/examples/rect2/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | dir := $(d)/shaders 9 | include $(dir)/Rules.mk 10 | 11 | DEMOS += rect2 12 | 13 | rect2_SOURCES := $(call filelist, rect2.cpp) $(COMMON_DEMO_SOURCES) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /demos/examples/rect2/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | rect2_SHADERS :=$(call filelist, wobbly.frag.glsl wobbly.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer -------------------------------------------------------------------------------- /demos/examples/rect3/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | dir := $(d)/shaders 9 | include $(dir)/Rules.mk 10 | 11 | DEMOS += rect3 12 | 13 | rect3_SOURCES := $(call filelist, rect3.cpp rect_attribute_packer.cpp) $(COMMON_DEMO_SOURCES) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /demos/examples/rect3/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | rect3_SHADERS :=$(call filelist, wobbly.frag.glsl wobbly.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer -------------------------------------------------------------------------------- /demos/examples/shape/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | DEMOS += shape 8 | 9 | shape_SOURCES := $(call filelist, shape.cpp) $(COMMON_DEMO_SOURCES) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /demos/examples/text/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | DEMOS += text 8 | 9 | text_SOURCES := $(call filelist, text.cpp) $(COMMON_DEMO_SOURCES) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /demos/examples/wavy-text/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | dir := $(d)/shaders 9 | include $(dir)/Rules.mk 10 | 11 | DEMOS += wavy-text 12 | 13 | wavy-text_SOURCES := $(call filelist, wavy-text.cpp) $(COMMON_DEMO_SOURCES) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /demos/examples/wavy-text/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | wavy-text_SHADERS :=$(call filelist, wobbly.frag.glsl wobbly.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer -------------------------------------------------------------------------------- /demos/examples/wavy_clip2/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/shaders 8 | include $(dir)/Rules.mk 9 | 10 | DEMOS += wavy-clip2 11 | 12 | wavy-clip2_SOURCES := $(call filelist, wavy_clip2.cpp rect_attribute_packer.cpp) $(COMMON_DEMO_SOURCES) 13 | 14 | # Begin standard footer 15 | d := $(dirstack_$(sp)) 16 | sp := $(basename $(sp)) 17 | # End standard footer 18 | -------------------------------------------------------------------------------- /demos/examples/wavy_clip2/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | wavy-clip2_SHADERS :=$(call filelist, wobbly.frag.glsl wobbly.vert.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer -------------------------------------------------------------------------------- /demos/image_demo/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | DEMOS += image-demo 8 | 9 | image-demo_SOURCES := $(call filelist, image_demo.cpp NodePacker.cpp) $(COMMON_DEMO_SOURCES) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /demos/text_viewer/FileType.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file FileType.hpp 3 | * \brief file FileType.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef FILE_TYPES_HPP 21 | #define FILE_TYPES_HPP 22 | 23 | #include "WRATHConfig.hpp" 24 | 25 | namespace FileType 26 | { 27 | enum file_fetch_type 28 | { 29 | load_interpreted, 30 | load_utf8, 31 | load_utf16, 32 | load_raw, 33 | load_raw_utf8, 34 | load_raw_utf16, 35 | load_image, 36 | load_font, 37 | load_font_subrange, 38 | load_directory 39 | }; 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /demos/text_viewer/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | dir := $(d)/shaders 9 | include $(dir)/Rules.mk 10 | 11 | DEMOS += text-viewer 12 | 13 | text-viewer_SOURCES := $(call filelist, NodePacker.cpp FileData.cpp FilePacket.cpp TextChunk.cpp TextViewer.cpp) $(COMMON_DEMO_SOURCES) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /demos/text_viewer/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | text-viewer_SHADERS :=$(call filelist, distance_image.frag.glsl simple_const_color.frag.glsl font_animated.frag.glsl simple.frag.glsl simple_ui_shape.vert.glsl simple_ui_font.vert.glsl simple_ui.vert.glsl simple_ui_line.vert.glsl simple_ui_shape.frag.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /demos/text_viewer/shaders/distance_image.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file distance_image.frag.glsl 3 | * \brief file distance_image.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | uniform mediump sampler2D utex; 21 | shader_in mediump vec2 tex_coord; 22 | shader_in mediump vec4 tex_color; 23 | shader_in mediump float reciprocal_scale_factor; 24 | 25 | uniform mediump float animation_fx_interpol; 26 | void 27 | shader_main(void) 28 | { 29 | mediump float c, alpha; 30 | mediump float vv; 31 | 32 | c=texture2D(utex, tex_coord).a; 33 | vv=0.05*min(1.0, reciprocal_scale_factor); 34 | 35 | alpha=tex_color.a*smoothstep(0.50-vv, 0.50+vv, c); 36 | wrath_FragColor=vec4(tex_color.rgb, alpha*(1.0-2.0*animation_fx_interpol)); 37 | } 38 | -------------------------------------------------------------------------------- /demos/text_viewer/shaders/font_animated.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_animated.frag.glsl 3 | * \brief file font_animated.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | shader_in mediump vec4 tex_color; 21 | 22 | 23 | uniform mediump float animation_fx_interpol; 24 | void 25 | shader_main(void) 26 | { 27 | mediump float d; 28 | 29 | 30 | #ifdef NO_AA 31 | d=wrath_glyph_is_covered()*tex_color.a*(1.0-animation_fx_interpol); 32 | #else 33 | d=wrath_glyph_compute_coverage()*tex_color.a*(1.0-animation_fx_interpol); 34 | #endif 35 | 36 | #if defined(WRATH_IS_OPAQUE_PASS) 37 | //if texel is too translucent, then the opaque pass discards the texel 38 | if(d=float(WRATH_TRANSLUCENT_THRESHOLD)) 42 | d=0.0; 43 | #endif 44 | 45 | wrath_FragColor=vec4(tex_color.xyz*d, d); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /demos/text_viewer/shaders/simple.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file simple.frag.glsl 3 | * \brief file simple.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | shader_in mediump vec2 tex_coord; 21 | shader_in mediump vec4 tex_color; 22 | 23 | uniform mediump sampler2D utex; 24 | uniform mediump float animation_fx_interpol; 25 | void 26 | shader_main(void) 27 | { 28 | mediump vec4 c; 29 | 30 | c=texture2D(utex, tex_coord).rgba; 31 | wrath_FragColor=tex_color.rgba*vec4(c.rgb, c.a*(1.0-2.0*animation_fx_interpol)); 32 | } 33 | -------------------------------------------------------------------------------- /demos/text_viewer/shaders/simple_const_color.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file simple_const_color.frag.glsl 3 | * \brief file simple_const_color.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | shader_in mediump vec4 tex_color; 21 | uniform mediump float animation_fx_interpol; 22 | 23 | void 24 | shader_main(void) 25 | { 26 | wrath_FragColor=vec4(tex_color.rgb, tex_color.a*(1.0-2.0*animation_fx_interpol)); 27 | } 28 | -------------------------------------------------------------------------------- /demos/text_viewer/shaders/simple_ui_line.vert.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file simple_ui_line.vert.glsl 3 | * \brief file simple_ui_line.vert.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | shader_in mediump vec3 pos; 21 | shader_in mediump vec4 color; 22 | 23 | 24 | shader_out mediump vec4 tex_color; 25 | shader_out mediump float reciprocal_scale_factor; 26 | 27 | 28 | uniform mediump float animation_fx_interpol; 29 | uniform mediump mat2 animation_matrix; 30 | 31 | void 32 | shader_main(void) 33 | { 34 | highp vec4 clip_pos; 35 | highp vec2 rotated_pos; 36 | 37 | tex_color=color; 38 | 39 | rotated_pos=animation_matrix*pos.xy; 40 | 41 | clip_pos=compute_gl_position_and_apply_clipping(vec3(rotated_pos, pos.z)); 42 | 43 | gl_Position=vec4(clip_pos.xy, 44 | (1.0-animation_fx_interpol)*clip_pos.zw); 45 | } 46 | -------------------------------------------------------------------------------- /demos/text_viewer/shaders/simple_ui_shape.frag.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file simple_ui_shape.frag.glsl 3 | * \brief file simple_ui_shape.frag.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifdef AA_HINT 21 | shader_in mediump float aa_hint; 22 | #endif 23 | 24 | 25 | 26 | shader_in mediump vec4 tex_color; 27 | 28 | 29 | 30 | void 31 | shader_main(void) 32 | { 33 | 34 | mediump vec4 color; 35 | 36 | #ifdef WRATH_NON_LINEAR_GRADIENT 37 | mediump vec2 tex_coord; 38 | #endif 39 | 40 | //#ifdef CLIPPING_USES_DISCARD 41 | discard_if_clipped(); 42 | //#endif 43 | 44 | color=tex_color; 45 | 46 | 47 | 48 | 49 | #if defined(AA_HINT) && defined(WRATH_DERIVATIVES_SUPPORTED) 50 | { 51 | mediump float alpha, abs_aa, dd; 52 | abs_aa=1.0 - abs(aa_hint); 53 | dd=fwidth(abs_aa); 54 | alpha=color.w*min(1.0, abs_aa/dd); 55 | 56 | 57 | #if defined(WRATH_IS_OPAQUE_PASS) 58 | if(alpha=float(WRATH_TRANSLUCENT_THRESHOLD)) 62 | alpha=0.0; 63 | #endif 64 | 65 | wrath_FragColor=vec4(color.xyz*alpha, alpha); 66 | } 67 | #else 68 | 69 | wrath_FragColor=vec4(color.xyz, 1.0)*color.w; 70 | 71 | #endif 72 | } 73 | -------------------------------------------------------------------------------- /demos/text_viewer/shaders/simple_ui_shape.vert.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file simple_ui_shape.vert.glsl 3 | * \brief file simple_ui_shape.vert.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | //pos meanings: 22 | // .xy: location in UI co-ordinates (2D) 23 | shader_in mediump vec2 pos; 24 | 25 | uniform mediump float animation_fx_interpol; 26 | uniform mediump mat2 animation_matrix; 27 | 28 | 29 | #ifdef AA_HINT 30 | shader_in mediump float in_aa_hint; 31 | shader_out mediump float aa_hint; 32 | #endif 33 | 34 | 35 | 36 | shader_out mediump vec4 tex_color; 37 | 38 | 39 | void 40 | shader_main(void) 41 | { 42 | 43 | tex_color=vec4(fetch_node_value(color_red), 44 | fetch_node_value(color_green), 45 | fetch_node_value(color_blue), 46 | fetch_node_value(color_alpha)); 47 | tex_color*=(1.0-2.0*animation_fx_interpol); 48 | 49 | #ifdef AA_HINT 50 | { 51 | aa_hint=in_aa_hint; 52 | } 53 | #endif 54 | 55 | mediump vec2 tpos; 56 | mediump vec4 clip_pos; 57 | 58 | tpos=animation_matrix*pos.xy; 59 | clip_pos=compute_gl_position_and_apply_clipping(vec3(tpos, -1.0)); 60 | 61 | gl_Position=vec4(clip_pos.xy, 62 | (1.0-animation_fx_interpol)*clip_pos.zw); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | #make sure we are using bash 2 | SHELL=/bin/bash 3 | #docs 4 | docs: examples 5 | doxygen Doxyfile 6 | 7 | #generate examples related documentation 8 | examples: 9 | ./generate_example_docs.sh ../demos/examples/ documentation/WRATH/ screenshots/ 10 | 11 | clean: 12 | -rm -r doxy/html 13 | -rm doxy/*.tmp 14 | 15 | .PHONY: examples 16 | -------------------------------------------------------------------------------- /docs/doxy/.gitignore: -------------------------------------------------------------------------------- 1 | html 2 | *.tmp 3 | -------------------------------------------------------------------------------- /docs/doxy/readme.txt: -------------------------------------------------------------------------------- 1 | Doxy generate docs go here under html 2 | -------------------------------------------------------------------------------- /docs/failed_experiments/distance_texture_edge_sharpening/distance_types_per_channel/data.txt: -------------------------------------------------------------------------------- 1 | Another approach as follows was tried: 2 | 3 | For each texel we store independently: 4 | channel 0: 5 | a) signed dsitance to the closest test point (i.e. end points of Bezier curves and points where a curve is at a 45 degree angle) 6 | 7 | b) the usual value, i.e. the min-L1 signed distance value 8 | 9 | channel 1: the smallest signed distance value to a point with the same x coordinate 10 | channel 2: the smallest signed distance value to a point with the same y coordinate 11 | 12 | Results for using a) for Channel 0: 13 | if(raw.x<0.5 || (raw.y<0.5 && raw.z<0.5)) discard; : horrible render results 14 | if(raw.x<0.5 || (raw.y<0.5 || raw.z<0.5)) discard; : horrible render results 15 | if(raw.x<0.5 && (raw.y<0.5 && raw.z<0.5)) discard; : horrible render results 16 | 17 | Results for using b) for Channel 0: 18 | if(raw.x<0.5 && (raw.y<0.5 && raw.z<0.5)) discard; : slightly inferior to usual way render results 19 | if(raw.x<0.5 || (raw.y<0.5 && raw.z<0.5)) discard; : very similart to usual, several glyphs inferior 20 | if(raw.x<0.5 || (raw.y<0.5 || raw.z<0.5)) discard; : some glyphs don't look so good, corners not sharpened anyways 21 | -------------------------------------------------------------------------------- /docs/readme.txt: -------------------------------------------------------------------------------- 1 | Quick Readme for WRATH docs. 2 | ------------------------------- 3 | 4 | 5 | Developer WRATH docs 6 | --------------------------- 7 | To get started with WRATH, read the documentation: 8 | 9 | make docs 10 | you-favorite-browser docs/doxy/htm/index.html 11 | 12 | WRATH Documentation includes a series of code examples 13 | whose source is listed and browsable along the rest of 14 | documentation. This example documentation is autogenerated 15 | by the script located at docs/generate_examples_docs.sh 16 | You don't need to call the script manually, it is 17 | called automatically every time you "make docs". 18 | 19 | If you want to call it directly with custom parameters 20 | please check the instructions in the script file. 21 | 22 | -------------------------------------------------------------------------------- /docs/screenshots/augmented_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/augmented_node.png -------------------------------------------------------------------------------- /docs/screenshots/augmented_node2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/augmented_node2.png -------------------------------------------------------------------------------- /docs/screenshots/brush_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/brush_example.png -------------------------------------------------------------------------------- /docs/screenshots/clip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/clip.png -------------------------------------------------------------------------------- /docs/screenshots/clip2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/clip2.png -------------------------------------------------------------------------------- /docs/screenshots/hello_widget_generator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/hello_widget_generator.png -------------------------------------------------------------------------------- /docs/screenshots/hello_widget_generator2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/hello_widget_generator2.png -------------------------------------------------------------------------------- /docs/screenshots/hello_wrathlayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/hello_wrathlayer.png -------------------------------------------------------------------------------- /docs/screenshots/item_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/item_example.png -------------------------------------------------------------------------------- /docs/screenshots/item_example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/item_example2.png -------------------------------------------------------------------------------- /docs/screenshots/noimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/noimage.png -------------------------------------------------------------------------------- /docs/screenshots/rect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/rect.png -------------------------------------------------------------------------------- /docs/screenshots/rect2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/rect2.png -------------------------------------------------------------------------------- /docs/screenshots/rect3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/rect3.png -------------------------------------------------------------------------------- /docs/screenshots/shape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/shape.png -------------------------------------------------------------------------------- /docs/screenshots/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/text.png -------------------------------------------------------------------------------- /docs/screenshots/traditional_renderer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/traditional_renderer.png -------------------------------------------------------------------------------- /docs/screenshots/wavy_clip2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/wavy_clip2.png -------------------------------------------------------------------------------- /docs/screenshots/wrath_renderer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/docs/screenshots/wrath_renderer.png -------------------------------------------------------------------------------- /images/1024x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/1024x1024.png -------------------------------------------------------------------------------- /images/512.512.color.diagnol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/512.512.color.diagnol.png -------------------------------------------------------------------------------- /images/512.512.diagonal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/512.512.diagonal.png -------------------------------------------------------------------------------- /images/512.512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/512.512.png -------------------------------------------------------------------------------- /images/eye.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/eye.jpg -------------------------------------------------------------------------------- /images/hands.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/hands.jpg -------------------------------------------------------------------------------- /images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/image.png -------------------------------------------------------------------------------- /images/image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/image1.jpg -------------------------------------------------------------------------------- /images/image_cp1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/image_cp1.png -------------------------------------------------------------------------------- /images/image_cp2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/image_cp2.png -------------------------------------------------------------------------------- /images/image_cp3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/image_cp3.png -------------------------------------------------------------------------------- /images/image_cp4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/image_cp4.png -------------------------------------------------------------------------------- /images/image_cp5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/image_cp5.png -------------------------------------------------------------------------------- /images/image_cp6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/image_cp6.png -------------------------------------------------------------------------------- /images/license.txt: -------------------------------------------------------------------------------- 1 | The picture files in images/ 2 | (ugly programmer art meet ugly programmy photography) 3 | are copyrighted: 4 | 5 | Copyright of Nomovok Ltd. All rights reserved. 6 | Contact: info@nomovok.com 7 | author Kevin Rogovin 8 | 9 | License: MPLv2 (see COPYING) 10 | -------------------------------------------------------------------------------- /images/light5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/light5.jpg -------------------------------------------------------------------------------- /images/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomovok-opensource/wrath/3a8d8ee92f845ed96e95b3736a2a9deef4ac5e4c/images/white.png -------------------------------------------------------------------------------- /inc/3rd_party/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/ieeehalfprecision 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/wrath-glu-tess 11 | include $(dir)/Rules.mk 12 | 13 | # dir := $(d)/glu-tess 14 | # include $(dir)/Rules.mk 15 | 16 | # Begin standard footer 17 | d := $(dirstack_$(sp)) 18 | sp := $(basename $(sp)) 19 | # End standard footer 20 | -------------------------------------------------------------------------------- /inc/3rd_party/ieeehalfprecision/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/3rd_party/ieeehalfprecision/ieeehalfprecision.h: -------------------------------------------------------------------------------- 1 | #ifndef IEEE_HALF_PRECISION_CONVERSION_UTIL_HPP_ 2 | #define IEEE_HALF_PRECISION_CONVERSION_UTIL_HPP_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | /*!\fn singles2halfp 10 | Converts from 32bit-floats to 16bit-floats. 11 | [routine from James Tursa, BSD License, 12 | see ieeehalfprecision.c for details]. 13 | \param target destination to which to write 16bit-floats 14 | \param source source from which to read 32bit-floats 15 | \param numel number of conversions to perform, i.e. 16 | source points to numel floats 17 | and target points to 2*numel bytes. 18 | */ 19 | void singles2halfp(uint16_t *target, const uint32_t *source, int numel); 20 | 21 | 22 | /*!\fn halfp2singles 23 | Converts from 16bit-floats to 32bit-floats. 24 | [routine from James Tursa, BSD License, 25 | see ieeehalfprecision.c for details]. 26 | \param target destination to which to write 32bit-floats 27 | \param source source from which to read 16bit-floats 28 | \param numel number of conversions to perform, i.e. 29 | source points to 2*numel bytes 30 | and target points to numem floats. 31 | */ 32 | void halfp2singles(uint32_t *target, const uint16_t *source, int numel); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /inc/3rd_party/wrath-glu-tess/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/FURY/Qt/FURYQTKeyCode.values.tcc: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /*! 4 | * \file FURYQTKeyCode.values.tcc 5 | * \brief file FURYQTKeyCode.values.tcc 6 | * 7 | * Copyright 2013 by Nomovok Ltd. 8 | * 9 | * Contact: info@nomovok.com 10 | * 11 | * This Source Code Form is subject to the 12 | * terms of the Mozilla Public License, v. 2.0. 13 | * If a copy of the MPL was not distributed with 14 | * this file, You can obtain one at 15 | * http://mozilla.org/MPL/2.0/. 16 | * 17 | * \author Kevin Rogovin 18 | * 19 | */ 20 | 21 | 22 | /* 23 | I am going to be flamed by someone eventually. 24 | Rather than manning up and making something 25 | that coverts from Qt keycodes to FURY keycodes 26 | I will simply copy-paste from the Qt header values. 27 | */ 28 | 29 | #if !defined(FURY_QT_EVENT_HPP_) || defined(FURY_QT_EVENT_CODE_VALUES_TCC_) 30 | #error "Direction inclusion of private header file FURYQTKeyCodes.values.tcc" 31 | #endif 32 | 33 | #define FURY_QT_EVENT_CODE_VALUES_TCC_ 34 | #define FURY_QT_KEYCODE(X) FURYKey_##X 35 | 36 | /* 37 | FURYQTKeyCodeMadness files are sed/gcc genarated files. 38 | */ 39 | #if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) 40 | #include "FURYQTKeyCodeMadnessQt3defined.tcc" 41 | #else 42 | #include "FURYQTKeyCodeMadnessQt3Notdefined.tcc" 43 | #endif 44 | 45 | /* 46 | Special tactics: Also define FURYKey_Pageup and FURYKey_Pagedown 47 | as aliases for FURYKey_PageUp and FURYKey_PageDown, respectively 48 | */ 49 | 50 | FURY_QT_KEYCODE(Pageup)=Qt::Key_PageUp, 51 | FURY_QT_KEYCODE(Pagedown)=Qt::Key_PageDown, 52 | 53 | 54 | #undef FURY_QT_KEYCODE 55 | -------------------------------------------------------------------------------- /inc/FURY/Qt/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/FURY/Qt/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | FURYQTKeyCodeMadnessQt3defined.tcc generated via: 3 | 4 | gcc -E -I /usr/local/Trolltech/Qt-4.8.0/include/ -DQT3_SUPPORT=1 /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qnamespace.h | grep Key_ | sed 's/Key_\([^= ]*\)[\t ]*=.*/FURY_QT_KEYCODE(\1)=Qt::Key_\1,/g' 5 | 6 | FURYQTKeyCodeMadnessQt3Notdefined.tcc generated via: 7 | 8 | gcc -E -I /usr/local/Trolltech/Qt-4.8.0/include/ /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qnamespace.h | grep Key_ | sed 's/Key_\([^= ]*\)[\t ]*=.*/FURY_QT_KEYCODE(\1)=Qt::Key_\1,/g' 9 | 10 | 11 | command generated by Petri Latvala less than 3 minute wizardry 12 | -------------------------------------------------------------------------------- /inc/FURY/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/event 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/Qt 11 | include $(dir)/Rules.mk 12 | 13 | dir := $(d)/SDL 14 | include $(dir)/Rules.mk 15 | 16 | # Begin standard footer 17 | d := $(dirstack_$(sp)) 18 | sp := $(basename $(sp)) 19 | # End standard footer 20 | -------------------------------------------------------------------------------- /inc/FURY/SDL/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/FURY/SDL/readme.txt: -------------------------------------------------------------------------------- 1 | FURYSDLKeyCode.values.tcc is machine generated with: 2 | 3 | grep SDLK /usr/include/SDL2/SDL_keycode.h | sed 's/=/\n/g' | grep -v SDL_SCANCODE | grep SDLK | sed 's/SDLK_\(.*\)/FURYKey_\1 = SDLK_\1,/' | sed 's/=/=\n/g' | sed 's/FURYKey_\(.\)\(.*\)/\nFURYKey_\U\1\L\2/' > FURYSDLKeyCode.values.tcc 4 | 5 | 6 | 7 | and then a little editing to remove extra ickyies. 8 | -------------------------------------------------------------------------------- /inc/FURY/event/FURYResizeEvent.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file FURYResizeEvent.hpp 3 | * \brief file FURYResizeEvent.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef FURY_RESIZE_EVENT_HPP_ 21 | #define FURY_RESIZE_EVENT_HPP_ 22 | 23 | #include "WRATHConfig.hpp" 24 | #include "FURYEvent.hpp" 25 | 26 | class FURYResizeEvent: 27 | public FURYEventT 28 | { 29 | public: 30 | FURYResizeEvent(const ivec2 &pold_size, 31 | const ivec2 &pnew_size): 32 | FURYEventT(Resize), 33 | m_old_size(pold_size), 34 | m_new_size(pnew_size) 35 | {} 36 | 37 | const ivec2& 38 | new_size(void) const 39 | { 40 | return m_new_size; 41 | } 42 | 43 | const ivec2& 44 | old_size(void) const 45 | { 46 | return m_old_size; 47 | } 48 | 49 | 50 | virtual 51 | void 52 | log_event(std::ostream &ostr) const 53 | { 54 | ostr << "ResizeEvent[old_size=" 55 | << m_old_size << ", new_size=" 56 | << m_new_size << "]"; 57 | } 58 | 59 | private: 60 | ivec2 m_old_size, m_new_size; 61 | }; 62 | 63 | 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /inc/FURY/event/FURYTextEvent.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file FURYTextEvent.hpp 3 | * \brief file FURYTextEvent.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef FURY_TEXT_EVENT_HPP_ 21 | #define FURY_TEXT_EVENT_HPP_ 22 | 23 | 24 | #include "WRATHConfig.hpp" 25 | #include 26 | 27 | class FURYTextEvent: 28 | public FURYEventT 29 | { 30 | public: 31 | 32 | explicit 33 | FURYTextEvent(std::vector &pvalues): 34 | FURYEventT(FURYEvent::Text) 35 | { 36 | std::swap(m_value, pvalues); 37 | } 38 | 39 | const std::vector& 40 | values(void) const 41 | { 42 | return m_value; 43 | } 44 | 45 | private: 46 | std::vector m_value; 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /inc/FURY/event/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/3rd_party 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/FURY 11 | include $(dir)/Rules.mk 12 | 13 | dir := $(d)/WRATH 14 | include $(dir)/Rules.mk 15 | 16 | # Begin standard footer 17 | d := $(dirstack_$(sp)) 18 | sp := $(basename $(sp)) 19 | # End standard footer 20 | -------------------------------------------------------------------------------- /inc/WRATH/Qt/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/shape 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/items 11 | include $(dir)/Rules.mk 12 | 13 | dir := $(d)/image 14 | include $(dir)/Rules.mk 15 | 16 | dir := $(d)/util 17 | include $(dir)/Rules.mk 18 | 19 | dir := $(d)/text 20 | include $(dir)/Rules.mk 21 | 22 | dir := $(d)/SDL 23 | include $(dir)/Rules.mk 24 | 25 | dir := $(d)/gl 26 | include $(dir)/Rules.mk 27 | 28 | dir := $(d)/layer 29 | include $(dir)/Rules.mk 30 | 31 | dir := $(d)/drawgroup 32 | include $(dir)/Rules.mk 33 | 34 | dir := $(d)/Qt 35 | include $(dir)/Rules.mk 36 | 37 | dir := $(d)/widgets 38 | include $(dir)/Rules.mk 39 | 40 | INCLUDES += -I$(d) 41 | 42 | # Begin standard footer 43 | d := $(dirstack_$(sp)) 44 | sp := $(basename $(sp)) 45 | # End standard footer 46 | -------------------------------------------------------------------------------- /inc/WRATH/SDL/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/SDL/ngl_backend_sdl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef WRATH_NGL_BACKEND_SDL_HPP_ 2 | #define WRATH_NGL_BACKEND_SDL_HPP_ 3 | 4 | #include "WRATHConfig.hpp" 5 | #include 6 | 7 | /*!\fn ngl_set_GL_librarySDL 8 | For the implementation of ngl_loadFunction 9 | backed by SDL: set the name of the GL library 10 | to use. The default for GL is libGL.so 11 | and the default value for GLES is libGLESv2.so. 12 | Fucntion may not be called once any GL function 13 | is called. 14 | 15 | \param pname name of library from which to fetch GL/GLES function 16 | */ 17 | void 18 | ngl_set_GL_librarySDL(const std::string &pname); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /inc/WRATH/drawgroup/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/gl/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/gl/WRATHgl.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHgl.hpp 3 | * \brief file WRATHgl.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef WRATH_HEADER_GL_HPP_ 21 | #define WRATH_HEADER_GL_HPP_ 22 | 23 | #include "WRATHConfig.hpp" 24 | 25 | #ifdef WRATH_GL_VERSION 26 | #include 27 | #define WRATH_GL_GLES_VERSION WRATH_GL_VERSION 28 | #elif defined(WRATH_GLES_VERSION) 29 | #if WRATH_GLES_VERSION==3 30 | #include 31 | #elif WRATH_GLES_VERSION==2 32 | #include 33 | #endif 34 | 35 | #define WRATH_GL_GLES_VERSION WRATH_GLES_VERSION 36 | #else 37 | #error Neither WRATH_GL_VERSION nor WRATH_GLES_VERSION defined 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /inc/WRATH/gl/WRATHglShaderBits.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHglShaderBits.hpp 3 | * \brief file WRATHglShaderBits.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef WRATH_HEADER_GL_SHADER_BITS_HPP_ 21 | #define WRATH_HEADER_GL_SHADER_BITS_HPP_ 22 | 23 | #include "WRATHConfig.hpp" 24 | #include "WRATHgl.hpp" 25 | 26 | /* 27 | Depending on the version of GL and it's headers, 28 | the shader_bit values (usually defined by GL's 29 | separate shader object interface) may or maynot 30 | be defined. WRATH uses these values, so go ahead 31 | and define them as necessary. 32 | */ 33 | 34 | #ifndef GL_VERTEX_SHADER_BIT 35 | #define GL_VERTEX_SHADER_BIT 0x00000001 36 | #endif 37 | 38 | #ifndef GL_FRAGMENT_SHADER_BIT 39 | #define GL_FRAGMENT_SHADER_BIT 0x00000002 40 | #endif 41 | 42 | #ifndef GL_GEOMETRY_SHADER_BIT 43 | #define GL_GEOMETRY_SHADER_BIT 0x00000004 44 | #endif 45 | 46 | #ifndef GL_TESS_CONTROL_SHADER_BIT 47 | #define GL_TESS_CONTROL_SHADER_BIT 0x00000008 48 | #endif 49 | 50 | #ifndef GL_TESS_EVALUATION_SHADER_BIT 51 | #define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 52 | #endif 53 | 54 | #ifndef GL_ALL_SHADER_BITS 55 | #define GL_ALL_SHADER_BITS 0xFFFFFFFF 56 | #endif 57 | 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /inc/WRATH/gl/kernel.doxy: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file kernel.doxy 3 | * \brief file kernel.doxy 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | /*! \addtogroup Kernel 22 | Kernel is a very small and low level module in WRATH. 23 | Its main purpose is to specify draw commands and to 24 | send those commands to GL. Specification of draw commands 25 | is embodied by \ref WRATHDrawCallSpec. A draw command 26 | is an actual object embodied by \ref WRATHRawDrawDataElement. 27 | Lastly the objects are inserted into a \ref WRATHRawDrawData 28 | object that stores the draw commands ordered to reduce 29 | GL state changes and so forth. To force a draw command to 30 | come before or after, there is \ref WRATHDrawOrder 31 | (see also WRATHDrawCallSpec::m_force_drawer_order) 32 | and their sorting \ref WRATHDrawOrderComparer 33 | (see \ref WRATHRawDrawData::draw_order_sorter(const WRATHDrawOrderComparer::const_handle &) 34 | 35 | */ 36 | 37 | 38 | #error "Include of " __FILE__ " which is a documentation files" -------------------------------------------------------------------------------- /inc/WRATH/image/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/items/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/items/WRATHEmptyItem.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHEmptyItem.hpp 3 | * \brief file WRATHEmptyItem.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | 22 | #ifndef WRATH_HEADER_EMPTY_ITEM_HPP_ 23 | #define WRATH_HEADER_EMPTY_ITEM_HPP_ 24 | 25 | #include "WRATHConfig.hpp" 26 | #include "WRATHCanvas.hpp" 27 | 28 | 29 | /*! \addtogroup Items 30 | * @{ 31 | */ 32 | 33 | /*!\class WRATHEmptyItem 34 | A WRATHEmptyItem represents an empty item; 35 | used as an item type for those widgets 36 | that only represent transformation and/or 37 | clipping information. 38 | */ 39 | class WRATHEmptyItem:public WRATHBaseItem 40 | { 41 | public: 42 | /*!\fn WRATHEmptyItem 43 | Ctor. 44 | \param p WRATHCanvas that the item is viewed as a part 45 | */ 46 | explicit 47 | WRATHEmptyItem(WRATHCanvas *p): 48 | m_canvas(p) 49 | {} 50 | 51 | virtual 52 | ~WRATHEmptyItem() 53 | {} 54 | 55 | virtual 56 | WRATHCanvas* 57 | canvas_base(void) const 58 | { 59 | return m_canvas; 60 | } 61 | 62 | virtual 63 | void 64 | canvas_base(WRATHCanvas *p) 65 | { 66 | m_canvas=p; 67 | } 68 | 69 | private: 70 | WRATHCanvas *m_canvas; 71 | }; 72 | 73 | 74 | /*! @} */ 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /inc/WRATH/layer/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/node 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/node_packers 11 | include $(dir)/Rules.mk 12 | 13 | INCLUDES += -I$(d) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /inc/WRATH/layer/node/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/translate 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/rotate_translate 11 | include $(dir)/Rules.mk 12 | 13 | INCLUDES += -I$(d) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /inc/WRATH/layer/node/rotate_translate/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/layer/node/rotate_translate/WRATHLayerItemWidgetsRotateTranslate.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHLayerItemWidgetsRotateTranslate.hpp 3 | * \brief file WRATHLayerItemWidgetsRotateTranslate.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef WRATH_HEADER_LAYER_ITEM_ROTATE_TRANSLATE_WIDGET_HPP_ 21 | #define WRATH_HEADER_LAYER_ITEM_ROTATE_TRANSLATE_WIDGET_HPP_ 22 | 23 | #include "WRATHWidget.hpp" 24 | #include "WRATHWidgetGenerator.hpp" 25 | #include "WRATHLayer.hpp" 26 | #include "WRATHLayerItemNodeRotateTranslate.hpp" 27 | #include "WRATHLayerItemWidgets.hpp" 28 | #include "WRATHLayerItemDrawerFactory.hpp" 29 | 30 | 31 | 32 | 33 | /*! \addtogroup Layer 34 | * @{ 35 | */ 36 | 37 | 38 | /*!\typedef WRATHLayerRotateTranslateWidgetGenerator 39 | Conveniance typedef using 40 | - \ref WRATHLayerItemNodeRotateTranslate for base node type 41 | */ 42 | typedef WRATHLayerItemWidget::Generator WRATHLayerRotateTranslateWidgetGenerator; 43 | 44 | 45 | /*!\typedef WRATHLayerRotateTranslateFamilySet 46 | Conveniance typedef using 47 | - \ref WRATHLayerItemNodeRotateTranslate for base node type 48 | */ 49 | typedef WRATHLayerItemWidget::FamilySet WRATHLayerRotateTranslateFamilySet; 50 | 51 | /*! @} */ 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /inc/WRATH/layer/node/translate/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/layer/node/translate/WRATHLayerItemWidgetsTranslate.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHLayerItemWidgetsTranslate.hpp 3 | * \brief file WRATHLayerItemWidgetsTranslate.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef WRATH_HEADER_LAYER_ITEM_TRANSLATE_WIDGET_HPP_ 21 | #define WRATH_HEADER_LAYER_ITEM_TRANSLATE_WIDGET_HPP_ 22 | 23 | #include "WRATHWidget.hpp" 24 | #include "WRATHWidgetGenerator.hpp" 25 | #include "WRATHLayer.hpp" 26 | #include "WRATHLayerItemWidgets.hpp" 27 | #include "WRATHLayerItemDrawerFactory.hpp" 28 | #include "WRATHLayerItemNodeTranslate.hpp" 29 | #include "WRATHLayerItemNodeLinearGradient.hpp" 30 | #include "WRATHLayerItemNodeColorValue.hpp" 31 | 32 | 33 | 34 | /*! \addtogroup Layer 35 | * @{ 36 | */ 37 | 38 | 39 | 40 | /*!\typedef WRATHLayerTranslateWidgetGenerator 41 | Conveniance typedef using 42 | - \ref WRATHLayerItemNodeTranslate for base node type 43 | */ 44 | typedef WRATHLayerItemWidget::Generator WRATHLayerTranslateWidgetGenerator; 45 | 46 | /*!\typedef WRATHLayerTranslateFamilySet 47 | Conveniance typedef using 48 | - \ref WRATHLayerItemNodeTranslate for base node type 49 | */ 50 | typedef WRATHLayerItemWidget::FamilySet WRATHLayerTranslateFamilySet; 51 | 52 | 53 | 54 | /*! @} */ 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /inc/WRATH/layer/node_packers/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/shape/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/shape/WRATHTessGLUPrivate.tcc: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | 3 | /*! 4 | * \file WRATHTessGLUPrivate.tcc 5 | * \brief file WRATHTessGLUPrivate.tcc 6 | * 7 | * Copyright 2013 by Nomovok Ltd. 8 | * 9 | * Contact: info@nomovok.com 10 | * 11 | * This Source Code Form is subject to the 12 | * terms of the Mozilla Public License, v. 2.0. 13 | * If a copy of the MPL was not distributed with 14 | * this file, You can obtain one at 15 | * http://mozilla.org/MPL/2.0/. 16 | * 17 | * \author Kevin Rogovin 18 | * 19 | */ 20 | 21 | 22 | 23 | #if !defined(WRATH_HEADER_TESS_GLU_HPP_) || defined(WRATH_HEADER_TESS_GLU_PRIVATE_TCC_) 24 | #error "Direction inclusion of private header file WRATHTessGLUPrivate.tcc" 25 | #endif 26 | 27 | 28 | #define WRATH_HEADER_TESS_GLU_PRIVATE_TCC_ 29 | 30 | class WRATHTessGLU; 31 | 32 | namespace WRATHTessGLUPrivate 33 | { 34 | class polygon_element 35 | { 36 | public: 37 | polygon_element(WRATHTessGLU *t, void *p): 38 | m_tess(t), m_polygon(p) 39 | {} 40 | 41 | WRATHTessGLU *m_tess; 42 | void *m_polygon; 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /inc/WRATH/text/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/util/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /inc/WRATH/util/WRATHBBoxForwardDeclare.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHBBoxForwardDeclare.hpp 3 | * \brief file WRATHBBoxForwardDeclare.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | 22 | #ifndef WRATH_HEADER_BBOX_FORWARD_DECLARE_HPP_ 23 | #define WRATH_HEADER_BBOX_FORWARD_DECLARE_HPP_ 24 | 25 | template 26 | class WRATHBBox; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /inc/WRATH/util/WRATHStaticInit.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHStaticInit.hpp 3 | * \brief file WRATHStaticInit.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | 22 | #ifndef WRATH_HEADER_STATIC_INIT_HPP_ 23 | #define WRATH_HEADER_STATIC_INIT_HPP_ 24 | 25 | #include "WRATHConfig.hpp" 26 | 27 | 28 | /*! \addtogroup Utility 29 | * @{ 30 | */ 31 | 32 | /*!\fn void WRATHStaticInit 33 | If a function has static local variables, call WRATHStaticInit() 34 | _before_ the declaration of those static local variables. 35 | This is needed so that various book keeping data structures 36 | will go out of scope _AFTER_ those static local variables. 37 | */ 38 | void 39 | WRATHStaticInit(void); 40 | 41 | 42 | /*! @} */ 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /inc/WRATH/util/WRATHatomic.hpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHatomic.hpp 3 | * \brief file WRATHatomic.hpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #ifndef WRATH_HEADER_ATOMIC_HPP_ 21 | #define WRATH_HEADER_ATOMIC_HPP_ 22 | 23 | #include "WRATHConfig.hpp" 24 | 25 | 26 | /*! \addtogroup Utility 27 | * @{ 28 | */ 29 | 30 | /*!\def WRATHAtomicAddAndFetch 31 | Atomic add. Atmic version of 32 | \code 33 | X+=Y; 34 | return X; 35 | \endcode 36 | \param X value to affect 37 | \param Y how much to add to X 38 | */ 39 | 40 | /*!\def WRATHAtomicSubtractAndFetch 41 | Atomic subtract. Atmic version of 42 | \code 43 | X-=Y; 44 | return X; 45 | \endcode 46 | \param X value to affect 47 | \param Y how much to add to X 48 | */ 49 | 50 | #if __GNUC__>4 || (__GNUC__>=4 && __GNUC_MINOR__>=7) 51 | #define WRATHAtomicAddAndFetch(X, Y) __atomic_add_fetch((X), (Y), __ATOMIC_SEQ_CST) 52 | #define WRATHAtomicSubtractAndFetch(X, Y) __atomic_sub_fetch((X), (Y), __ATOMIC_SEQ_CST) 53 | #else 54 | #define WRATHAtomicAddAndFetch(X, Y) __sync_add_and_fetch((X), (Y)) 55 | #define WRATHAtomicSubtractAndFetch(X, Y) __sync_sub_and_fetch((X), (Y)) 56 | #endif 57 | 58 | 59 | /*! @} */ 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /inc/WRATH/widgets/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /makedepend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script generates dependency makefiles in the way WRATH wants them 4 | # Probably reusable in other projects as well, but not tested separately 5 | # See main Makefile for invocation examples 6 | 7 | CXX="$1" 8 | CPPFLAGS="$2" 9 | BASEDIR="$3" 10 | INPUTSTEM="$4" 11 | INPUTFILE="$5" 12 | OUTPUTFILE="$6" 13 | 14 | INPUTDIR="$(dirname $INPUTSTEM)" 15 | INPUTBASE="$(basename $INPUTSTEM)" 16 | 17 | # Generate the deps with the preprocessor 18 | # Edit the output with sed to convert 19 | # foo.o: foo.cpp foo.h 20 | # into 21 | # foo.o foo.d : foo.cpp foo.h 22 | # 23 | # With the flag -MP we also generate stub rules for the prerequisites, like so: 24 | # 25 | # foo.h: 26 | # 27 | # An empty rule with no commands or prerequisites of its own makes make continue if 28 | # the file doesn't exist and cannot be made. This makes builds still work if old deps 29 | # file exists and header files are removed. 30 | 31 | "$CXX" -MM -MP $CPPFLAGS "$INPUTFILE" 2>/dev/null | sed "s@\($INPUTBASE\)\.o[ :]*@$BASEDIR/$INPUTDIR/\1.o $OUTPUTFILE : @g" > "$OUTPUTFILE" 32 | 33 | # If the file didn't get generated, exit with an error status 34 | if [ ! -s "$OUTPUTFILE" ]; then 35 | rm -f "$OUTPUTFILE" 36 | exit 1 37 | fi 38 | -------------------------------------------------------------------------------- /ngl/.gitignore: -------------------------------------------------------------------------------- 1 | ngl_gles2detailed_output.txt 2 | ngl_gles2function_list_output.txt 3 | ngl_gles3detailed_output.txt 4 | ngl_gles3function_list_output.txt 5 | ngl_gldetailed_output.txt 6 | ngl_glfunction_list_output.txt 7 | ngl_gl.cpp 8 | ngl_gl.hpp 9 | ngl_gles2.cpp 10 | ngl_gles2.hpp 11 | ngl_gles3.cpp 12 | ngl_gles3.hpp 13 | 14 | -------------------------------------------------------------------------------- /ngl/readme.txt: -------------------------------------------------------------------------------- 1 | ngl_gl.[ch]pp and ngl_gles2.[ch]pp are machine generated files. 2 | The build process automatically generates them. The files are generated 3 | by filtering and scanning the GL/GLES2 header files. 4 | 5 | Comment: the GLES2 header files define a number of functions 6 | with different argument types which are compatible in terms 7 | of pushing values om the stack (namely GLint vs GLenum, etc), 8 | but have incompatible function pointer types. If ngl_gles2.cpp 9 | (or for that matter for builds using desktop GL ngl_gl.cpp) 10 | fails to compile, issue make clean and make in the main project directory 11 | to regenerate the files. 12 | -------------------------------------------------------------------------------- /ngl_generator/.gitignore: -------------------------------------------------------------------------------- 1 | extractor 2 | filter 3 | gl_flex.cpp 4 | *.o 5 | -------------------------------------------------------------------------------- /ngl_generator/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | NGL_FILTER := $(call filelist, filter) 8 | NGL_EXTRACTOR := $(call filelist, extractor) 9 | 10 | NGL_EXTRACTOR_LDFLAGS := 11 | NGL_LL := flex 12 | 13 | $(NGL_FILTER): $(call filelist, filter.cpp) 14 | $(CXX) -o $@ $^ 15 | 16 | $(NGL_EXTRACTOR): $(call filelist, gl_flex.o HeaderCreator.o) 17 | $(CXX) -o $@ $^ $(NGL_EXTRACTOR_LDFLAGS) 18 | 19 | $(call filelist, gl_flex.cpp): $(call filelist, gl_flex.fl.cpp) 20 | $(NGL_LL) -o $@ $^ 21 | 22 | $(call filelist, gl_flex.o): $(call filelist, gl_flex.cpp) 23 | $(CXX) -o $@ -c $^ 24 | 25 | $(call filelist, HeaderCreator.o): $(call filelist, HeaderCreator.cpp) 26 | $(CXX) -o $@ -c $^ 27 | 28 | 29 | EXTRA_CLEAN += $(call filelist, extractor filter gl_flex.cpp lex.yy.c) 30 | EXTRA_CLEAN += $(call filelist, *.o *.exe) 31 | 32 | .SECONDARY: $(NGL_FILTER) $(NGL_EXTRACTOR) 33 | 34 | # Begin standard footer 35 | d := $(dirstack_$(sp)) 36 | sp := $(basename $(sp)) 37 | # End standard footer 38 | -------------------------------------------------------------------------------- /ngl_generator/makefile: -------------------------------------------------------------------------------- 1 | LL=flex 2 | CXX?=g++ 3 | CFLAGS=-Wall 4 | LINKER= 5 | 6 | all: extractor filter 7 | 8 | extractor: gl_flex.o HeaderCreator.o gl_flex.o 9 | $(CXX) $(CFLAGS) -o extractor gl_flex.o HeaderCreator.o $(LINKER) 10 | 11 | filter: filter.cpp 12 | $(CXX) $(CFLAGS) -o filter filter.cpp 13 | 14 | gl_flex.cpp: gl_flex.fl.cpp 15 | $(LL) -o gl_flex.cpp gl_flex.fl.cpp 16 | 17 | gl_flex.o: gl_flex.cpp HeaderCreator.hpp 18 | $(CXX) $(CFLAGS) -c gl_flex.cpp 19 | 20 | HeaderCreator.o: HeaderCreator.hpp HeaderCreator.cpp 21 | $(CXX) $(CFLAGS) -c HeaderCreator.cpp 22 | 23 | clean: 24 | -rm -f *.o extractor *.exe filter gl_flex.cpp *~ lex.yy.c 25 | 26 | -------------------------------------------------------------------------------- /shell_scripts/create_cpp_hpp_from_file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | input_filename="$1" 6 | source_file_name="$2.cpp" 7 | output_directory="$3" 8 | if [ -z "$output_directory" ]; then 9 | output_directory="." 10 | fi 11 | source_file_name="$output_directory/$source_file_name" 12 | 13 | thisdir="`dirname $0`" 14 | decoder="$thisdir/decode_file_chars_to_numbers.pl" 15 | 16 | if [ ! -f "$decoder" ]; then 17 | echo decode_file_chars_to_numbers.pl not found in "$thisdir" 18 | exit 1 19 | fi 20 | 21 | echo -e "\n#include \"WRATHConfig.hpp\"" > "$source_file_name" 22 | echo -e "\n#include \"WRATHShaderSourceResource.hpp\"" >> "$source_file_name" 23 | 24 | echo -e "namespace { namespace WRATH_SHADER_SOURCE_UNIQUE_ID(Private) { \n\tconst char values[]={ " >> "$source_file_name" 25 | perl "$decoder" "$1" >> "$source_file_name" || exit 1 26 | echo -e " 0 };\n" >> "$source_file_name" 27 | echo -e "\n\n \n\tWRATHShaderSourceResource obj(\"$2\", values);\n}\n}\n" >> "$source_file_name" 28 | -------------------------------------------------------------------------------- /shell_scripts/decode_file_chars_to_numbers.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # open file 4 | open(FILE, "$ARGV[0]") or die("Unable to open file"); 5 | 6 | # read file into an array 7 | @data = ; 8 | 9 | foreach $line (@data) 10 | { 11 | @ASCII = unpack("C*", $line); 12 | foreach (@ASCII) { 13 | print "$_,"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export LD_LIBRARY_PATH=`pwd`/release:`pwd`/debug 3 | -------------------------------------------------------------------------------- /src/3rd_party/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/ieeehalfprecision 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/wrath-glu-tess 11 | include $(dir)/Rules.mk 12 | 13 | # Begin standard footer 14 | d := $(dirstack_$(sp)) 15 | sp := $(basename $(sp)) 16 | # End standard footer 17 | -------------------------------------------------------------------------------- /src/3rd_party/ieeehalfprecision/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | LIB_SOURCES += $(call filelist, ieeehalfprecision.c) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/3rd_party/wrath-glu-tess/README2: -------------------------------------------------------------------------------- 1 | The GLU tessellator found in WRATH has been modified from the original sources, see the header inc/3rd_party/wrath-glu-tess/wrath-glu-tess.hpp for details. -------------------------------------------------------------------------------- /src/3rd_party/wrath-glu-tess/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | LIB_SOURCES += $(call filelist, dict.cpp geom.cpp memalloc.cpp mesh.cpp normal.cpp priorityq.cpp render.cpp sweep.cpp tess.cpp tessmono.cpp) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/3rd_party/wrath-glu-tess/gluos.hpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | #define REGALWRATH_GLU_CALL 8 | -------------------------------------------------------------------------------- /src/FURY/Qt/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | QT_LIB_SOURCES += $(call filelist, FURYQTEvent.cpp) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/FURY/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/event 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/Qt 11 | include $(dir)/Rules.mk 12 | 13 | dir := $(d)/SDL 14 | include $(dir)/Rules.mk 15 | 16 | # Begin standard footer 17 | d := $(dirstack_$(sp)) 18 | sp := $(basename $(sp)) 19 | # End standard footer 20 | -------------------------------------------------------------------------------- /src/FURY/SDL/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | SDL_LIB_SOURCES += $(call filelist, FURYSDLEvent.cpp) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/FURY/event/FURYEvent.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file FURYEvent.cpp 3 | * \brief file FURYEvent.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | #include "WRATHConfig.hpp" 22 | #include "FURYEvent.hpp" 23 | #include "WRATHMutex.hpp" 24 | 25 | enum FURYEvent::event_type 26 | FURYEvent:: 27 | register_event(void) 28 | { 29 | static WRATHMutex m; 30 | static unsigned int current_v(LastEvent); 31 | 32 | WRATHAutoLockMutex(m); 33 | ++current_v; 34 | 35 | return static_cast(current_v); 36 | } 37 | -------------------------------------------------------------------------------- /src/FURY/event/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | LIB_SOURCES += $(call filelist, FURYEvent.cpp) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/WRATH 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/3rd_party 11 | include $(dir)/Rules.mk 12 | 13 | dir := $(d)/FURY 14 | include $(dir)/Rules.mk 15 | 16 | # Begin standard footer 17 | d := $(dirstack_$(sp)) 18 | sp := $(basename $(sp)) 19 | # End standard footer 20 | -------------------------------------------------------------------------------- /src/WRATH/Qt/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | QT_LIB_SOURCES += $(call filelist, WRATHQTFontSupport.cpp WRATHQTImageSupport.cpp ngl_backend_qt.cpp) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/WRATH/Qt/ngl_backend_qt.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file ngl_backend_qt.cpp 3 | * \brief file ngl_backend_qt.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "WRATHConfig.hpp" 21 | #include 22 | #include 23 | #include "ngl_backend_lib.hpp" 24 | #include "WRATHStaticInit.hpp" 25 | 26 | 27 | void* 28 | ngl_loadFunction(const char *name) 29 | { 30 | void *return_value(NULL); 31 | const QGLContext *ctx; 32 | ctx=QGLContext::currentContext(); 33 | if(ctx!=NULL) 34 | { 35 | return_value=(void*)ctx->getProcAddress(QString(name)); 36 | } 37 | 38 | WRATHStaticInit(); 39 | static NGLBackendLibEGL R; 40 | if(return_value==NULL) 41 | { 42 | return_value=R.load_function(name); 43 | } 44 | 45 | return return_value; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/WRATH/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/util 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/drawgroup 11 | include $(dir)/Rules.mk 12 | 13 | dir := $(d)/gl 14 | include $(dir)/Rules.mk 15 | 16 | dir := $(d)/image 17 | include $(dir)/Rules.mk 18 | 19 | dir := $(d)/shape 20 | include $(dir)/Rules.mk 21 | 22 | dir := $(d)/items 23 | include $(dir)/Rules.mk 24 | 25 | dir := $(d)/layer 26 | include $(dir)/Rules.mk 27 | 28 | dir := $(d)/text 29 | include $(dir)/Rules.mk 30 | 31 | dir := $(d)/Qt 32 | include $(dir)/Rules.mk 33 | 34 | dir := $(d)/SDL 35 | include $(dir)/Rules.mk 36 | 37 | # Begin standard footer 38 | d := $(dirstack_$(sp)) 39 | sp := $(basename $(sp)) 40 | # End standard footer 41 | -------------------------------------------------------------------------------- /src/WRATH/SDL/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | SDL_LIB_SOURCES += $(call filelist, WRATHSDLImageSupport.cpp ngl_backend_sdl.cpp) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/WRATH/drawgroup/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | LIB_SOURCES += $(call filelist, WRATHAttributeStore.cpp WRATHCanvasHandle.cpp WRATHItemDrawer.cpp WRATHAttributePacker.cpp WRATHCanvas.cpp WRATHItemGroup.cpp WRATHShaderSpecifier.cpp WRATHTwoPassDrawer.cpp WRATHBaseSource.cpp WRATHItemDrawState.cpp WRATHIndexGroupAllocator.cpp) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/WRATH/drawgroup/WRATHAttributePacker.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHAttributePacker.cpp 3 | * \brief file WRATHAttributePacker.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "WRATHConfig.hpp" 21 | #include "WRATHAttributePacker.hpp" 22 | #include "WRATHStaticInit.hpp" 23 | 24 | WRATH_RESOURCE_MANAGER_IMPLEMENT(WRATHAttributePacker, 25 | WRATHAttributePacker::ResourceKey); 26 | 27 | void 28 | WRATHAttributePacker:: 29 | register_resource(void) 30 | { 31 | resource_manager().add_resource(m_resource_name, this); 32 | } 33 | 34 | 35 | WRATHAttributePacker:: 36 | ~WRATHAttributePacker() 37 | { 38 | resource_manager().remove_resource(this); 39 | } 40 | 41 | WRATHMutex& 42 | WRATHAttributePacker:: 43 | fetch_make_mutex(void) 44 | { 45 | WRATHStaticInit(); 46 | static WRATHMutex R; 47 | return R; 48 | } 49 | 50 | 51 | void 52 | WRATHAttributePacker:: 53 | bind_attributes(WRATHGLPreLinkActionArray &binder) const 54 | { 55 | for(int i=0, N=number_attributes(); i 16 | * 17 | */ 18 | 19 | 20 | #include "WRATHConfig.hpp" 21 | #include "WRATHBaseSource.hpp" 22 | #include "WRATHStaticInit.hpp" 23 | 24 | const std::string& 25 | WRATHBaseSource:: 26 | prec_string(enum WRATHBaseSource::precision_t prec) 27 | { 28 | WRATHStaticInit(); 29 | static vecN R("", "mediump", "highp"); 30 | return R[prec]; 31 | } 32 | 33 | void 34 | WRATHBaseSource:: 35 | add_shader_source_code(std::map &src, 36 | enum precision_t prec, 37 | const std::string &suffix) const 38 | { 39 | add_shader_source_code_implement(src, prec, suffix); 40 | } 41 | -------------------------------------------------------------------------------- /src/WRATH/drawgroup/WRATHCanvasHandle.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHCanvasHandle.cpp 3 | * \brief file WRATHCanvasHandle.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "WRATHCanvasHandle.hpp" 21 | void 22 | WRATHCanvasHandle:: 23 | canvas_base(WRATHCanvas *p) 24 | { 25 | if(p!=m_canvas) 26 | { 27 | m_dtor_connect.disconnect(); 28 | m_canvas=p; 29 | if(p!=NULL) 30 | { 31 | WRATHCanvas *null_canvas(NULL); 32 | m_dtor_connect=p->connect_phased_delete(boost::bind(&WRATHCanvasHandle::canvas_base, 33 | this, null_canvas)); 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/WRATH/drawgroup/WRATHItemDrawer.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHItemDrawer.cpp 3 | * \brief file WRATHItemDrawer.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "WRATHConfig.hpp" 21 | #include "WRATHItemDrawer.hpp" 22 | 23 | namespace 24 | { 25 | void 26 | delete_item_drawer(WRATHItemDrawer *ptr) 27 | { 28 | WRATHDelete(ptr); 29 | } 30 | } 31 | 32 | 33 | ////////////////////////////////// 34 | //WRATHItemDrawer methods 35 | WRATH_RESOURCE_MANAGER_IMPLEMENT(WRATHItemDrawer, std::string) 36 | 37 | WRATHItemDrawer:: 38 | WRATHItemDrawer(WRATHMultiGLProgram *pr): 39 | m_program(pr) 40 | { 41 | WRATHassert(m_program!=NULL); 42 | m_resource_name=m_program->resource_name(); 43 | resource_manager().add_resource(m_resource_name, this); 44 | m_on_program_dtor=m_program->connect_dtor(boost::bind(delete_item_drawer, this)); 45 | } 46 | 47 | WRATHItemDrawer:: 48 | WRATHItemDrawer(WRATHMultiGLProgram *pr, 49 | const std::string &presource_name): 50 | m_program(pr), 51 | m_resource_name(presource_name) 52 | { 53 | WRATHassert(m_program!=NULL); 54 | resource_manager().add_resource(m_resource_name, this); 55 | m_on_program_dtor=m_program->connect_dtor(boost::bind(delete_item_drawer, this)); 56 | } 57 | 58 | 59 | WRATHItemDrawer:: 60 | ~WRATHItemDrawer() 61 | { 62 | m_dtor_signal(); 63 | m_on_program_dtor.disconnect(); 64 | resource_manager().remove_resource(this); 65 | } 66 | 67 | -------------------------------------------------------------------------------- /src/WRATH/gl/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | LIB_SOURCES += $(call filelist, WRATHUniformData.cpp WRATHGLStateChange.cpp WRATHGLExtensionList.cpp WRATHBufferObject.cpp WRATHRawDrawData.cpp WRATHGLProgram.cpp WRATHMultiGLProgram.cpp WRATHBufferAllocator.cpp WRATHTextureChoice.cpp WRATHGPUConfig.cpp WRATHGLStateStack.cpp WRATHShaderSourceResource.cpp WRATHBufferBindingPoint.cpp ngl_backend.cpp ngl_backend_lib.cpp) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/WRATH/gl/WRATHBufferBindingPoint.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHBufferBindingPoint.cpp 3 | * \brief file WRATHBufferBindingPoint.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "WRATHConfig.hpp" 21 | #include "WRATHBufferBindingPoint.hpp" 22 | 23 | bool 24 | WRATHBufferBindingPoint:: 25 | operator<(const WRATHBufferBindingPoint &rhs) const 26 | { 27 | if(m_binding_point!=rhs.m_binding_point) 28 | { 29 | return m_binding_point 16 | * 17 | */ 18 | 19 | 20 | #include "WRATHConfig.hpp" 21 | #include 22 | #include 23 | #include "WRATHGLExtensionList.hpp" 24 | #include "WRATHgl.hpp" 25 | 26 | 27 | WRATHGLExtensionList:: 28 | WRATHGLExtensionList(void) 29 | { 30 | const char *str; 31 | 32 | /* 33 | istringstream wants a const char*, but 34 | glGetString returns a const GLubyte* 35 | which is const unsigned char* (usually). 36 | Sighs. 37 | */ 38 | str=reinterpret_cast(glGetString(GL_EXTENSIONS)); 39 | std::istringstream istr(str); 40 | 41 | 42 | while(!istr) 43 | { 44 | std::string v; 45 | istr >> v; 46 | if(!istr.fail()) 47 | { 48 | m_extensions.insert(v); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/WRATH/image/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/shaders 8 | include $(dir)/Rules.mk 9 | 10 | LIB_SOURCES += $(call filelist, WRATHDefaultRectAttributePacker.cpp WRATHImage.cpp WRATHGradientSourceBase.cpp WRATHGradientSource.cpp WRATHGradient.cpp WRATHColorValueSource.cpp WRATHLinearGradientValue.cpp WRATHRadialGradientValue.cpp WRATHRepeatGradientValue.cpp WRATHGradientValueBase.cpp WRATHTextureCoordinateSourceBase.cpp WRATHTextureCoordinateSource.cpp WRATHTextureCoordinate.cpp WRATHTextureCoordinateDynamic.cpp WRATHBrush.cpp WRATHShaderBrushSourceHoard.cpp WRATHDefaultRectShader.cpp) 11 | 12 | # Begin standard footer 13 | d := $(dirstack_$(sp)) 14 | sp := $(basename $(sp)) 15 | # End standard footer 16 | -------------------------------------------------------------------------------- /src/WRATH/image/WRATHBrush.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHBrush.cpp 3 | * \brief file WRATHBrush.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | #include "WRATHConfig.hpp" 22 | #include "WRATHBrush.hpp" 23 | 24 | ///////////////////////////////////////////////// 25 | // WRATHShaderBrush methods 26 | bool 27 | WRATHShaderBrush:: 28 | operator<(const WRATHShaderBrush &rhs) const 29 | { 30 | #define EASY(X) if (X!=rhs.X) { return X 16 | * 17 | */ 18 | 19 | 20 | 21 | #include "WRATHConfig.hpp" 22 | #include "WRATHGradientValueBase.hpp" 23 | 24 | void 25 | WRATHGradientValueBase:: 26 | add_per_node_values_at(int start, WRATHLayerNodeValuePackerBase::ActiveNodeValuesCollection &spec, 27 | const WRATHLayerNodeValuePackerBase::function_packet &func) 28 | { 29 | /* 30 | TODO: 31 | Is the assumption that gradient only used in the fragment shader 32 | a good assumption? 33 | */ 34 | if(func.supports_per_node_value(GL_FRAGMENT_SHADER)) 35 | { 36 | spec 37 | .add_source(start, "WRATH_GRADIENT_y_coordinate", GL_FRAGMENT_SHADER); 38 | } 39 | else 40 | { 41 | spec 42 | .add_source(start, "WRATH_GRADIENT_y_coordinate", GL_VERTEX_SHADER); 43 | } 44 | } 45 | 46 | void 47 | WRATHGradientValueBase:: 48 | extract_values_at(int start, reorder_c_array out_value) 49 | { 50 | out_value[start]=m_y_texture_coordinate; 51 | } 52 | -------------------------------------------------------------------------------- /src/WRATH/image/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | SHADERS += $(call filelist, image.vert.wrath-shader.glsl image.frag.wrath-shader.glsl empty_pre_compute_shader_code_highp.wrath-shader.glsl empty_pre_compute_shader_code_noprec.wrath-shader.glsl empty_pre_compute_shader_code_mediump.wrath-shader.glsl linear-gradient-values.compute.wrath-shader.glsl linear-gradient-values.pre-compute.wrath-shader.glsl radial-gradient-values.compute.wrath-shader.glsl radial-gradient-values.pre_compute.wrath-shader.glsl repeat-gradient.pre-compute.wrath-shader.glsl repeat-gradient.wrath-shader.glsl empty_pre_compute_tex_shader_code_highp.wrath-shader.glsl empty_pre_compute_tex_shader_code_mediump.wrath-shader.glsl empty_pre_compute_tex_shader_code_noprec.wrath-shader.glsl image-repeat-mode-functions.wrath-shader.glsl image-value-normalized-coordinate.compute.wrath-shader.glsl image-value-normalized-coordinate.pre-compute.wrath-shader.glsl image-value-normalized-coordinate-dynamic.compute.wrath-shader.glsl image-value-normalized-coordinate-dynamic.pre-compute.wrath-shader.glsl wrath-brush.vert.wrath-shader.glsl wrath-brush.frag.wrath-shader.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/WRATH/image/shaders/empty_pre_compute_shader_code_highp.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file empty_pre_compute_shader_code_highp.wrath-shader.glsl 3 | * \brief file empty_pre_compute_shader_code_highp.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | void wrath_pre_compute_gradient(in highp vec2 p) {} 22 | void wrath_pre_compute_gradient(void) {} 23 | 24 | -------------------------------------------------------------------------------- /src/WRATH/image/shaders/empty_pre_compute_shader_code_mediump.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file empty_pre_compute_shader_code_mediump.wrath-shader.glsl 3 | * \brief file empty_pre_compute_shader_code_mediump.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | void wrath_pre_compute_gradient(in mediump vec2 p) {} 22 | void wrath_pre_compute_gradient(void) {} 23 | 24 | -------------------------------------------------------------------------------- /src/WRATH/image/shaders/empty_pre_compute_shader_code_noprec.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file empty_pre_compute_shader_code_noprec.wrath-shader.glsl 3 | * \brief file empty_pre_compute_shader_code_noprec.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | void wrath_pre_compute_gradient(in vec2 p) {} 22 | void wrath_pre_compute_gradient(void) {} 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/WRATH/image/shaders/empty_pre_compute_tex_shader_code_highp.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file empty_pre_compute_tex_shader_code_highp.wrath-shader.glsl 3 | * \brief file empty_pre_compute_tex_shader_code_highp.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | void wrath_pre_compute_texture_coordinate(in highp vec2 p) {} 22 | void wrath_pre_compute_texture_coordinate(void) {} 23 | 24 | -------------------------------------------------------------------------------- /src/WRATH/image/shaders/empty_pre_compute_tex_shader_code_mediump.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file empty_pre_compute_tex_shader_code_mediump.wrath-shader.glsl 3 | * \brief file empty_pre_compute_tex_shader_code_mediump.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | void wrath_pre_compute_texture_coordinate(in mediump vec2 p) {} 22 | void wrath_pre_compute_texture_coordinate(void) {} 23 | 24 | -------------------------------------------------------------------------------- /src/WRATH/image/shaders/empty_pre_compute_tex_shader_code_noprec.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file empty_pre_compute_tex_shader_code_noprec.wrath-shader.glsl 3 | * \brief file empty_pre_compute_tex_shader_code_noprec.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | void wrath_pre_compute_texture_coordinate(in vec2 p) {} 22 | void wrath_pre_compute_texture_coordinate(void) {} 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/WRATH/image/shaders/image.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file image.frag.wrath-shader.glsl 3 | * \brief file image.frag.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | 22 | 23 | void 24 | shader_main(void) 25 | { 26 | mediump vec4 color; 27 | 28 | discard_if_clipped(); 29 | 30 | #ifdef WRATH_APPLY_BRUSH 31 | color=wrath_shader_brush_color(); 32 | #else 33 | color=vec4(1.0, 0.0, 0.0, 1.0); 34 | #endif 35 | 36 | #if defined(WRATH_IS_OPAQUE_PASS) 37 | { 38 | if(color.w=float(WRATH_TRANSLUCENT_THRESHOLD)) 44 | color.w=0.0; 45 | } 46 | #endif 47 | 48 | #ifdef WRATH_BRUSH_PREMULTIPLY_ALPHA 49 | { 50 | wrath_FragColor=vec4(color.xyz, 1.0)*color.w; 51 | } 52 | #else 53 | { 54 | wrath_FragColor=color; 55 | } 56 | #endif 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/WRATH/image/shaders/image.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file image.vert.wrath-shader.glsl 3 | * \brief file image.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | 22 | /* 23 | position: 24 | .xy=width height of rect 25 | .z=z coordinate to feed to the pvm matrix 26 | value is common to all corners of the quad. 27 | */ 28 | shader_in mediump vec3 size_and_z; 29 | 30 | /* 31 | brush: 32 | .xy=offset to apply for brush 33 | .zw=strech to apply for brush 34 | */ 35 | shader_in mediump vec4 brush; 36 | 37 | /* 38 | normalized coordinate within the quad, 39 | (0,0)=bottom left, (1,1)=top right 40 | */ 41 | shader_in mediump vec2 normalized_coordinate; 42 | 43 | 44 | void 45 | shader_main(void) 46 | { 47 | highp vec2 frag_pos; 48 | highp vec2 clipped_normalized, offset; 49 | 50 | 51 | clipped_normalized=compute_clipped_normalized_coordinate(normalized_coordinate, 52 | vec2(0.0, 0.0), size_and_z.xy); 53 | 54 | 55 | frag_pos.xy=clipped_normalized*size_and_z.xy; 56 | gl_Position=compute_gl_position_and_apply_clipping(vec3(frag_pos.xy, size_and_z.z)); 57 | 58 | #ifdef WRATH_APPLY_BRUSH 59 | wrath_shader_brush_prepare(frag_pos.xy*brush.zw + brush.xy); 60 | #endif 61 | } 62 | -------------------------------------------------------------------------------- /src/WRATH/image/shaders/repeat-gradient.pre-compute.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file repeat-gradient.pre-compute.wrath-shader.glsl 3 | * \brief file repeat-gradient.pre-compute.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | /* 22 | expected macros: 23 | WRATH_REPEAT_GRADIENT_PREC specifies precision 24 | WRATH_REPEAT_GRADIENT_VARYING_LABEL specifier label for the varying 25 | WRATH_REPEAT_GRADIENT_UNDERLYING_GRADIENT_pre_compute underlying gradient precompute function 26 | WRATH_REPEAT_GRADIENT_pre_compute name to use for pre-compute function 27 | */ 28 | #ifdef WRATH_GL_FRAGMENT_SHADER_ITEM_VALUE_FETCH_OK 29 | void WRATH_REPEAT_GRADIENT_pre_compute(void) 30 | { 31 | WRATH_REPEAT_GRADIENT_UNDERLYING_GRADIENT_pre_compute(); 32 | } 33 | #else 34 | shader_out WRATH_REPEAT_GRADIENT_PREC vec4 WRATH_REPEAT_GRADIENT_VARYING_LABEL; 35 | void WRATH_REPEAT_GRADIENT_pre_compute(void) 36 | { 37 | WRATH_REPEAT_GRADIENT_UNDERLYING_GRADIENT_pre_compute(); 38 | WRATH_REPEAT_GRADIENT_VARYING_LABEL=vec4(fetch_node_value(WRATH_GRADIENT_window_x), 39 | fetch_node_value(WRATH_GRADIENT_window_y), 40 | fetch_node_value(WRATH_GRADIENT_window_delta_x), 41 | fetch_node_value(WRATH_GRADIENT_window_delta_y)); 42 | } 43 | #endif 44 | -------------------------------------------------------------------------------- /src/WRATH/items/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | LIB_SOURCES += $(call filelist, WRATHBaseItem.cpp WRATHShapeItem.cpp WRATHTextItem.cpp WRATHRectItem.cpp WRATHBasicTextItem.cpp) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/WRATH/layer/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/node 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/node_packers 11 | include $(dir)/Rules.mk 12 | 13 | LIB_SOURCES += $(call filelist, WRATHLayerBase.cpp WRATHLayer.cpp WRATHLayerNodeValuePackerBase.cpp WRATHLayerItemDrawerFactory.cpp WRATHLayerItemNodeBase.cpp WRATHLayerClipDrawerMesh.cpp) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /src/WRATH/layer/node/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/translate 8 | include $(dir)/Rules.mk 9 | 10 | dir := $(d)/rotate_translate 11 | include $(dir)/Rules.mk 12 | 13 | LIB_SOURCES += $(call filelist, WRATHLayerItemNodeColorValue.cpp) 14 | 15 | # Begin standard footer 16 | d := $(dirstack_$(sp)) 17 | sp := $(basename $(sp)) 18 | # End standard footer 19 | -------------------------------------------------------------------------------- /src/WRATH/layer/node/rotate_translate/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/shaders 8 | include $(dir)/Rules.mk 9 | 10 | LIB_SOURCES += $(call filelist, WRATHLayerItemNodeRotateTranslate.cpp) 11 | 12 | # Begin standard footer 13 | d := $(dirstack_$(sp)) 14 | sp := $(basename $(sp)) 15 | # End standard footer 16 | -------------------------------------------------------------------------------- /src/WRATH/layer/node/rotate_translate/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | SHADERS += $(call filelist, transformation_layer_rotate_translate.frag.wrath-shader.glsl transformation_layer_rotate_translate.vert.wrath-shader.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/WRATH/layer/node/rotate_translate/shaders/transformation_layer_rotate_translate.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file transformation_layer_rotate_translate.frag.wrath-shader.glsl 3 | * \brief file transformation_layer_rotate_translate.frag.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | 22 | /* 23 | RotateTranslate does NOT do clipping!! 24 | */ 25 | void 26 | discard_if_clipped(void) 27 | {} 28 | 29 | mediump float 30 | discard_via_alpha(void) 31 | { 32 | return 1.0; 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/WRATH/layer/node/translate/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/shaders 8 | include $(dir)/Rules.mk 9 | 10 | LIB_SOURCES += $(call filelist, WRATHLayerItemNodeTranslate.cpp) 11 | 12 | # Begin standard footer 13 | d := $(dirstack_$(sp)) 14 | sp := $(basename $(sp)) 15 | # End standard footer 16 | -------------------------------------------------------------------------------- /src/WRATH/layer/node/translate/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | SHADERS += $(call filelist, transformation_layer_translate.frag.wrath-shader.glsl transformation_layer_translate.vert.wrath-shader.glsl layer_translate_clip_rect.vert.wrath-shader.glsl layer_translate_clip_rect.frag.wrath-shader.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/WRATH/layer/node/translate/shaders/layer_translate_clip_rect.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file layer_translate_clip_rect.frag.wrath-shader.glsl 3 | * \brief file layer_translate_clip_rect.frag.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | 22 | void 23 | main(void) 24 | { 25 | //hot pink for the fragment 26 | wrath_FragColor=vec4(0.75, 0.75, 0.3, 1.0); 27 | } 28 | -------------------------------------------------------------------------------- /src/WRATH/layer/node/translate/shaders/layer_translate_clip_rect.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file layer_translate_clip_rect.vert.wrath-shader.glsl 3 | * \brief file layer_translate_clip_rect.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | uniform mediump vec2 p; 22 | uniform mediump vec2 q; 23 | uniform mediump mat4 pvm; 24 | 25 | shader_in vec2 in_normalized_pts; 26 | 27 | void 28 | main(void) 29 | { 30 | mediump vec2 pt; 31 | 32 | pt= p + (q-p)*in_normalized_pts; 33 | gl_Position=pvm*vec4(pt, -1.0, 1.0); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/WRATH/layer/node/translate/shaders/transformation_layer_translate.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file transformation_layer_translate.frag.wrath-shader.glsl 3 | * \brief file transformation_layer_translate.frag.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | #ifdef WRATH_CLIP_VIA_DISCARD 22 | shader_in mediump vec4 clipping_via_discard; 23 | #endif 24 | 25 | /* 26 | Note: in the case of WRATH_COVER_DRAW, 27 | the depth or stencil buffer was set 28 | in the previous pass, thus we can then 29 | avoid the discard 30 | */ 31 | #if defined(WRATH_CLIP_VIA_DISCARD) && !defined(WRATH_COVER_DRAW) 32 | #define CLIPPING_USES_DISCARD 33 | 34 | void 35 | discard_if_clipped(void) 36 | { 37 | if(clipping_via_discard.x<0.0 38 | || clipping_via_discard.y<0.0 39 | || clipping_via_discard.z<0.0 40 | || clipping_via_discard.w<0.0) 41 | { 42 | discard; 43 | } 44 | } 45 | 46 | mediump float 47 | discard_via_alpha(void) 48 | { 49 | return step(0.0, clipping_via_discard.x) 50 | * step(0.0, clipping_via_discard.y) 51 | * step(0.0, clipping_via_discard.z) 52 | * step(0.0, clipping_via_discard.w); 53 | 54 | } 55 | 56 | #else 57 | 58 | void 59 | discard_if_clipped(void) 60 | {} 61 | 62 | mediump float 63 | discard_via_alpha(void) 64 | { 65 | return 1.0; 66 | } 67 | 68 | 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/WRATH/layer/node_packers/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | LIB_SOURCES += $(call filelist, WRATHLayerNodeValuePackerUniformArrays.cpp WRATHLayerNodeValuePackerTexture.cpp WRATHLayerNodeValuePackerHybrid.cpp) 9 | 10 | # Begin standard footer 11 | d := $(dirstack_$(sp)) 12 | sp := $(basename $(sp)) 13 | # End standard footer 14 | -------------------------------------------------------------------------------- /src/WRATH/shape/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/shaders 8 | include $(dir)/Rules.mk 9 | 10 | LIB_SOURCES += $(call filelist, WRATHDynamicStrokeAttributePacker.cpp WRATHShapeDistanceFieldGPU.cpp WRATHShapePreStroker.cpp WRATHDefaultFillShapeAttributePacker.cpp WRATHGenericStrokeAttributePacker.cpp WRATHShapeTriangulator.cpp WRATHShapeDistanceFieldGPUutil.cpp WRATHShapeSimpleTessellator.cpp WRATHDefaultStrokeAttributePacker.cpp WRATHTessGLU.cpp WRATHDefaultShapeShader.cpp) 11 | 12 | # Begin standard footer 13 | d := $(dirstack_$(sp)) 14 | sp := $(basename $(sp)) 15 | # End standard footer 16 | -------------------------------------------------------------------------------- /src/WRATH/shape/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | SHADERS += $(call filelist, shape.frag.wrath-shader.glsl shape.vert.wrath-shader.glsl distance_field_draw_distance_points.frag.wrath-shader.glsl distance_field_draw_distance_points.vert.wrath-shader.glsl distance_field_draw_distance_rects.frag.wrath-shader.glsl distance_field_draw_distance_rects.vert.wrath-shader.glsl distance_field_simple_shader.frag.wrath-shader.glsl distance_field_simple_shader.vert.wrath-shader.glsl) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/WRATH/shape/shaders/distance_field_draw_distance_points.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file distance_field_draw_distance_points.frag.wrath-shader.glsl 3 | * \brief file distance_field_draw_distance_points.frag.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | #ifdef GL_ES 22 | #ifdef NV_shader_framebuffer_fetch 23 | #extension GL_NV_shader_framebuffer_fetch: require 24 | #else 25 | #extension GL_EXT_frag_depth: require 26 | #define fragdepth gl_FragDepthEXT 27 | #endif 28 | #else 29 | #define fragdepth gl_FragDepth 30 | #endif 31 | 32 | 33 | shader_in mediump vec2 st; 34 | uniform mediump float distance_sign; 35 | 36 | void 37 | main(void) 38 | { 39 | mediump float v, d, hd; 40 | 41 | d=min(1.0, length(st)); 42 | hd=0.5*d; 43 | 44 | #ifdef NV_shader_framebuffer_fetch 45 | hd=min(hd, abs(gl_LastFragColor-0.5)); 46 | #else 47 | fragdepth=hd; 48 | #endif 49 | 50 | v=0.5 + distance_sign*hd; 51 | wrath_FragColor=vec4(v, v, v, v); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /src/WRATH/shape/shaders/distance_field_draw_distance_points.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file distance_field_draw_distance_points.vert.wrath-shader.glsl 3 | * \brief file distance_field_draw_distance_points.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | uniform mediump mat4 pvm; 22 | shader_in mediump vec4 pos; 23 | shader_out mediump vec2 st; 24 | 25 | void 26 | main(void) 27 | { 28 | st=pos.zw; 29 | gl_Position=pvm*vec4(pos.xy, 0.0, 1.0); 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/WRATH/shape/shaders/distance_field_draw_distance_rects.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file distance_field_draw_distance_rects.frag.wrath-shader.glsl 3 | * \brief file distance_field_draw_distance_rects.frag.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | shader_in mediump float z; 22 | void 23 | main(void) 24 | { 25 | wrath_FragColor.rgba=vec4(z, z, z, z); 26 | } 27 | -------------------------------------------------------------------------------- /src/WRATH/shape/shaders/distance_field_draw_distance_rects.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file distance_field_draw_distance_rects.vert.wrath-shader.glsl 3 | * \brief file distance_field_draw_distance_rects.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | uniform mediump mat4 pvm; 22 | uniform mediump float distance_sign; 23 | 24 | shader_in mediump vec3 vert; 25 | shader_out mediump float z; 26 | 27 | void 28 | main(void) 29 | { 30 | /* 31 | normalize vert.z*distance_sign which is [-1,1] to [0,1]. 32 | */ 33 | z=0.5 + 0.5*distance_sign*vert.z; 34 | gl_Position=pvm*vec4(vert.xy, vert.z, 1.0); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/WRATH/shape/shaders/distance_field_simple_shader.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file distance_field_simple_shader.frag.wrath-shader.glsl 3 | * \brief file distance_field_simple_shader.frag.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | void 22 | main(void) 23 | { 24 | wrath_FragColor.rgba=vec4(1.0, 1.0, 1.0, 1.0); 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/WRATH/shape/shaders/distance_field_simple_shader.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file distance_field_simple_shader.vert.wrath-shader.glsl 3 | * \brief file distance_field_simple_shader.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | uniform mediump mat4 pvm; 22 | shader_in mediump vec2 vert; 23 | void 24 | main(void) 25 | { 26 | gl_Position=pvm*vec4(vert.xy, 0.0, 1.0); 27 | } 28 | -------------------------------------------------------------------------------- /src/WRATH/shape/shaders/shape.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file shape.vert.wrath-shader.glsl 3 | * \brief file shape.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | /* 22 | TODO: 23 | - option to allow for image to modulate 24 | - option for discard on small alpha color 25 | */ 26 | 27 | //pos meanings: 28 | // .xy: location in UI co-ordinates (2D) 29 | shader_in mediump vec2 pos; 30 | 31 | #ifdef WRATH_BRUSH_AA_HINT 32 | shader_in mediump float in_aa_hint; 33 | shader_out mediump float aa_hint; 34 | #endif 35 | 36 | void 37 | shader_main(void) 38 | { 39 | #ifdef WRATH_BRUSH_AA_HINT 40 | { 41 | aa_hint=in_aa_hint; 42 | } 43 | #endif 44 | 45 | gl_Position=compute_gl_position_and_apply_clipping(vec3(pos, -1.0)); 46 | #ifdef WRATH_APPLY_BRUSH 47 | wrath_shader_brush_prepare(pos.xy); 48 | #endif 49 | } 50 | -------------------------------------------------------------------------------- /src/WRATH/text/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | dir := $(d)/shaders 8 | include $(dir)/Rules.mk 9 | 10 | LIB_SOURCES += $(call filelist, WRATHColumnFormatter.cpp WRATHDefaultTextAttributePacker.cpp WRATHFontConfig.cpp WRATHFontShaderSpecifier.cpp WRATHFormattedTextStream.cpp WRATHFreeTypeSupport.cpp WRATHGenericTextAttributePacker.cpp WRATHTextAttributePacker.cpp WRATHTextDataStream.cpp WRATHTextureFont.cpp WRATHTextureFontDrawer.cpp WRATHTextureFontUtil.cpp WRATHTextDataStreamManipulator.cpp WRATHFontDatabase.cpp WRATHFontFetch.cpp WRATHTextureFontFreeType_Analytic.cpp WRATHTextureFontFreeType_Distance.cpp WRATHTextureFontFreeType_Coverage.cpp WRATHTextureFontFreeType_CurveAnalytic.cpp WRATHTextureFontFreeType_DetailedCoverage.cpp WRATHTextureFontFreeType_Mix.cpp) 11 | 12 | # Begin standard footer 13 | d := $(dirstack_$(sp)) 14 | sp := $(basename $(sp)) 15 | # End standard footer 16 | -------------------------------------------------------------------------------- /src/WRATH/text/WRATHSVGFont.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATHSVGFont.cpp 3 | * \brief file WRATHSVGFont.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "WRATHConfig.hpp" 21 | 22 | #include "WRATHSVGFont.hpp" 23 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | dir := $(d)/analytic 9 | include $(dir)/Rules.mk 10 | 11 | dir := $(d)/coverage 12 | include $(dir)/Rules.mk 13 | 14 | dir := $(d)/detailed_coverage 15 | include $(dir)/Rules.mk 16 | 17 | dir := $(d)/distance 18 | include $(dir)/Rules.mk 19 | 20 | dir := $(d)/common 21 | include $(dir)/Rules.mk 22 | 23 | dir := $(d)/curve_analytic 24 | include $(dir)/Rules.mk 25 | 26 | dir := $(d)/mix 27 | include $(dir)/Rules.mk 28 | 29 | # Begin standard footer 30 | d := $(dirstack_$(sp)) 31 | sp := $(basename $(sp)) 32 | # End standard footer 33 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/analytic/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | 9 | SHADERS += $(call filelist, font_analytic_linear.vert.wrath-shader.glsl font_analytic_linear.frag.wrath-shader.glsl font_analytic_nonlinear.vert.wrath-shader.glsl font_analytic_nonlinear.frag.wrath-shader.glsl font_analytic_base.frag.wrath-shader.glsl) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/analytic/font_analytic_linear.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_analytic_base.frag.wrath-shader.glsl 3 | * \brief file font_analytic_base.frag.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | 22 | shader_in mediump vec4 wrath_AnalyticTexCoord_Position; 23 | 24 | #define GlyphTextureCoordinate wrath_AnalyticTexCoord_Position.xy 25 | #define GlyphCoordinate wrath_AnalyticTexCoord_Position.zw 26 | 27 | mediump float 28 | wrath_glyph_signed_distance(void) 29 | { 30 | return wrath_analytic_font_compute_distance(GlyphTextureCoordinate, GlyphCoordinate); 31 | } 32 | 33 | mediump float 34 | wrath_glyph_compute_coverage(void) 35 | { 36 | mediump float d; 37 | 38 | d=wrath_glyph_signed_distance(); 39 | #if defined(WRATH_DERIVATIVES_SUPPORTED) 40 | { 41 | mediump vec2 dx, dy; 42 | mediump float sd, a; 43 | 44 | dx=dFdx(GlyphCoordinate); 45 | dy=dFdy(GlyphCoordinate); 46 | sd=max(1.0, inversesqrt( (dot(dx,dx) + dot(dy,dy))/2.0 ) ); 47 | a= 0.5 + d*sd; 48 | return clamp(a, 0.0, 1.0); 49 | } 50 | #else 51 | { 52 | return step(0.0, d); 53 | } 54 | #endif 55 | 56 | } 57 | 58 | mediump float 59 | wrath_glyph_is_covered(void) 60 | { 61 | mediump float d; 62 | 63 | d=wrath_glyph_signed_distance(); 64 | return step(0.0, d); 65 | } 66 | 67 | 68 | 69 | #undef GlyphTextureCoordinate 70 | #undef GlyphCoordinate 71 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/analytic/font_analytic_linear.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_analytic_linear.vert.wrath-shader.glsl 3 | * \brief file font_analytic_linear.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | shader_out mediump vec4 wrath_AnalyticTexCoord_Position; 21 | 22 | void wrath_pre_compute_glyph(in vec2 glyph_position, 23 | in vec2 glyph_bottom_left, 24 | in vec2 glyph_size) 25 | { 26 | mediump vec2 pp, glyph_texture_reciprocal_size; 27 | 28 | pp=glyph_bottom_left + glyph_position; 29 | glyph_texture_reciprocal_size=vec2(wrath_font_page_data(0), 30 | wrath_font_page_data(1)); 31 | 32 | wrath_AnalyticTexCoord_Position.zw=glyph_position; 33 | wrath_AnalyticTexCoord_Position.xy=pp*glyph_texture_reciprocal_size; 34 | } 35 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/analytic/font_analytic_nonlinear.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_analytic_nonlinear.vert.wrath-shader.glsl 3 | * \brief file font_analytic_nonlinear.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | shader_out mediump vec2 wrath_AnalyticBottomLeft; 20 | void wrath_pre_compute_glyph(in vec2 glyph_bottom_left, 21 | in vec2 glyph_size) 22 | { 23 | wrath_AnalyticBottomLeft=glyph_bottom_left; 24 | } 25 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/common/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | 9 | SHADERS += $(call filelist, simple_ui_font.vert.wrath-shader.glsl font_generic_aa.frag.wrath-shader.glsl font_generic.frag.wrath-shader.glsl font_shader_texture_page_data.wrath-shader.glsl font_shader_wrath_prepare_glyph_vs.vert.wrath-shader.glsl) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/common/font_generic.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_generic.frag.wrath-shader.glsl 3 | * \brief file font_generic.frag.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | shader_in mediump vec4 tex_color; 21 | 22 | void 23 | shader_main(void) 24 | { 25 | mediump vec4 final_color; 26 | 27 | final_color=tex_color; 28 | 29 | #if defined(WRATH_APPLY_BRUSH_RELATIVE_TO_LETTER) || defined(WRATH_APPLY_BRUSH_RELATIVE_TO_ITEM) 30 | { 31 | final_color*=wrath_shader_brush_color(); 32 | } 33 | #endif 34 | 35 | #if defined(WRATH_COVER_DRAW) 36 | { 37 | //a previous pass guarantees that the 38 | //fragment is covered by the glyph, thus 39 | //we can skip the test and just draw the color 40 | wrath_FragColor=final_color; 41 | } 42 | #else 43 | { 44 | mediump float d; 45 | d=wrath_glyph_is_covered(); 46 | 47 | #if defined(WRATH_IS_OPAQUE_PASS) 48 | if(d<0.5) 49 | discard; 50 | wrath_FragColor=final_color; 51 | #else 52 | if(d<0.5) 53 | wrath_FragColor=vec4(0.0, 0.0, 0.0, 0.0); 54 | else 55 | wrath_FragColor=final_color; 56 | #endif 57 | } 58 | #endif 59 | } 60 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/common/font_shader_texture_page_data.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_shader_texture_page_data.wrath-shader.glsl 3 | * \brief file font_shader_texture_page_data.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | #ifdef WRATH_FONT_TEXTURE_PAGE_DATA_EMPTY 20 | highp float 21 | wrath_font_page_data(in int idx) 22 | { 23 | return 0.0; 24 | } 25 | 26 | #else 27 | 28 | /* 29 | This variable name must match with the uniform fetch name used 30 | in WRATHTextureFontDrawer 31 | */ 32 | uniform highp float wrath_font_page_data_uniforms[WRATH_FONT_TEXTURE_PAGE_DATA_SIZE]; 33 | 34 | highp float 35 | wrath_font_page_data(in int idx) 36 | { 37 | return wrath_font_page_data_uniforms[idx]; 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/common/font_shader_wrath_prepare_glyph_vs.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_shader_wrath_prepare_glyph_vs.vert.wrath-shader.glsl 3 | * \brief file font_shader_wrath_prepare_glyph_vs.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | void 22 | wrath_font_prepare_glyph_vs( 23 | #ifdef WRATH_TEXTURE_FONT_LINEAR 24 | in vec2 glyph_position, 25 | #endif 26 | in vec2 glyph_bottom_left, 27 | in vec2 glyph_size) 28 | { 29 | #if defined(WRATH_FONT_CUSTOM_DATA) 30 | { 31 | wrath_font_custom_data_t custom_values_str; 32 | 33 | wrath_font_shader_custom_data_func(custom_values_str); 34 | wrath_pre_compute_glyph( 35 | #ifdef WRATH_TEXTURE_FONT_LINEAR 36 | glyph_position, 37 | #endif 38 | glyph_bottom_left, 39 | glyph_size, 40 | custom_values_str.values); 41 | } 42 | #else 43 | { 44 | wrath_pre_compute_glyph( 45 | #ifdef WRATH_TEXTURE_FONT_LINEAR 46 | glyph_position, 47 | #endif 48 | glyph_bottom_left, 49 | glyph_size); 50 | } 51 | #endif 52 | } 53 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/coverage/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | 9 | SHADERS += $(call filelist, font_coverage_linear.frag.wrath-shader.glsl font_coverage_nonlinear.frag.wrath-shader.glsl font_coverage_linear.vert.wrath-shader.glsl font_coverage_nonlinear.vert.wrath-shader.glsl) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/coverage/font_coverage_linear.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_coverage_linear.frag.wrath-shader.glsl 3 | * \brief file font_coverage_linear.frag.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | 22 | 23 | 24 | shader_in mediump vec2 wrath_CoverageFieldTexCoord; 25 | shader_in mediump vec2 wrath_CoverageFieldPosition; 26 | uniform mediump sampler2D wrath_CoverageField; 27 | 28 | mediump float 29 | wrath_glyph_is_covered(void) 30 | { 31 | mediump float rr; 32 | 33 | rr=texture2D(wrath_CoverageField, wrath_CoverageFieldTexCoord).r; 34 | return step(0.5, rr); 35 | } 36 | 37 | mediump float 38 | wrath_glyph_compute_coverage(void) 39 | { 40 | mediump float rr; 41 | 42 | rr=texture2D(wrath_CoverageField, wrath_CoverageFieldTexCoord).r; 43 | return rr; 44 | } 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/coverage/font_coverage_linear.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_coverage_linear.vert.wrath-shader.glsl 3 | * \brief file font_coverage_linear.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | shader_out mediump vec2 wrath_CoverageFieldTexCoord; 21 | shader_out mediump vec2 wrath_CoverageFieldPosition; 22 | 23 | void wrath_pre_compute_glyph(in vec2 glyph_position, 24 | in vec2 glyph_bottom_left, 25 | in vec2 glyph_size) 26 | { 27 | mediump vec2 pp, glyph_texture_reciprocal_size; 28 | 29 | glyph_texture_reciprocal_size=vec2(wrath_font_page_data(0), 30 | wrath_font_page_data(1)); 31 | 32 | pp=glyph_bottom_left + glyph_position; 33 | wrath_CoverageFieldPosition=pp; 34 | wrath_CoverageFieldTexCoord=pp*glyph_texture_reciprocal_size; 35 | } 36 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/coverage/font_coverage_nonlinear.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_coverage_base.frag.wrath-shader.glsl 3 | * \brief file font_coverage_base.frag.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | uniform mediump sampler2D wrath_CoverageField; 26 | shader_in mediump vec2 wrath_CoverageFieldBottomLeft; 27 | 28 | mediump float 29 | wrath_glyph_is_covered(in vec2 glyph_position) 30 | { 31 | mediump float rr; 32 | mediump vec2 tt, glyph_texture_reciprocal_size; 33 | 34 | glyph_texture_reciprocal_size=vec2(wrath_font_page_data(0), 35 | wrath_font_page_data(1)); 36 | 37 | tt=(glyph_position + wrath_CoverageFieldBottomLeft)*glyph_texture_reciprocal_size; 38 | rr=texture2D(wrath_CoverageField, tt).r; 39 | return step(0.5, rr); 40 | } 41 | 42 | mediump float 43 | wrath_glyph_compute_coverage(in vec2 glyph_position) 44 | { 45 | mediump float rr; 46 | mediump vec2 tt, glyph_texture_reciprocal_size; 47 | 48 | glyph_texture_reciprocal_size=vec2(wrath_font_page_data(0), 49 | wrath_font_page_data(1)); 50 | 51 | tt=(glyph_position + wrath_CoverageFieldBottomLeft)*glyph_texture_reciprocal_size; 52 | rr=texture2D(wrath_CoverageField, tt).r; 53 | return rr; 54 | 55 | } 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/coverage/font_coverage_nonlinear.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_coverage_nonlinear.vert.wrath-shader.glsl 3 | * \brief file font_coverage_nonlinear.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | shader_out mediump vec2 wrath_CoverageFieldBottomLeft; 20 | void wrath_pre_compute_glyph(in vec2 glyph_bottom_left, 21 | in vec2 glyph_size) 22 | { 23 | wrath_CoverageFieldBottomLeft=glyph_bottom_left; 24 | } 25 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/curve_analytic/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | 9 | SHADERS += $(call filelist, font_curve_analytic_base.frag.wrath-shader.glsl font_curve_analytic_linear.frag.wrath-shader.glsl font_curve_analytic_linear.vert.wrath-shader.glsl font_curve_analytic_nonlinear.frag.wrath-shader.glsl font_curve_analytic_nonlinear.vert.wrath-shader.glsl) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/curve_analytic/font_curve_analytic_linear.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_curve_analytic_linear.vert.wrath-shader.glsl 3 | * \brief file font_curve_analytic_linear.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | shader_out mediump vec4 wrath_CurveAnalyticTexCoord_Position; 21 | shader_out mediump float wrath_CurveAnalyticGlyphIndex; 22 | 23 | void wrath_pre_compute_glyph(in vec2 glyph_position, 24 | in vec2 glyph_bottom_left, 25 | in vec2 glyph_size, 26 | in float glyph_custom_data[1]) 27 | { 28 | mediump vec2 pp, glyph_texture_reciprocal_size; 29 | 30 | glyph_texture_reciprocal_size=vec2(wrath_font_page_data(0), 31 | wrath_font_page_data(1)); 32 | 33 | pp=glyph_bottom_left + glyph_position; 34 | wrath_CurveAnalyticTexCoord_Position.zw=glyph_position; 35 | wrath_CurveAnalyticTexCoord_Position.xy=pp*glyph_texture_reciprocal_size; 36 | wrath_CurveAnalyticGlyphIndex=glyph_custom_data[0]; 37 | } 38 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/curve_analytic/font_curve_analytic_nonlinear.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_curve_analytic_nonlinear.vert.wrath-shader.glsl 3 | * \brief file font_curve_analytic_nonlinear.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | shader_out mediump vec2 wrath_CurveAnalyticBottomLeft; 20 | shader_out mediump float wrath_CurveAnalyticGlyphIndex; 21 | 22 | void wrath_pre_compute_glyph(in vec2 glyph_bottom_left, 23 | in vec2 glyph_size, 24 | in float glyph_custom_data[1]) 25 | { 26 | wrath_CurveAnalyticBottomLeft=glyph_bottom_left; 27 | wrath_CurveAnalyticGlyphIndex=glyph_custom_data[0]; 28 | } 29 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/detailed_coverage/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | 9 | SHADERS += $(call filelist, font_detailed_base.frag.wrath-shader.glsl font_detailed_nonlinear.frag.wrath-shader.glsl font_detailed_linear.frag.wrath-shader.glsl font_detailed_nonlinear.vert.wrath-shader.glsl font_detailed_linear.vert.wrath-shader.glsl) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/detailed_coverage/font_detailed_linear.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * \file font_detailed_linear.frag.wrath-shader.glsl 4 | * \brief file font_detailed_linear.frag.wrath-shader.glsl 5 | * 6 | * Copyright 2013 by Nomovok Ltd. 7 | * 8 | * Contact: info@nomovok.com 9 | * 10 | * This Source Code Form is subject to the 11 | * terms of the Mozilla Public License, v. 2.0. 12 | * If a copy of the MPL was not distributed with 13 | * this file, You can obtain one at 14 | * http://mozilla.org/MPL/2.0/. 15 | * 16 | * \author Kevin Rogovin 17 | * 18 | */ 19 | 20 | 21 | shader_in mediump vec4 wrath_DetailedNormalizedCoord_Position; 22 | shader_in mediump float wrath_DetailedGlyphIndex; 23 | 24 | mediump float 25 | wrath_glyph_is_covered(void) 26 | { 27 | return wrath_detailed_wrath_glyph_is_covered(wrath_DetailedNormalizedCoord_Position.zw, 28 | wrath_DetailedNormalizedCoord_Position.xy, 29 | wrath_DetailedGlyphIndex); 30 | } 31 | 32 | mediump float 33 | wrath_glyph_compute_coverage(void) 34 | { 35 | return wrath_detailed_wrath_glyph_compute_coverage(wrath_DetailedNormalizedCoord_Position.zw, 36 | wrath_DetailedNormalizedCoord_Position.xy, 37 | wrath_DetailedGlyphIndex); 38 | } 39 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/detailed_coverage/font_detailed_linear.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_detailed_linear.vert.wrath-shader.glsl 3 | * \brief file font_detailed_linear.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | shader_out mediump vec4 wrath_DetailedNormalizedCoord_Position; 21 | shader_out mediump float wrath_DetailedGlyphIndex; 22 | 23 | void wrath_pre_compute_glyph(in vec2 glyph_position, 24 | in vec2 glyph_bottom_left, 25 | in vec2 glyph_size, 26 | in float custom_data[1]) 27 | { 28 | mediump vec2 pp; 29 | 30 | pp=glyph_bottom_left + glyph_position; 31 | wrath_DetailedNormalizedCoord_Position.zw=pp; 32 | wrath_DetailedNormalizedCoord_Position.xy=glyph_position/glyph_size; 33 | wrath_DetailedGlyphIndex=custom_data[0]; 34 | } 35 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/detailed_coverage/font_detailed_nonlinear.frag.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | shader_in mediump vec3 wrath_DetailedGlyphRecipSize_GlyphIndex; 2 | 3 | mediump float 4 | wrath_glyph_is_covered(in mediump vec2 glyph_position) 5 | { 6 | return wrath_detailed_wrath_glyph_is_covered(glyph_position, 7 | glyph_position*wrath_DetailedGlyphRecipSize_GlyphIndex.xy, 8 | wrath_DetailedGlyphRecipSize_GlyphIndex.z); 9 | } 10 | 11 | mediump float 12 | wrath_glyph_compute_coverage(in mediump vec2 glyph_position) 13 | { 14 | return wrath_detailed_wrath_glyph_compute_coverage(glyph_position, 15 | glyph_position*wrath_DetailedGlyphRecipSize_GlyphIndex.xy, 16 | wrath_DetailedGlyphRecipSize_GlyphIndex.z); 17 | } 18 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/detailed_coverage/font_detailed_nonlinear.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_detailed_nonlinear.vert.wrath-shader.glsl 3 | * \brief file font_detailed_nonlinear.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | shader_out mediump vec3 wrath_DetailedGlyphRecipSize_GlyphIndex; 20 | void wrath_pre_compute_glyph(in vec2 glyph_bottom_left, 21 | in vec2 glyph_size, 22 | in float custom_data[1]) 23 | { 24 | wrath_DetailedGlyphRecipSize_GlyphIndex.xy=vec2(1.0f, 1.0f)/glyph_size; 25 | wrath_DetailedGlyphRecipSize_GlyphIndex.z=custom_data[0]; 26 | } 27 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/distance/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | 9 | SHADERS += $(call filelist, font_distance_base.frag.glsl font_distance_linear.frag.wrath-shader.glsl font_distance_nonlinear.frag.wrath-shader.glsl font_distance_linear.vert.wrath-shader.glsl font_distance_nonlinear.vert.wrath-shader.glsl) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/distance/font_distance_base.frag.glsl: -------------------------------------------------------------------------------- 1 | #define WRATH_FONT_IMPLEMENT_SIGNED_DISTANCE 2 | 3 | mediump float 4 | wrath_font_distance_compute_signed_distance(in mediump float rr) 5 | { 6 | return wrath_font_page_data(2)*(2.0*rr - 1.0); 7 | } 8 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/distance/font_distance_linear.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_distance_linear.vert.wrath-shader.glsl 3 | * \brief file font_distance_linear.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | shader_out mediump vec2 wrath_DistanceFieldTexCoord; 21 | shader_out mediump vec2 wrath_DistanceFieldPosition; 22 | 23 | void wrath_pre_compute_glyph(in vec2 glyph_position, 24 | in vec2 glyph_bottom_left, 25 | in vec2 glyph_size) 26 | { 27 | mediump vec2 pp, glyph_texture_reciprocal_size; 28 | 29 | glyph_texture_reciprocal_size=vec2(wrath_font_page_data(0), 30 | wrath_font_page_data(1)); 31 | 32 | pp=glyph_bottom_left + glyph_position; 33 | wrath_DistanceFieldPosition=pp; 34 | wrath_DistanceFieldTexCoord=pp*glyph_texture_reciprocal_size; 35 | } 36 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/distance/font_distance_nonlinear.vert.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_distance_nonlinear.vert.wrath-shader.glsl 3 | * \brief file font_distance_nonlinear.vert.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | shader_out mediump vec2 wrath_DistanceFieldBottomLeft; 20 | void wrath_pre_compute_glyph(in vec2 glyph_bottom_left, 21 | in vec2 glyph_size) 22 | { 23 | wrath_DistanceFieldBottomLeft=glyph_bottom_left; 24 | } 25 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/mix/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | 8 | 9 | SHADERS += $(call filelist, font_mix_page_data_func.wrath-shader.glsl font_mix_linear.frag.wrath-shader.glsl font_mix_linear.vert.wrath-shader.glsl font_mix_nonlinear.frag.wrath-shader.glsl font_mix_nonlinear.vert.wrath-shader.glsl) 10 | 11 | # Begin standard footer 12 | d := $(dirstack_$(sp)) 13 | sp := $(basename $(sp)) 14 | # End standard footer 15 | -------------------------------------------------------------------------------- /src/WRATH/text/shaders/mix/font_mix_page_data_func.wrath-shader.glsl: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file font_mix_page_data_func.wrath-shader.glsl 3 | * \brief file wrath_font_page_data.wrath-shader.glsl 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | float 20 | wrath_font_page_data(in int idx) 21 | { 22 | return wrath_font_page_data_original_function(idx + WRATH_MIX_FONT_PAGE_DATA_OFFSET); 23 | } 24 | -------------------------------------------------------------------------------- /src/WRATH/util/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | LIB_SOURCES += $(call filelist, WRATHReferenceCountedObject.cpp WRATHUtil.cpp WRATHPolynomial.cpp WRATHNew.cpp WRATHAtlas.cpp WRATHAtlasBase.cpp WRATH2DRigidTransformation.cpp WRATHResourceManager.cpp WRATHmalloc.cpp WRATHMutex.cpp WRATHTripleBufferEnabler.cpp WRATHStateStream.cpp WRATHStaticInit.cpp) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /src/WRATH/util/WRATH2DRigidTransformation.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file WRATH2DRigidTransformation.cpp 3 | * \brief file WRATH2DRigidTransformation.cpp 4 | * 5 | * Copyright 2013 by Nomovok Ltd. 6 | * 7 | * Contact: info@nomovok.com 8 | * 9 | * This Source Code Form is subject to the 10 | * terms of the Mozilla Public License, v. 2.0. 11 | * If a copy of the MPL was not distributed with 12 | * this file, You can obtain one at 13 | * http://mozilla.org/MPL/2.0/. 14 | * 15 | * \author Kevin Rogovin 16 | * 17 | */ 18 | 19 | 20 | #include "WRATHConfig.hpp" 21 | #include "WRATH2DRigidTransformation.hpp" 22 | 23 | #define epsilon 0.00001f 24 | 25 | void 26 | WRATH2DRigidTransformation:: 27 | rotation(enum rotation_enum_t r) 28 | { 29 | switch(r) 30 | { 31 | default: 32 | case no_rotation: 33 | m_rotation=std::complex(1.0f, 0.0f); 34 | break; 35 | 36 | case rotate_90_degrees: 37 | m_rotation=std::complex(0.0f, 1.0f); 38 | break; 39 | 40 | case rotate_180_degrees: 41 | m_rotation=std::complex(-1.0f, 0.0f); 42 | break; 43 | 44 | case rotate_270_degrees: 45 | m_rotation=std::complex(0.0f, -1.0f); 46 | break; 47 | } 48 | } 49 | 50 | 51 | enum return_code 52 | WRATH2DRigidTransformation:: 53 | rotation(const std::complex &r) 54 | { 55 | float m; 56 | 57 | m=std::abs(r); 58 | if(m 16 | * 17 | */ 18 | 19 | 20 | #include "WRATHConfig.hpp" 21 | 22 | void 23 | WRATHInternalNewInit(void); 24 | 25 | void 26 | WRATHInternalMallocInit(void); 27 | 28 | void 29 | WRATHStaticInit(void) 30 | { 31 | WRATHInternalNewInit(); 32 | WRATHInternalMallocInit(); 33 | } 34 | -------------------------------------------------------------------------------- /text_viewer_data/directoy_listing_example.txt: -------------------------------------------------------------------------------- 1 | \cmd{PP raw:true} 2 | \cmd{directory_listing .} 3 | -------------------------------------------------------------------------------- /text_viewer_data/examples/ALPHABET: -------------------------------------------------------------------------------- 1 | \cmd{PP width:10000} 2 | \cmd{underline on} 3 | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\n 4 | \cmd{underline off} 5 | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\n -------------------------------------------------------------------------------- /text_viewer_data/examples/abbrev_revel_red.txt: -------------------------------------------------------------------------------- 1 | \cmd{link revel_green.txt} 2 | \cmd{strike on} 3 | \cmd{color r:255 g:100 b:100} 4 | \cmd{include_utf8 abbrev_revlations.wutf8} 5 | \n\n 6 | \cmd{strike off} 7 | \cmd{color r:255 g:100 b:100} 8 | \cmd{PP raw:false} 9 | \cmd{include_utf8 abbrev_revlations.wutf8} 10 | 11 | -------------------------------------------------------------------------------- /text_viewer_data/examples/abbrev_revlations.wutf8: -------------------------------------------------------------------------------- 1 | \t\t\t\tΑΠΟΚΑΛΥΨΙΣ ΙΩΑΝΝΟΥ\n\n 2 | 3 | Α͵.᾽Αποκάλυψις ᾽Ιησοῦ Χριστοῦ, ἣν ἔδωκεν αὐτῷ ὁ Θεός, δεῖξαι τοῖς 4 | δούλοις αὐτοῦ ἃ δεῖ γενέσθαι ἐν τάχει, καὶ ἐσήμανεν ἀποστείλας διὰ 5 | τοῦ ἀγγέλου αὐτοῦ τῷ δούλῳ αὐτοῦ ᾽Ιωάννῃ, ὃς ἐμαρτύρησε τὸν λόγον τοῦ 6 | Θεοῦ καὶ τὴν μαρτυρίαν ᾽Ιησοῦ Χριστοῦ, ὅσα εἶδε. μακάριος ὁ 7 | ἀναγινώσκων καὶ οἱ ἀκούοντες τοὺς λόγους τῆς προφητείας καὶ τηροῦντες 8 | τὰ ἐν αὐτῇ γεγραμμένα· ὁ γὰρ καιρὸς ἐγγύς. ᾽Ιωάννης ταῖς ἑπτὰ ἐκκλησίαις 9 | ταῖς ἐν τῇ ᾽Ασίᾳ· χάρις ὑμῖν καὶ εἰρήνη ἀπὸ Θεοῦ, ὁ ὢν καὶ ὁ ἦν καὶ ὁ 10 | ἐρχόμενος, καὶ ἀπὸ τῶν ἑπτὰ πνευμάτων, ἃ ἐνώπιον τοῦ θρόνου 11 | αὐτοῦ, καὶ ἀπὸ ᾽Ιησοῦ Χριστοῦ, ὁ μάρτυς ὁ πιστός, ὁ πρωτότοκος τῶν 12 | νεκρῶν καὶ ὁ ἄρχων τῶν βασιλέων τῆς γῆς. τῷ ἀγαπῶντι ἡμᾶς καὶ λούσαντι 13 | ἡμᾶς ἀπὸ τῶν ἁμαρτιῶν ἡμῶν ἐν τῷ αἵματι αὐτοῦ, καὶ ἐποίησεν ἡμᾶς 14 | βασιλείαν, ἱερεῖς τῷ Θεῷ καὶ πατρὶ αὐτοῦ, αὐτῷ ἡ δόξα καὶ τὸ κράτος εἰς 15 | τοὺς αἰῶνας τῶν αἰώνων· ἀμήν. ᾽Ιδοὺ ἔρχεται μετὰ τῶν νεφελῶν, καὶ ὄψεται 16 | αὐτὸν πᾶς ὀφθαλμὸς καὶ οἵτινες αὐτὸν ἐξεκέντησαν, καὶ κόψονται ἐπ᾽ αὐτὸν 17 | πᾶσαι αἱ φυλαὶ τῆς γῆς. ναί, ἀμήν. ᾽Εγώ εἰμι τὸ Α καὶ τὸ Ω, λέγει Κύριος 18 | ὁ Θεός, ὁ ὢν καὶ ὁ ἦν καὶ ὁ ἐρχόμενος, ὁ παντοκράτωρ. ᾽Εγὼ ᾽Ιωάννης, ὁ 19 | βιβλίῳ τῆς ζωῆς τοῦ ἀρνίου. 20 | 21 | ΚΒ͵. Καὶ ἔδειξέ μοι ποταμὸν ὕδατος ζωῆς λαμπρὸν ὡς κρύσταλλον, 22 | ἐκπορευόμενον ἐκ τοῦ θρόνου τοῦ Θεοῦ καὶ τοῦ ἀρνίου. ἐν μέσῳ τῆς πλατείας 23 | αὐτῆς καὶ τοῦ ποταμοῦ ἐντεῦθεν καὶ ἐκεῖθεν ξύλον ζωῆς, ποιοῦν καρποὺς 24 | δώδεκα, κατὰ μῆνα ἕκαστον ἀποδιδοῦν τὸν καρπὸν αὐτοῦ, καὶ τὰ φύλλα τοῦ 25 | ξύλου εἰς θεραπείαν τῶν ἐθνῶν. καὶ πᾶν κατάθεμα οὐκ ἔστ 26 | -------------------------------------------------------------------------------- /text_viewer_data/examples/example_font_size.txt: -------------------------------------------------------------------------------- 1 | \cmd{font_size 6} 2 | 6:Hello World 3 | 4 | \cmd{font_size 8} 5 | 8:Hello World 6 | 7 | \cmd{font_size 10} 8 | 10:Hello World 9 | 10 | \cmd{font_size 12} 11 | 12:Hello World 12 | 13 | \cmd{font_size 24} 14 | 24:Hello World 15 | 16 | \cmd{font_size 36} 17 | 36:Hello World 18 | 19 | \cmd{font_size 48} 20 | 48:Hello World 21 | 22 | \cmd{font_size 64} 23 | 64:Hello World -------------------------------------------------------------------------------- /text_viewer_data/examples/font_test_small.txt: -------------------------------------------------------------------------------- 1 | 2 | \cmd{font_size 32} 3 | Font Size 32\n\n 4 | \cmd{include_file ALPHABET}\n\n 5 | 6 | \cmd{font_size 30} 7 | Font Size 30\n\n 8 | \cmd{include_file ALPHABET}\n\n 9 | 10 | \cmd{font_size 28} 11 | Font Size 28\n\n 12 | \cmd{include_file ALPHABET}\n\n 13 | 14 | \cmd{font_size 26} 15 | Font Size 26\n\n 16 | \cmd{include_file ALPHABET}\n\n 17 | 18 | \cmd{font_size 24} 19 | Font Size 24\n\n 20 | \cmd{include_file ALPHABET}\n\n 21 | 22 | \cmd{font_size 22} 23 | Font Size 22\n\n 24 | \cmd{include_file ALPHABET}\n\n 25 | 26 | \cmd{font_size 20} 27 | Font Size 20\n\n 28 | \cmd{include_file ALPHABET}\n\n 29 | 30 | \cmd{font_size 18} 31 | Font Size 18\n\n 32 | \cmd{include_file ALPHABET}\n\n 33 | 34 | \cmd{font_size 16} 35 | Font Size 16\n\n 36 | \cmd{include_file ALPHABET}\n\n 37 | 38 | \cmd{font_size 14} 39 | Font Size 14\n\n 40 | \cmd{include_file ALPHABET}\n\n 41 | 42 | \cmd{font_size 12} 43 | Font Size 12\n\n 44 | \cmd{include_file ALPHABET}\n\n 45 | 46 | \cmd{font_size 10} 47 | Font Size 10\n\n 48 | \cmd{include_file ALPHABET}\n\n 49 | 50 | \cmd{font_size 8} 51 | Font Size 8\n\n 52 | \cmd{include_file ALPHABET}\n\n 53 | 54 | \cmd{font_size 6} 55 | Font Size 6\n\n 56 | \cmd{include_file ALPHABET}\n\n 57 | 58 | \cmd{font_size 4} 59 | Font Size 4\n\n 60 | \cmd{include_file ALPHABET}\n\n 61 | -------------------------------------------------------------------------------- /text_viewer_data/examples/image_test.txt: -------------------------------------------------------------------------------- 1 | \cmd{image name:../../images/image_cp1.png} 2 | \cmd{image name:../../images/image_cp2.png} 3 | \cmd{image name:../../images/image_cp3.png} 4 | \cmd{image name:../../images/image_cp4.png} 5 | \cmd{image name:../../images/image_cp5.png} 6 | \cmd{image name:../../images/image_cp5.png} 7 | \cmd{image name:../../images/512.512.diagonal.png} 8 | 9 | \cmd{image name:../../images/white.png} 10 | \cmd{image name:../../images/512.512.png} 11 | \cmd{image name:../../images/1024x1024.png} 12 | \cmd{image name:../../images/screenshot.png} 13 | 14 | \cmd{link jj.txt} 15 | -------------------------------------------------------------------------------- /text_viewer_data/examples/kk.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | \cmd{strike on} 4 | \cmd{underline on} 5 | Double Hit 6 | \cmd{color 200 200 255 255} 7 | Double Hit 8 | 9 | \cmd{strike off} 10 | \cmd{color 255 255 255 255} 11 | UNDERLINE 12 | \cmd{color 200 200 255 255} 13 | UNDERLINE 14 | 15 | \cmd{strike on} 16 | \cmd{underline off} 17 | \cmd{color 255 255 255 255} 18 | STRIKE 19 | \cmd{color 200 200 255 255} 20 | STRIKE 21 | 22 | \cmd{strike on} 23 | \cmd{underline on} 24 | \cmd{color 255 255 255 255} 25 | Double Hit \cmd{color 200 200 255 255} Double Hit 26 | \cmd{strike on} 27 | SOME-junk-text.txt 28 | 29 | \cmd{link junk-text.txt LinkTojunk-text} 30 | 31 | \cmd{link revel_red RevelationsInRed} 32 | 33 | \cmd{link revel_green RevelationsInGreen} 34 | 35 | 36 | \cmd{color 255 255 255 255} 37 | \cmd{underline off} 38 | Another Strike 39 | \cmd{underline on} 40 | \cmd{strike off} 41 | UNDERLINE 42 | 43 | 44 | \cmd{push_font_size 30} 45 | Directory listing for "./" 46 | \cmd{pop_font_size 30} 47 | \cmd{directory_listing ./} 48 | -------------------------------------------------------------------------------- /text_viewer_data/examples/little_column.txt: -------------------------------------------------------------------------------- 1 | \cmd{COL 2 | count:2 3 | space:10.0 4 | 5 | file0:../../images/1024x1024.png 6 | type0:image 7 | width0:500 8 | 9 | file1:abbrev_revlations.wutf8 10 | alignment1:left 11 | type1:spill_utf8 12 | width1:400 13 | } 14 | -------------------------------------------------------------------------------- /text_viewer_data/examples/little_column2.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | \cmd{COL 4 | count:2 5 | space:10.0 6 | 7 | file0:../../images/screenshot.png 8 | type0:image 9 | width0:1000 10 | 11 | reset1:false 12 | type1:spill 13 | width1:300 14 | } 15 | 16 | \cmd{include_utf8 abbrev_revlations.wutf8} 17 | -------------------------------------------------------------------------------- /text_viewer_data/examples/revel_green.txt: -------------------------------------------------------------------------------- 1 | \cmd{link revel_red.txt} 2 | \cmd{color r:100 g:255 b:100} 3 | \cmd{PP raw:true} 4 | \cmd{include_raw_utf8 revelation.wutf8} 5 | \cmd{bgcolor r:00 g:0 b:0} 6 | -------------------------------------------------------------------------------- /text_viewer_data/examples/revel_red.txt: -------------------------------------------------------------------------------- 1 | \cmd{link revel_green.txt} 2 | \cmd{strike on} 3 | \cmd{color r:255 g:100 b:100} 4 | \cmd{PP raw:true} 5 | \cmd{include_raw_utf8 revelation.wutf8} 6 | \cmd{strike off} 7 | \n\n 8 | -------------------------------------------------------------------------------- /text_viewer_data/examples/simple_shape.txt: -------------------------------------------------------------------------------- 1 | Some Example Shapes:\n\n 2 | 3 | \cmd{set_tess_params max_recurse:6 curve_tess:100} 4 | 5 | 6 | 7 | \cmd{create_shape triangle [ (60 60) (100 300) (300 300) ] } 8 | 9 | 10 | \n\nStroking: 11 | Curvy Triangle:\n 12 | \cmd{stroke shape:triangle 13 | width:4 14 | close:true 15 | cap_style:flat 16 | stroke_curves:true 17 | join_style:round miter_limit:10} 18 | 19 | \cmd{fill shape:triangle width:15 } 20 | 21 | 22 | 23 | 24 | That is all folks! 25 | -------------------------------------------------------------------------------- /text_viewer_data/examples/tt.txt: -------------------------------------------------------------------------------- 1 | \cmd{PP} 2 | \cmd{strike on} 3 | \cmd{underline off} 4 | \cmd{color r:255 g:255 b:255 a:255} 5 | Strike Hit\n 6 | \cmd{color r:200 g:200 b:255 a:255} 7 | Strike Hit\n 8 | \cmd{color r:200 g:200 b:255 a:255} 9 | GIGGLES 10 | \cmd{underline on} 11 | Double Hit\n -------------------------------------------------------------------------------- /text_viewer_data/examples/underline.txt: -------------------------------------------------------------------------------- 1 | \cmd{PP raw:true} 2 | ypj yApAjA 3 | \cmd{underline on} 4 | ypj yApAjA -------------------------------------------------------------------------------- /text_viewer_data/examples/utf8.txt: -------------------------------------------------------------------------------- 1 | \cmd{color 0:255 g:0 b:0} 2 | \cmd{PP raw:true} 3 | From: 4 | \cmd{push_color r:0 b:255 g:0} 5 | \cmd{push_underline true} 6 | http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt 7 | \cmd{pop_underline} 8 | \cmd{pop_color}\n\n 9 | Formatting is not w3c conforming, since using a formatter 10 | of WRATH with kerning and variable width formatting 11 | and all those joys. 12 | 13 | \cmd{include_raw_utf8 UTF-8-demo.wutf8} 14 | \cmd{strike off} 15 | \n\n 16 | -------------------------------------------------------------------------------- /text_viewer_data/nested_script_example.txt: -------------------------------------------------------------------------------- 1 | 2 | base\cmd{begin_super_script}super\cmd{begin_sub_script}sub-of-super 3 | \cmd{end_sub_script}\cmd{end_super_script} -------------------------------------------------------------------------------- /text_viewer_data/qt_text_viewer_commandline.txt: -------------------------------------------------------------------------------- 1 | \cmd{PP raw:false} 2 | \cmd{push_font_size 67} 3 | \cmd{push_underline on} 4 | qt_text_viewer command line options 5 | \cmd{pop_font_size} 6 | \cmd{pop_underline} 7 | \cmd{PP raw:true} 8 | \cmd{include_file qt_text_viewer_help_output} 9 | -------------------------------------------------------------------------------- /unfinished/Readme.txt: -------------------------------------------------------------------------------- 1 | This directory is a dumping ground for various source and header files of classes and functions that are either unfinished or not even started 2 | -------------------------------------------------------------------------------- /unfinished/imperative/Rules.mk: -------------------------------------------------------------------------------- 1 | # Begin standard header 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | # End standard header 6 | 7 | INCLUDES += -I$(d) 8 | 9 | # Begin standard footer 10 | d := $(dirstack_$(sp)) 11 | sp := $(basename $(sp)) 12 | # End standard footer 13 | -------------------------------------------------------------------------------- /unix_util/kill_links.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cp --dereference --recursive $1 $1.temp 3 | rm $1 4 | mv $1.temp $1 5 | -------------------------------------------------------------------------------- /unix_util/readme.txt: -------------------------------------------------------------------------------- 1 | I have this here, because I cannot remember the way to use find. 2 | -------------------------------------------------------------------------------- /unix_util/remove_tab.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # use with 4 | # grep -Prl "\t" path1 path2 ... | xargs 5 | # to remove tabs from a bunch of files 6 | for ARG in "$@" 7 | do 8 | cp $ARG tmp 9 | expand tmp > $ARG 10 | rm tmp 11 | done -------------------------------------------------------------------------------- /unix_util/sed_replace_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for ARG in "$@" 3 | do 4 | # find $ARG -type f -exec echo "sed -i -e 's/before/after/g'" {} \; 5 | find $ARG -type f -exec sed -i -e 's/before/after/g' {} \; 6 | done 7 | -------------------------------------------------------------------------------- /wrath.spec: -------------------------------------------------------------------------------- 1 | Name: wrath 2 | Summary: libWRATH_Qt 3 | Version: 1.0 4 | Release: 1 5 | Group: System/Libraries 6 | License: GPL 7 | URL: http://www.nomovok.com 8 | Source0: wrath-1.0.tar.gz 9 | Patch0: boost_locale.patch 10 | 11 | BuildRequires: flex 12 | BuildRequires: qt-devel >= 4.8 13 | BuildRequires: pkgconfig(QtOpenGL) 14 | BuildRequires: freetype 15 | BuildRequires: freetype-devel 16 | BuildRequires: boost-devel 17 | BuildRequires: pkgconfig(glesv2) 18 | BuildRequires: pkgconfig(fontconfig) 19 | 20 | 21 | %description 22 | WRATH Qt library 23 | 24 | %prep 25 | %setup -q -n %{name}-%{version} 26 | %patch0 -p1 27 | 28 | %build 29 | #make wrath-lib-qt 30 | make wrath-lib-qt %{?_smp_mflags} 31 | 32 | %install 33 | #rm -rf %{buildroot} 34 | mkdir -p %{buildroot}/usr/lib 35 | install release/libWRATH_Qt_Release.so* $RPM_BUILD_ROOT/usr/lib 36 | 37 | %post -p /sbin/ldconfig 38 | 39 | %postun -p /sbin/ldconfig 40 | 41 | %files 42 | %defattr(-,root,root,-) 43 | /usr/lib/libWRATH_Qt_Release.so* 44 | --------------------------------------------------------------------------------