Dali 3D User Interface Engine
Classes | Namespaces | Macros
shader.h File Reference
#include <string>
#include <dali/public-api/object/handle.h>
#include <dali/public-api/object/property-index-ranges.h>
Include dependency graph for shader.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Dali::Shader
 Shaders allows custom vertex and color transformations in the GPU. More...
 
struct  Dali::Shader::Property
 An enumeration of properties belonging to the Shader class. More...
 

Namespaces

namespace  Dali
 The top level DALi namespace.
 
namespace  Dali::DALI_INTERNAL
 

Macros

#define DALI_COMPOSE_SHADER(STR)   #STR
 DALI_COMPOSE_SHADER macro provides a convenient way to write shader source code. More...
 

Macro Definition Documentation

#define DALI_COMPOSE_SHADER (   STR)    #STR

DALI_COMPOSE_SHADER macro provides a convenient way to write shader source code.

We normally use double quotation marks to write a string such as "Hello World". However many symbols are needed to add multiple lines of string. We don't need to write quotation marks using this macro at every line.

[An example of double quotation marks usage]

const string FRAGMENT_SHADER_SOURCE = \
"  void main()\n"
"  {\n"
"    gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n"
"  }\n";


[An example of DALI_COMPOSE_SHADER usage]

const string VERTEX_SHADER_SOURCE = DALI_COMPOSE_SHADER (
  void main()
  {
    gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);
    vTexCoord = aTexCoord;
  }
);

Definition at line 54 of file shader.h.

Referenced by Dali::Toolkit::CreateBouncingEffect(), Dali::Toolkit::Internal::CreateBubbleShader(), Dali::Toolkit::Internal::CreateColorAdjuster(), Dali::Toolkit::CreateDissolveEffect(), Dali::Toolkit::CreateDistanceFieldEffect(), Dali::Toolkit::Internal::CreatePageTurnBookSpineEffect(), Dali::Toolkit::Internal::CreatePageTurnEffect(), and Dali::Toolkit::CreateQuadraticBezier().

Dali Docs Home
Read more about Dali