Back to index

nux  3.0.0
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
nux::GraphicsEngine Class Reference

Rendering engine class. More...

#include <GraphicsEngine.h>

Collaboration diagram for nux::GraphicsEngine:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GraphicsEngine (GraphicsDisplay &GlWindow, bool create_rendering_data=true)
 ~GraphicsEngine ()
void SetContext (int x, int y, int width, int height)
void GetContextSize (int &w, int &h) const
int GetContextWidth () const
int GetContextHeight () const
int GetContextX () const
int GetContextY () const
void GetWindowSize (int &w, int &h) const
int GetWindowWidth () const
int GetWindowHeight () const
BaseTextureLoad2DTextureFile (const char *filename)
BaseTextureLoad2DRectangleTextureFile (const char *filename)
BaseTextureLoad2DTextureFileGenerateAlpha (const char *filename, int red, int green, int blue)
void SetTexture (int TextureUnit, BaseTexture *Texture)
void SetTexture (int TextureUnit, ObjectPtr< IOpenGLBaseTexture > Texture)
void EnableTextureMode (int TextureUnit, int TextureMode)
void DisableTextureMode (int TextureUnit, int TextureMode)
void DisableAllTextureMode (int TextureUnit)
void QRP_1Tex (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > Tex0, TexCoordXForm &texxform, const Color &color0)
void QRP_Pixelate (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture, TexCoordXForm &texxform, const Color &c0, int pixel_size)
void QRP_Color (int x, int y, int width, int height, const Color &c0)
void QRP_Color (int x, int y, int width, int height, const Color &c0, const Color &c1, const Color &c2, const Color &c3)
void QRP_ColorModTexAlpha (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture, TexCoordXForm &texxform0, const Color &color)
void QRP_2Tex (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, ObjectPtr< IOpenGLBaseTexture > DeviceTexture1, TexCoordXForm &texxform1, const Color &color1)
void QRP_2TexMod (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, ObjectPtr< IOpenGLBaseTexture > DeviceTexture1, TexCoordXForm &texxform1, const Color &color1)
void QRP_4Tex (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, ObjectPtr< IOpenGLBaseTexture > DeviceTexture1, TexCoordXForm &texxform1, const Color &color1, ObjectPtr< IOpenGLBaseTexture > DeviceTexture2, TexCoordXForm &texxform2, const Color &color2, ObjectPtr< IOpenGLBaseTexture > DeviceTexture3, TexCoordXForm &texxform3, const Color &color3)
void QRP_Triangle (int x0, int y0, int x1, int y1, int x2, int y2, Color c0)
void QRP_Triangle (int x0, int y0, int x1, int y1, int x2, int y2, Color c0, Color c1, Color c2)
void QRP_Line (int x0, int y0, int x1, int y1, Color c0)
void QRP_Line (int x0, int y0, int x1, int y1, Color c0, Color c1)
void QRP_QuadWireframe (int x0, int y0, int width, int height, Color c0, Color c1, Color c2, Color c3)
ObjectPtr< IOpenGLBaseTextureQRP_GetBlurTexture (int x, int y, int buffer_width, int buffer_height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f, int num_pass=1)
ObjectPtr< IOpenGLBaseTextureQRP_GetAlphaTexture (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0)
ObjectPtr< IOpenGLBaseTextureQRP_GetColorMatrixTexture (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, Matrix4 color_matrix, Vector4 offset)
ObjectPtr< IOpenGLBaseTextureQRP_GetPower (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, const Vector4 &exponent)
ObjectPtr< IOpenGLBaseTextureQRP_GetLQBlur (int x, int y, int buffer_width, int buffer_height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0)
ObjectPtr< IOpenGLBaseTextureQRP_GetHQBlur (int x, int y, int buffer_width, int buffer_height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f, int num_pass=1)
void QRP_DisturbedTexture (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > distorsion_texture, TexCoordXForm &texxform0, const Color &c0, ObjectPtr< IOpenGLBaseTexture > src_device_texture, TexCoordXForm &texxform1, const Color &c1)
ObjectPtr< IOpenGLBaseTextureQRP_GetPixelBlocks (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform0, const Color &c0, int pixel_size)
void QRP_GetCopyTexture (int width, int height, ObjectPtr< IOpenGLBaseTexture > &dst_device_texture, ObjectPtr< IOpenGLBaseTexture > &src_device_texture, TexCoordXForm &texxform0, const Color &c0)
void QRP_ASM_1Tex (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > Tex0, TexCoordXForm &texxform, const Color &color0)
void QRP_ASM_Pixelate (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture, TexCoordXForm &texxform, const Color &c0, int pixel_size)
void QRP_ASM_Color (int x, int y, int width, int height, const Color &c0)
void QRP_ASM_Color (int x, int y, int width, int height, const Color &c0, const Color &c1, const Color &c2, const Color &c3)
void QRP_ASM_ColorModTexAlpha (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture, TexCoordXForm &texxform0, const Color &color)
void QRP_ASM_2Tex (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, ObjectPtr< IOpenGLBaseTexture > DeviceTexture1, TexCoordXForm &texxform1, const Color &color1)
void QRP_ASM_2TexMod (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, ObjectPtr< IOpenGLBaseTexture > DeviceTexture1, TexCoordXForm &texxform1, const Color &color1)
void QRP_ASM_4Tex (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, ObjectPtr< IOpenGLBaseTexture > DeviceTexture1, TexCoordXForm &texxform1, const Color &color1, ObjectPtr< IOpenGLBaseTexture > DeviceTexture2, TexCoordXForm &texxform2, const Color &color2, ObjectPtr< IOpenGLBaseTexture > DeviceTexture3, TexCoordXForm &texxform3, const Color &color3)
void QRP_ASM_Triangle (int x0, int y0, int x1, int y1, int x2, int y2, Color c0)
void QRP_ASM_Triangle (int x0, int y0, int x1, int y1, int x2, int y2, Color c0, Color c1, Color c2)
void QRP_ASM_Line (int x0, int y0, int x1, int y1, Color c0)
void QRP_ASM_Line (int x0, int y0, int x1, int y1, Color c0, Color c1)
void QRP_ASM_QuadWireframe (int x0, int y0, int width, int height, Color c0, Color c1, Color c2, Color c3)
void QRP_ASM_Power (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, Vector4 exponent)
void QRP_ASM_AlphaReplicate (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0)
void QRP_ASM_HorizontalGauss (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f)
void QRP_ASM_VerticalGauss (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f)
void QRP_ASM_ColorMatrix (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, Matrix4 color_matrix, Vector4 offset)
ObjectPtr< IOpenGLBaseTextureQRP_ASM_GetBlurTexture (int x, int y, int buffer_width, int buffer_height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &color, float sigma=1.0f, int num_pass=1)
 Blur texture.
void QRP_ASM_GetBlurTextureFx (int x, int y, int buffer_width, int buffer_height, FxStructure *fx_structure, TexCoordXForm &texxform, const Color &color, float sigma=1.0f, int num_pass=1)
ObjectPtr< IOpenGLBaseTextureQRP_ASM_GetAlphaTexture (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &color)
 Replicate the alpha channel in all components of the texture.
ObjectPtr< IOpenGLBaseTextureQRP_ASM_GetColorMatrixTexture (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c, Matrix4 color_matrix, Vector4 offset)
 Color matrix filter.
ObjectPtr< IOpenGLBaseTextureQRP_ASM_GetPower (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, const Vector4 &exponent)
 Texture components raised to a power.
ObjectPtr< IOpenGLBaseTextureQRP_ASM_GetLQBlur (int x, int y, int buffer_width, int buffer_height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0)
ObjectPtr< IOpenGLBaseTextureQRP_ASM_GetHQBlur (int x, int y, int buffer_width, int buffer_height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f, int num_pass=1)
void QRP_ASM_DisturbedTexture (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > distorsion_texture, TexCoordXForm &texxform0, const Color &c0, ObjectPtr< IOpenGLBaseTexture > src_device_texture, TexCoordXForm &texxform1, const Color &c1)
ObjectPtr< IOpenGLBaseTextureQRP_ASM_GetPixelBlocks (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform0, const Color &color, int pixel_size)
 Pixel blocks.
void QRP_ASM_GetCopyTexture (int width, int height, ObjectPtr< IOpenGLBaseTexture > &dst_device_texture, ObjectPtr< IOpenGLBaseTexture > &src_device_texture, TexCoordXForm &texxform0, const Color &c0)
void QRP_GLSL_1Tex (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture, TexCoordXForm &texxform, const Color &c0)
void QRP_GLSL_Pixelate (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture, TexCoordXForm &texxform, const Color &c0, int pixel_size)
void QRP_GLSL_Color (int x, int y, int width, int height, const Color &c0)
void QRP_GLSL_Color (int x, int y, int width, int height, const Color &c0, const Color &c1, const Color &c2, const Color &c3)
void QRP_GLSL_ColorModTexAlpha (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture, TexCoordXForm &texxform0, const Color &color)
void QRP_GLSL_2Tex (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, ObjectPtr< IOpenGLBaseTexture > DeviceTexture1, TexCoordXForm &texxform1, const Color &color1)
void QRP_GLSL_2TexMod (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, ObjectPtr< IOpenGLBaseTexture > DeviceTexture1, TexCoordXForm &texxform1, const Color &color1)
void QRP_GLSL_4Tex (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, ObjectPtr< IOpenGLBaseTexture > DeviceTexture1, TexCoordXForm &texxform1, const Color &color1, ObjectPtr< IOpenGLBaseTexture > DeviceTexture2, TexCoordXForm &texxform2, const Color &color2, ObjectPtr< IOpenGLBaseTexture > DeviceTexture3, TexCoordXForm &texxform3, const Color &color3)
void QRP_GLSL_Triangle (int x0, int y0, int x1, int y1, int x2, int y2, Color c0)
void QRP_GLSL_Triangle (int x0, int y0, int x1, int y1, int x2, int y2, Color c0, Color c1, Color c2)
void QRP_GLSL_Line (int x0, int y0, int x1, int y1, Color c0)
void QRP_GLSL_Line (int x0, int y0, int x1, int y1, Color c0, Color c1)
void QRP_GLSL_QuadWireframe (int x0, int y0, int width, int height, Color c0, Color c1, Color c2, Color c3)
void QRP_GLSL_Power (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, Vector4 exponent)
void QRP_GLSL_AlphaReplicate (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0)
void QRP_GLSL_HorizontalGauss (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f)
void QRP_GLSL_VerticalGauss (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f)
void QRP_GLSL_HorizontalHQGauss (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f)
void QRP_GLSL_VerticalHQGauss (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f)
void QRP_GLSL_ColorMatrix (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, Matrix4 color_matrix, Vector4 offset)
ObjectPtr< IOpenGLBaseTextureQRP_GLSL_GetBlurTexture (int x, int y, int buffer_width, int buffer_height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f, int num_pass=1)
ObjectPtr< IOpenGLBaseTextureQRP_GLSL_GetAlphaTexture (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0)
ObjectPtr< IOpenGLBaseTextureQRP_GLSL_GetColorMatrixTexture (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, Matrix4 color_matrix, Vector4 offset)
ObjectPtr< IOpenGLBaseTextureQRP_GLSL_GetPower (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, const Vector4 &exponent)
ObjectPtr< IOpenGLBaseTextureQRP_GLSL_GetLQBlur (int x, int y, int buffer_width, int buffer_height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0)
ObjectPtr< IOpenGLBaseTextureQRP_GLSL_GetHQBlur (int x, int y, int buffer_width, int buffer_height, ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f, int num_pass=1)
void QRP_GLSL_GetHQBlurFx (int x, int y, int buffer_width, int buffer_height, FxStructure *fx_structure, TexCoordXForm &texxform, const Color &c0, float sigma=1.0f, int num_pass=1)
void QRP_GLSL_DisturbedTexture (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > distorsion_texture, TexCoordXForm &texxform0, const Color &c0, ObjectPtr< IOpenGLBaseTexture > src_device_texture, TexCoordXForm &texxform1, const Color &c1)
ObjectPtr< IOpenGLBaseTextureQRP_GLSL_GetDisturbedTexture (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > distorsion_texture, TexCoordXForm &texxform0, const Color &c0, ObjectPtr< IOpenGLBaseTexture > src_device_texture, TexCoordXForm &texxform1, const Color &c1)
void QRP_GLSL_GetDisturbedTextureFx (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > distorsion_texture, TexCoordXForm &texxform0, const Color &c0, FxStructure *fx_structure, TexCoordXForm &texxform1, const Color &c1)
ObjectPtr< IOpenGLBaseTextureQRP_GLSL_GetPixelBlocks (ObjectPtr< IOpenGLBaseTexture > device_texture, TexCoordXForm &texxform0, const Color &c0, int pixel_size)
 Pixel blocks.
void QRP_GLSL_GetCopyTexture (int width, int height, ObjectPtr< IOpenGLBaseTexture > &dst_device_texture, ObjectPtr< IOpenGLBaseTexture > &src_device_texture, TexCoordXForm &texxform0, const Color &c0)
void PushClippingRectangle (Rect rect)
void PopClippingRectangle ()
void EmptyClippingRegion ()
void ApplyClippingRectangle ()
 Set the clipping according to the clipping rectangle stack.
void SetGlobalClippingRectangle (Rect rect)
void DisableGlobalClippingRectangle ()
void SetClippingRectangle (const Rect &rect)
 Bypass the clipping rectangle stack and set a different clipping rectangle region.
void SetOpenGLClippingRectangle (int x, int y, unsigned int width, unsigned int height)
 Bypass the clipping rectangle stack and set a different clipping rectangle region.
Rect GetClippingRegion () const
int GetNumberOfClippingRegions () const
void AddClipOffset (int x, int y)
 Deprecated.
void PushClipOffset (int x, int y)
void PopClipOffset ()
void ClearAreaColorDepthStencil (int x, int y, int width, int height, Color clearcolor, float cleardepth, int clearstencil)
void ClearAreaColor (int x, int y, int width, int height, Color clearcolor)
void ClearAreaDepthStencil (int x, int y, int width, int height, float cleardepth, int clearstencil)
void Set3DView (int w, int h)
void Push2DWindow (int w, int h)
 Push a screen aligned 2D matrix.
void Pop2DWindow ()
void Push2DModelViewMatrix (Matrix4 mat)
Matrix4 Pop2DModelViewMatrix ()
void Clear2DModelViewMatrix ()
void SetViewport (int x, int y, int w, int h)
Rect GetViewportRect () const
int GetViewportWidth () const
int GetViewportHeight () const
int GetViewportX () const
int GetViewportY () const
void GetViewportSize (int &viewport_width, int &viewport_height) const
void SetScissor (int x, int y, int w, int h)
void SetScissorOffset (int x, int y)
 When setting a matrix to translate the widgets, the scissor region is not translated accordingly.
Rect GetScissorRect ()
void EnableScissoring (bool b)
int RenderColorText (ObjectPtr< FontTexture > Font, int x, int y, const NString &Str, const Color &TextColor, bool WriteAlphaChannel, int NumCharacter)
int RenderColorTextLineStatic (ObjectPtr< FontTexture > Font, const PageBBox &pageSize, const NString &Str, const Color &TextColor, bool WriteAlphaChannel, TextAlignment alignment)
int RenderColorTextLineEdit (ObjectPtr< FontTexture > Font, const PageBBox &pageSize, const NString &Str, const Color &TextColor, bool WriteAlphaChannel, const Color &SelectedTextColor, const Color &SelectedTextBackgroundColor, const Color &TextBlinkColor, const Color &CursorColor, bool ShowCursor, unsigned int CursorPosition, int offset=0, int selection_start=0, int selection_end=0)
ObjectPtr< IOpenGLBaseTextureCreateTextureFromBackBuffer (int x, int y, int width, int height)
void ResetStats ()
ObjectPtr< CachedResourceDataCacheResource (ResourceData *Resource)
 Cache a resource if it has previously been cached.
void UpdateResource (ResourceData *Resource)
 Update a resource if it has previously been cached.
bool FlushCachedResourceData (ResourceData *Resource)
bool IsResourceCached (ResourceData *Resource)
Matrix4 GetProjectionMatrix ()
Matrix4 GetOpenGLProjectionMatrix ()
 Return the transpose version of GetProjectionMatrix();.
void SetProjectionMatrix (const Matrix4 &matrix)
void SetOrthographicProjectionMatrix (int viewport_width, int viewport_height)
 Set orthographic projection matrix.
void ResetProjectionMatrix ()
 Reset the projection matrix to identity.
Matrix4 GetModelViewMatrix ()
Matrix4 GetOpenGLModelViewMatrix ()
 Return the transpose version of GetModelViewMatrix();.
Matrix4 GetModelViewProjectionMatrix ()
Matrix4 GetOpenGLModelViewProjectionMatrix ()
GpuRenderStatesGetRenderStates ()
void ResetRenderStates ()
void VerifyRenderStates ()
ObjectPtr< FontTextureGetFont ()
ObjectPtr< FontTextureGetBoldFont ()
bool UsingGLSLCodePath ()
 Return True is GraphicsEngine is using the GLSL shader code path.
bool UsingARBProgramCodePath ()
 Return True is GraphicsEngine is using the ARB program code path.
void PushModelViewMatrix (const Matrix4 &matrix)
 Push a model view matrix on the stack.
void PushIdentityModelViewMatrix ()
 Push an Identity model view matrix on the stack.
void Push2DTranslationModelViewMatrix (float tx, float ty, float tz)
 Push a 2D Translation model view matrix.
bool PopModelViewMatrix ()
 Pop a model view matrix off the stack.
void ResetModelViewMatrixStack ()
 Reset the model view matrix to identity.
void SetModelViewMatrix (const Matrix4 &matrix)
 Bypass the model view matrix stack and set a custom matrix.
void ApplyModelViewMatrix ()
 Set the model view matrix according to the model view matrix stack.
Rect ModelViewXFormRect (const Rect &rect)
 Transform a rectangle with the model view matrix.
int ModelViewStackDepth ()
 Return the depth of the model view matrix stack.
void PushProjectionMatrix (const Matrix4 &matrix)
 Push a projection matrix on the stack.
bool PopProjectionMatrix ()
 Pop a projection matrix off the stack.
int ProjectionStackDepth ()
 Return the depth of the projection matrix stack.
void PushPorterDuffBlend (const PorterDuffOperator &porter_duff_op)
 Push a raster operation configuration setting on the stack.
void PushDisableBlend ()
 Push a state that disables the blending.
void PushBlend (unsigned int src_blend, unsigned int dst_blend)
 Push a custom blend state.
bool PopBlend ()
 Pop a raster operation configuration setting off the stack.
int BlendStackDepth ()
 Return the depth of the raster operation stack.
void QRP_GLSL_ColorBlendOverTex (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > bkg_device_texture, TexCoordXForm &texxform, const Color &color0, const Color &foreground_color, LayerBlendMode layer_blend_mode)
 Blends a color over a texture layer.
void QRP_GLSL_TexBlendOverColor (int x, int y, int width, int height, const Color &background_color, ObjectPtr< IOpenGLBaseTexture > frg_device_texture, TexCoordXForm &texxform0, const Color &color0, LayerBlendMode layer_blend_mode)
 Blends a texture over a color layer.
void QRP_GLSL_TexBlendOverTex (int x, int y, int width, int height, ObjectPtr< IOpenGLBaseTexture > bkg_device_texture, TexCoordXForm &texxform0, const Color &color0, ObjectPtr< IOpenGLBaseTexture > frg_device_texture, TexCoordXForm &texxform1, const Color &color1, LayerBlendMode layer_blend_mode)
 Blends a texture over a texture layer.

Public Attributes

OpenGLContext m_CurrrentContext
std::vector< RectClippingRect
std::list< Matrix4m_2DModelViewMatricesStack
NResourceCache ResourceCache

Private Member Functions

void InitShaders ()
void GaussianWeights (float **weights, float sigma, unsigned int num_tap)
 Helper function to compute a Gaussian filter weights.
void SetFrameBufferHelper (ObjectPtr< IOpenGLFrameBufferObject > &fbo, ObjectPtr< IOpenGLBaseTexture > &colorbuffer, ObjectPtr< IOpenGLBaseTexture > &depthbuffer, int width, int height)
 Helper function to set an fbo.
void InitAsmColorShader ()
void InitAsmTextureShader ()
void InitAsmPixelateShader ()
void InitAsmColorModTexMaskAlpha ()
void InitAsm2TextureAdd ()
void InitAsm2TextureMod ()
void InitAsm4TextureAdd ()
void InitAsmPower ()
void InitAsmAlphaReplicate ()
void InitAsmSeparableGaussFilter ()
void InitAsmColorMatrixFilter ()
void InitAsm2TextureDepRead ()
void InitAsmBlendModes ()
void InitSlColorShader ()
void InitSlTextureShader ()
void InitSlPixelateShader ()
void InitSlColorModTexMaskAlpha ()
void InitSl2TextureAdd ()
void InitSl2TextureDepRead ()
void InitSl2TextureMod ()
void InitSl4TextureAdd ()
void InitSLPower ()
void InitSLAlphaReplicate ()
void InitSLHorizontalGaussFilter ()
void InitSLVerticalGaussFilter ()
void InitSLHorizontalHQGaussFilter (int sigma)
void InitSLVerticalHQGaussFilter (int sigma)
void InitSLColorMatrixFilter ()
void InitSlBlendModes ()
void InitBlendModeNormal ()
void InitBlendModeLighten ()
void InitBlendModeDarken ()
const char *const GetBlendModeBlendFunc (LayerBlendMode layer_blend_mode)
const char *const GetBlendModeString (LayerBlendMode layer_blend_mode)
ObjectPtr< IOpenGLShaderProgramGetColorBlendOverTexProgram (LayerBlendMode layer_blend_mode)
ObjectPtr< IOpenGLShaderProgramGetTexBlendOverColorProgram (LayerBlendMode layer_blend_mode)
ObjectPtr< IOpenGLShaderProgramGetBlendTexTexProgram (LayerBlendMode layer_blend_mode)
void EvaluateGpuCaps ()
 Test the gpu features and set variables such as _use_glsl_shaders.
 GraphicsEngine (const GraphicsEngine &)
GraphicsEngineoperator= (const GraphicsEngine &)
GraphicsEngineoperator& ()

Private Attributes

ObjectPtr< FontTexture_normal_font
 The normal font renderer.
ObjectPtr< FontTexture_bold_font
 The bold font renderer.
ObjectPtr
< IOpenGLAsmShaderProgram
m_AsmColor
 Render polygons with a single color.
ObjectPtr
< IOpenGLAsmShaderProgram
m_AsmTextureModColor
 Render polygons with a texture modulated by a color.
ObjectPtr
< IOpenGLAsmShaderProgram
m_AsmTextureRectModColor
 Same as m_AsmTextureModColor for rectangle textures.
ObjectPtr
< IOpenGLAsmShaderProgram
m_AsmPixelate
 Render a pixelated texture over a polygon.
ObjectPtr
< IOpenGLAsmShaderProgram
m_AsmPixelateRect
 Render a pixelated texture rectangle over a polygon.
ObjectPtr
< IOpenGLAsmShaderProgram
m_AsmColorModTexMaskAlpha
 Render polygons with a color masked by the alpha provided sampling a texture. Requires: Enable GPU Alpha Blending.
ObjectPtr
< IOpenGLAsmShaderProgram
m_AsmColorModTexRectMaskAlpha
ObjectPtr
< IOpenGLAsmShaderProgram
m_Asm2TextureAdd
 Render polygons with 2 textures, each modulated by a color, and added together.
ObjectPtr
< IOpenGLAsmShaderProgram
m_Asm2TextureRectAdd
ObjectPtr
< IOpenGLAsmShaderProgram
m_Asm2TextureMod
 Render polygons with 2 textures, each modulated by a color, and then multiplied together.
ObjectPtr
< IOpenGLAsmShaderProgram
m_Asm2TextureRectMod
ObjectPtr
< IOpenGLAsmShaderProgram
m_Asm4TextureAdd
 Render polygons with 4 textures, each modulated by a color, and added together.
ObjectPtr
< IOpenGLAsmShaderProgram
m_Asm4TextureRectAdd
ObjectPtr
< IOpenGLAsmShaderProgram
_asm_tex_component_exponentiation_prog
 Raise a texture component to a power.
ObjectPtr
< IOpenGLAsmShaderProgram
_asm_texrect_component_exponentiation_prog
ObjectPtr
< IOpenGLAsmShaderProgram
_asm_tex_alpha_replicate_prog
 Replicate the alpha component into r, g and b.
ObjectPtr
< IOpenGLAsmShaderProgram
_asm_texrect_alpha_replicate_prog
ObjectPtr
< IOpenGLAsmShaderProgram
_asm_tex_separable_gauss_filter_prog
 Gauss horizontal filter.
ObjectPtr
< IOpenGLAsmShaderProgram
_asm_texrect_separable_gauss_filter_prog
ObjectPtr
< IOpenGLAsmShaderProgram
_asm_tex_color_matrix_filter_prog
 Color matrix filter.
ObjectPtr
< IOpenGLAsmShaderProgram
_asm_texrect_color_matrix_filter_prog
ObjectPtr
< IOpenGLAsmShaderProgram
m_ASM2TextureDepRead
ObjectPtr
< IOpenGLAsmShaderProgram
m_ASM2TextureRectDepRead
ObjectPtr
< IOpenGLAsmShaderProgram
m_AsmPSBNormal
ObjectPtr
< IOpenGLAsmShaderProgram
m_AsmPSBLighten
ObjectPtr
< IOpenGLAsmShaderProgram
m_AsmPSBDarken
ObjectPtr
< IOpenGLAsmShaderProgram
m_AsmPSBMultiply
ObjectPtr< IOpenGLShaderProgramm_SlColor
 Render polygons with a single color.
ObjectPtr< IOpenGLShaderProgramm_SlTextureModColor
 Render polygons with a texture modulated by a color.
ObjectPtr< IOpenGLShaderProgramm_SLPixelate
 Render a pixelated texture over a polygon.
ObjectPtr< IOpenGLShaderProgramm_SlColorModTexMaskAlpha
 Render polygons with a color masked by the alpha provided sampling a texture. Requires: Enable GPU Alpha Blending.
ObjectPtr< IOpenGLShaderProgramm_SlColorModTexRectMaskAlpha
ObjectPtr< IOpenGLShaderProgramm_Sl2TextureAdd
 Render polygons with 2 textures, each modulated by a color, and added together. result = (tex0*color0)+(tex1*color1)
ObjectPtr< IOpenGLShaderProgramm_Sl2TextureDepRead
 Render a quad with 2 textures. One texture sample is use to offset the coordinates of the second texture read. result = (tex1(coord1.xy + tex0.xy)*color1)
ObjectPtr< IOpenGLShaderProgramm_Sl2TextureMod
 Render polygons with 2 textures, each modulated by a color, and then multiplied together. result = (tex0*color0)*(tex1*color1)
ObjectPtr< IOpenGLShaderProgramm_Sl4TextureAdd
 Render polygons with 4 textures, each modulated by a color, and added together.
ObjectPtr< IOpenGLShaderProgram_component_exponentiation_prog
 Raise a texture component to a power.
ObjectPtr< IOpenGLShaderProgram_alpha_replicate_prog
 Replicate the alpha component into r, g and b.
ObjectPtr< IOpenGLShaderProgram_horizontal_gauss_filter_prog
 Gauss horizontal filter.
ObjectPtr< IOpenGLShaderProgram_vertical_gauss_filter_prog
 Gauss vertical filter.
ObjectPtr< IOpenGLShaderProgram_horizontal_hq_gauss_filter_prog [NUX_MAX_GAUSSIAN_SIGMA]
 Gauss horizontal filter.
ObjectPtr< IOpenGLShaderProgram_vertical_hq_gauss_filter_prog [NUX_MAX_GAUSSIAN_SIGMA]
 Gauss vertical filter.
ObjectPtr< IOpenGLShaderProgram_color_matrix_filter_prog
 Color matrix filter.
ObjectPtr< IOpenGLShaderProgramshader_layer_blend_normal_
ObjectPtr< IOpenGLShaderProgramshader_layer_blend_lighten_
ObjectPtr< IOpenGLShaderProgramshader_layer_blend_darken_
ObjectPtr< IOpenGLShaderProgramshader_layer_blend_multiply_
ObjectPtr< IOpenGLShaderProgramblend_tex_color_prog_ [LAYER_BLEND_MODE_LAST]
ObjectPtr< IOpenGLShaderProgramblend_color_tex_prog_ [LAYER_BLEND_MODE_LAST]
ObjectPtr< IOpenGLShaderProgramblend_tex_tex_prog_ [LAYER_BLEND_MODE_LAST]
bool _use_glsl_shaders
 True if the system is using the glsl code path.
ObjectPtr
< IOpenGLFrameBufferObject
_offscreen_fbo
ObjectPtr< IOpenGLBaseTexture_offscreen_color_rt0
ObjectPtr< IOpenGLBaseTexture_offscreen_depth_rt0
ObjectPtr< IOpenGLBaseTexture_offscreen_color_rt1
ObjectPtr< IOpenGLBaseTexture_offscreen_depth_rt1
ObjectPtr< IOpenGLBaseTexture_offscreen_color_rt2
ObjectPtr< IOpenGLBaseTexture_offscreen_depth_rt2
ObjectPtr< IOpenGLBaseTexture_offscreen_color_rt3
ObjectPtr< IOpenGLBaseTexture_offscreen_depth_rt3
Matrix4 _projection_matrix
Matrix4 _model_view_matrix
std::list< Matrix4_model_view_stack
std::list< BlendOperator_blend_stack
GraphicsDisplay_graphics_display
 The system GraphicsDisplay object.
Rect _viewport
Rect _scissor
int _clip_offset_x
int _clip_offset_y
Rect _clipping_rect
bool _global_clipping_enabled
 Set to true to enable the global clipping rectangle.
Rect _global_clipping_rect
 Define a global clipping rectangle.
std::list< Point_clip_offset_stack
FontRenderer_font_renderer
long m_quad_stats
long m_quad_tex_stats
long m_triangle_stats
long m_triangle_tex_stats
long m_line_stats

Detailed Description

Rendering engine class.

This is the object that renders the graphics primitives.

Definition at line 151 of file GraphicsEngine.h.


Constructor & Destructor Documentation

nux::GraphicsEngine::GraphicsEngine ( GraphicsDisplay GlWindow,
bool  create_rendering_data = true 
)
Parameters:
GlWindowThe graphics window for this rendering engine.
create_rendering_dataIf true, then in GraphicsEngine, the system creates the OpenGL shaders and the font textures for the rendering.

Definition at line 153 of file GraphicsEngine.cpp.

  : _graphics_display(GlWindow)
  {
    _scissor.x = 0;
    _scissor.y = 0;
    _clip_offset_x = 0;
    _clip_offset_y = 0;

    _font_renderer = 0;

    _use_glsl_shaders = false;
    _global_clipping_enabled = false;

    // Evaluate the features provided by the GPU.
    EvaluateGpuCaps();

    if (UsingGLSLCodePath())
    {
      nuxDebugMsg("The GraphicsEngine is using the GLSL shader code path.");
    }
    else
    {
      nuxDebugMsg("The GraphicsEngine is using the assenbly shader code path."); 
    }


    GlWindow.m_GraphicsContext = this;
    ResetStats();

    _projection_matrix.Identity();
    _model_view_matrix.Identity();

    ResourceCache.InitializeResourceFactories();

    m_CurrrentContext.x = 0;
    m_CurrrentContext.y = 0;
    m_CurrrentContext.width = _graphics_display.GetWindowWidth();
    m_CurrrentContext.height = _graphics_display.GetWindowHeight();

    SetViewport(0, 0, _graphics_display.GetWindowWidth(), _graphics_display.GetWindowHeight());
    SetScissor(0, 0, _graphics_display.GetWindowWidth(), _graphics_display.GetWindowHeight());
    EnableScissoring(true);


    bool opengl_14_support = true;

    if ((_graphics_display.GetGpuDevice()->GetOpenGLMajorVersion() == 1) &&
      (_graphics_display.GetGpuDevice()->GetOpenGLMinorVersion() < 4))
    {
      // OpenGL version is less than OpenGL 1.4
      opengl_14_support = false;
    }

    if (create_rendering_data)
    {
#ifndef NUX_OPENGLES_20
      if (_graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Fragment_Shader() &&
        _graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Vertex_Program() &&
        opengl_14_support)
      {
        InitAsmColorShader();
        InitAsmTextureShader();
        InitAsmPixelateShader();
        InitAsmColorModTexMaskAlpha();
        InitAsm2TextureAdd();
        InitAsm2TextureMod();
        InitAsm4TextureAdd();
        InitAsmBlendModes();

        InitAsmPower();
        InitAsmAlphaReplicate();
        InitAsmSeparableGaussFilter();
        InitAsmColorMatrixFilter();

        //InitAsm2TextureDepRead(); // NUXTODO: fix the shader
      }
#endif

      GpuInfo& gpu_info = _graphics_display.GetGpuDevice()->GetGpuInfo();

      if ((gpu_info.Support_ARB_Vertex_Program() && gpu_info.Support_ARB_Fragment_Program())
          || (gpu_info.Support_ARB_Vertex_Shader() && gpu_info.Support_ARB_Fragment_Shader()))
      {
        _font_renderer = new FontRenderer(*this);
      }

      if (gpu_info.Support_EXT_Framebuffer_Object())
        _offscreen_fbo = _graphics_display.GetGpuDevice()->CreateFrameBufferObject();

      _offscreen_color_rt0  = _graphics_display.GetGpuDevice()->CreateTexture(2, 2, 1, BITFMT_R8G8B8A8, NUX_TRACKER_LOCATION);
      _offscreen_color_rt1  = _graphics_display.GetGpuDevice()->CreateTexture(2, 2, 1, BITFMT_R8G8B8A8, NUX_TRACKER_LOCATION);
      _offscreen_color_rt2  = _graphics_display.GetGpuDevice()->CreateTexture(2, 2, 1, BITFMT_R8G8B8A8, NUX_TRACKER_LOCATION);
      _offscreen_color_rt3  = _graphics_display.GetGpuDevice()->CreateTexture(2, 2, 1, BITFMT_R8G8B8A8, NUX_TRACKER_LOCATION);
    }
  }

Here is the call graph for this function:


Member Function Documentation

void nux::GraphicsEngine::AddClipOffset ( int  x,
int  y 
)

Deprecated.

Use PushClipOffset.

Definition at line 708 of file GraphicsEngine.cpp.

  {
    PushClipOffset(x, y);
  }

Here is the call graph for this function:

Set the clipping according to the clipping rectangle stack.

Definition at line 593 of file GraphicsEngine.cpp.

  {
    if (_graphics_display.m_DeviceFactory->GetCurrentFrameBufferObject().IsValid())
    {
      _graphics_display.m_DeviceFactory->GetCurrentFrameBufferObject()->ApplyClippingRegion();
      return;
    }

    unsigned int stacksize = (unsigned int) ClippingRect.size();

    if (stacksize == 0)
    {
      _clipping_rect = Rect(0, 0, _viewport.width, _viewport.height);
      EnableScissoring(true);
      SetOpenGLClippingRectangle(0, 0, _viewport.width, _viewport.height);
    }
    else
    {
      _clipping_rect = ClippingRect[stacksize-1];
      Rect B = _clipping_rect;
      EnableScissoring(true);
      SetOpenGLClippingRectangle(B.x, _viewport.height - B.y - B.GetHeight(), B.GetWidth(), B.GetHeight());
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Set the model view matrix according to the model view matrix stack.

Definition at line 955 of file GraphicsEngine.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Return the depth of the raster operation stack.

Returns:
The depth of the raster operation stack.

Definition at line 1012 of file GraphicsEngine.cpp.

  {
    return(int) _blend_stack.size();
  }

Cache a resource if it has previously been cached.

If the resource does not contain valid data then the returned value is not valid. Check that the returned hardware resource is valid by calling ObjectPtr<CachedResourceData>.IsValid().

Parameters:
ResourceThe resource to cache.
Returns:
A hardware resource.

Definition at line 1253 of file GraphicsEngine.cpp.

  {
    return ResourceCache.GetCachedResource(Resource);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 888 of file GraphicsEngine.cpp.

Here is the call graph for this function:

void nux::GraphicsEngine::ClearAreaColor ( int  x,
int  y,
int  width,
int  height,
Color  clearcolor 
)

Definition at line 1216 of file GraphicsEngine.cpp.

  {
    QRP_Color(x, y, width, height, clear_color);
  }

Here is the call graph for this function:

void nux::GraphicsEngine::ClearAreaColorDepthStencil ( int  x,
int  y,
int  width,
int  height,
Color  clearcolor,
float  cleardepth,
int  clearstencil 
)

Definition at line 1197 of file GraphicsEngine.cpp.

  {
    // enable stencil buffer
    CHECKGL(glEnable(GL_STENCIL_TEST));
    // write a one to the stencil buffer everywhere we are about to draw
    CHECKGL(glStencilFunc(GL_ALWAYS, clearstencil, 0xFFFFFFFF));
    // this is to always pass a one to the stencil buffer where we draw
    CHECKGL(glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE));

    //CHECKGL(glEnable(GL_DEPTH_TEST));
    //CHECKGL(glDepthFunc(GL_ALWAYS));

    QRP_Color(x, y, width, height, clear_color);

    //CHECKGL(glDepthFunc(GL_LESS));
    //CHECKGL(glDisable(GL_DEPTH_TEST));
    CHECKGL(glDisable(GL_STENCIL_TEST));
  }

Here is the call graph for this function:

void nux::GraphicsEngine::ClearAreaDepthStencil ( int  x,
int  y,
int  width,
int  height,
float  cleardepth,
int  clearstencil 
)

Definition at line 1221 of file GraphicsEngine.cpp.

  {
    // enable stencil buffer
    CHECKGL(glEnable(GL_STENCIL_TEST));
    // write a one to the stencil buffer everywhere we are about to draw
    CHECKGL(glStencilFunc(GL_ALWAYS, clearstencil, 0xFFFFFFFF));
    // this is to always pass a one to the stencil buffer where we draw
    CHECKGL(glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE));

    CHECKGL(glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE));
    //CHECKGL(glEnable(GL_DEPTH_TEST));
    //CHECKGL(glDepthFunc(GL_ALWAYS));

    QRP_Color(x, y, width, height, color::Black);

    //CHECKGL(glDepthFunc(GL_LESS));
    //CHECKGL(glDisable(GL_DEPTH_TEST));
    CHECKGL(glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE));
    CHECKGL(glDisable(GL_STENCIL_TEST));

  }

Here is the call graph for this function:

ObjectPtr< IOpenGLBaseTexture > nux::GraphicsEngine::CreateTextureFromBackBuffer ( int  x,
int  y,
int  width,
int  height 
)

Definition at line 1350 of file GraphicsEngine.cpp.

  {
    ObjectPtr<IOpenGLFrameBufferObject> fbo = _graphics_display.GetGpuDevice()->GetCurrentFrameBufferObject();

    int X, Y, W, H;
    if (fbo.IsValid())
    {
      int fbo_width = fbo->GetWidth();
      int fbo_height = fbo->GetHeight();

      X = Clamp<int> (x, 0, fbo_width);
      Y = Clamp<int> (y, 0, fbo_height);
      W = Min<int> (fbo_width - x, width);
      H = Min<int> (fbo_height - y, height);


      if ((W <= 0) || (H <= 0))
      {
        nuxAssertMsg(0, "[GraphicsEngine::CreateTextureFromBackBuffer] Invalid request.");
        return ObjectPtr<IOpenGLBaseTexture> (0);
      }
      
      // Inverse Y because of OpenGL upside-down nature
      Y = fbo_height - Y - H;
    }
    else
    {
      // There is no fbo. Reading directly from the back-buffer.
      int bb_width = _graphics_display.GetWindowWidth();
      int bb_height = _graphics_display.GetWindowHeight();

      X = Clamp<int> (x, 0, bb_width);
      Y = Clamp<int> (y, 0, bb_height);
      W = Min<int> (bb_width - x, width);
      H = Min<int> (bb_height - y, height);

      if ((W <= 0) || (H <= 0))
      {
        nuxAssertMsg(0, "[GraphicsEngine::CreateTextureFromBackBuffer] Invalid request.");
        return ObjectPtr<IOpenGLBaseTexture> (0);
      }

      // Inverse Y because of OpenGL upside-down nature
      Y = bb_height - Y - H;
    }

    ObjectPtr <IOpenGLBaseTexture> device_texture = _graphics_display.GetGpuDevice()->CreateSystemCapableDeviceTexture(W, H, 1, BITFMT_R8G8B8A8, NUX_TRACKER_LOCATION);
    ObjectPtr <IOpenGLSurface> sfc = device_texture->GetSurfaceLevel(0);

    sfc->CopyRenderTarget(X, Y, W, H);

    return device_texture;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GraphicsEngine::DisableAllTextureMode ( int  TextureUnit)

Definition at line 496 of file GraphicsEngine.cpp.

  {
    if ((TextureUnit < GL_TEXTURE0) || (TextureUnit > GL_TEXTURE31))
      return;

    _graphics_display.GetGpuDevice()->InvalidateTextureUnit(TextureUnit);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 641 of file GraphicsEngine.cpp.

Here is the call graph for this function:

void nux::GraphicsEngine::DisableTextureMode ( int  TextureUnit,
int  TextureMode 
)

Definition at line 486 of file GraphicsEngine.cpp.

  {
    if ((TextureUnit < GL_TEXTURE0) || (TextureUnit > GL_TEXTURE31))
      return;

    CHECKGL(glActiveTextureARB(TextureUnit));
    CHECKGL(glDisable(TextureMode));
    CHECKGL(glBindTexture(TextureMode, 0));
  }

Definition at line 618 of file GraphicsEngine.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1188 of file GraphicsEngine.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GraphicsEngine::EnableTextureMode ( int  TextureUnit,
int  TextureMode 
)

Definition at line 477 of file GraphicsEngine.cpp.

  {
    if ((TextureUnit < GL_TEXTURE0) || (TextureUnit > GL_TEXTURE31))
      return;

    CHECKGL(glActiveTextureARB(TextureUnit));
    CHECKGL(glEnable(TextureMode));
  }

Test the gpu features and set variables such as _use_glsl_shaders.

Definition at line 261 of file GraphicsEngine.cpp.

  {
#ifdef NUX_OS_WINDOWS
    if (_graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Vertex_Shader() &&
      _graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Fragment_Shader())
#else
    if (_graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Vertex_Shader() &&
      _graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Fragment_Shader() &&
      (_graphics_display.GetGpuDevice()->GetOpenGLMajorVersion() >= 2))
#endif
    {
      NString renderer_string = ANSI_TO_TCHAR(NUX_REINTERPRET_CAST(const char* , glGetString(GL_RENDERER)));
      CHECKGL_MSG(glGetString(GL_RENDERER));

      // Exclude Geforce FX from using GLSL
      if (renderer_string.FindFirstOccurence("GeForce FX") != tstring::npos)
      {
        _use_glsl_shaders = false;
        return;
      }

      // Exclude Geforce FX Go from using GLSL: this case is not needed since it is detected by the one above.
      if (renderer_string.FindFirstOccurence("GeForce FX Go") != tstring::npos)
      {
        _use_glsl_shaders = false;
        return;
      }

      _use_glsl_shaders = true;
    }
    else
    {
      _use_glsl_shaders = false;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1258 of file GraphicsEngine.cpp.

  {
    if (!IsResourceCached(Resource))
      return false;

    ResourceCache.FlushResourceId(Resource->GetResourceIndex());
    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GraphicsEngine::GaussianWeights ( float **  weights,
float  sigma,
unsigned int  num_tap 
) [private]

Helper function to compute a Gaussian filter weights.

Definition at line 1326 of file GraphicsEngine.cpp.

  {
    *weights = new float[num_tap];
    float sum = 0.0f;
    unsigned int i = 0;

    unsigned int half = (num_tap-1)/2;

    (*weights)[half] = (1.0f/(sqrt(2.0f*3.14159265358f)*sigma)) * exp(-0.0f/(2.0f*sigma*sigma));
    sum += (*weights)[half];
    for (i = 0; i < half; i++)
    {
      float X = (i + 1)*(i + 1);
      (*weights)[half - i - 1] = (*weights)[half + i + 1] = (1.0f/(sqrt(2.0f*3.14159265358f)*sigma)) * exp(-X/(2.0f*sigma*sigma));
      sum += 2.0f * ((*weights)[half - i - 1]);
    }

    /* normalization */
    for (i = 0; i < num_tap; i++)
    {
      (*weights)[i] = (*weights)[i] / sum;
    }
  }

Here is the caller graph for this function:

const char *const nux::GraphicsEngine::GetBlendModeBlendFunc ( LayerBlendMode  layer_blend_mode) [private]

Definition at line 37 of file RenderingPipeTextureBlend.cpp.

  {
    switch (layer_blend_mode)
      {
      case LAYER_BLEND_MODE_NORMAL:
       return BlendNormalShader;
        break;
      case LAYER_BLEND_MODE_OVERLAY:
       return BlendOverlayShader;
       break;
       
      default:
       return NULL;
      }
  }

Here is the caller graph for this function:

const char *const nux::GraphicsEngine::GetBlendModeString ( LayerBlendMode  layer_blend_mode) [private]

Definition at line 54 of file RenderingPipeTextureBlend.cpp.

{
  switch (layer_blend_mode)
    {
    case LAYER_BLEND_MODE_NORMAL:
      return "BlendNormal";
      break;
    case LAYER_BLEND_MODE_OVERLAY:
      return "BlendOverlay";
      break;
    default:
      return NULL;
    }
}

Here is the caller graph for this function:

Definition at line 200 of file RenderingPipeTextureBlend.cpp.

{
  if (blend_tex_tex_prog_[layer_blend_mode].IsValid())
  {
    return blend_tex_tex_prog_[layer_blend_mode];
  }

  ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
  ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
  
  NString VSString;
  NString PSString;

    VSString =      NUX_VERTEX_SHADER_HEADER
                    "uniform mat4 ViewProjectionMatrix;                     \n\
                    attribute vec4 AVertex;                                 \n\
                    attribute vec4 MyTextureCoord0;                         \n\
                    attribute vec4 MyTextureCoord1;                         \n\
                    varying vec4 varyTexCoord0;                             \n\
                    varying vec4 varyTexCoord1;                             \n\
                    void main()                                             \n\
                    {                                                       \n\
                      varyTexCoord0 = MyTextureCoord0;                      \n\
                      varyTexCoord1 = MyTextureCoord1;                      \n\
                      gl_Position =  ViewProjectionMatrix * (AVertex);      \n\
                    }";
  
    PSString =      NUX_FRAGMENT_SHADER_HEADER
                    "varying vec4 varyTexCoord0;                                \n\
                    varying vec4 varyTexCoord1;                                 \n\
                    uniform vec4 color0;                                        \n\
                    uniform vec4 color1;                                        \n\
                    uniform sampler2D TextureObject0;                           \n\
                    uniform sampler2D TextureObject1;                           \n\
                    %s                                                          \n\
                    void main()                                                 \n\
                    {                                                           \n\
                      vec4 bkg_tex = color0*texture2D(TextureObject0, varyTexCoord0.st);     \n\
                      vec4 frg_tex = color1*texture2D(TextureObject1, varyTexCoord1.st);     \n\
                      gl_FragColor = %s(bkg_tex.rgb, frg_tex.rgb);              \n\
                    }";

    int l = PSString.Size();
    l += strlen(GetBlendModeBlendFunc(layer_blend_mode));
    l += strlen(GetBlendModeString(layer_blend_mode)) + 1;
    
    char* shader_prog = new char[l];
    sprintf(shader_prog, PSString.GetTCharPtr(), GetBlendModeBlendFunc(layer_blend_mode),
           GetBlendModeString(layer_blend_mode));
    
    blend_tex_tex_prog_[layer_blend_mode] = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(shader_prog, "#define SAMPLERTEX2D");
    
    delete [] shader_prog;
    
    blend_tex_tex_prog_[layer_blend_mode]->ClearShaderObjects();
    blend_tex_tex_prog_[layer_blend_mode]->AddShaderObject(VS);
    blend_tex_tex_prog_[layer_blend_mode]->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(blend_tex_tex_prog_[layer_blend_mode]->GetOpenGLID(), 0, "AVertex"));
    blend_tex_tex_prog_[layer_blend_mode]->Link();
    
    return blend_tex_tex_prog_[layer_blend_mode];    
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 327 of file GraphicsEngine.cpp.

  {
    #if defined(NUX_OS_WINDOWS)
      if (_bold_font.IsNull())
      {
        FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/Tahoma_size_8_bold.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION);
        _bold_font = ObjectPtr<FontTexture> (fnt);
        fnt->UnReference();
      }
#else
      if (_bold_font.IsNull())
      {
        FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/nuxfont_size_8_bold.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION);
        _bold_font = ObjectPtr<FontTexture> (fnt);
        fnt->UnReference();
      }
#endif
    return _bold_font;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 648 of file GraphicsEngine.cpp.

  {
    if (_graphics_display.m_DeviceFactory->GetCurrentFrameBufferObject().IsValid())
    {
      Rect r = _graphics_display.m_DeviceFactory->GetCurrentFrameBufferObject()->GetClippingRegion();
      return r;      
    }

    return _clipping_rect;

//     unsigned int stacksize = (unsigned int) ClippingRect.size();
// 
//     if (stacksize == 0)
//     {
//       return Rect(0, 0, _viewport.width, _viewport.height);
//     }
//     else
//     {
//       Rect r = ClippingRect[stacksize-1];
//       return r;
//     }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 69 of file RenderingPipeTextureBlend.cpp.

{
  if (blend_tex_color_prog_[layer_blend_mode].IsValid())
  {
    return blend_tex_color_prog_[layer_blend_mode];
  }
  
  ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
  ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
  
  NString VSString;
  NString PSString;
  
  VSString =
                    NUX_VERTEX_SHADER_HEADER
                    "attribute vec4 AVertex;                                 \n\
                    attribute vec4 MyTextureCoord0;                          \n\
                    attribute vec4 VertexColor;                              \n\
                    uniform mat4 ViewProjectionMatrix;                       \n\
                    varying vec4 varyTexCoord0;                              \n\
                    varying vec4 varyVertexColor;                            \n\
                    void main()                                              \n\
                    {                                                        \n\
                      gl_Position =  ViewProjectionMatrix*  (AVertex);       \n\
                      varyTexCoord0 = MyTextureCoord0;                       \n\
                      varyVertexColor = VertexColor;                         \n\
                    }";

  PSString =
                    NUX_FRAGMENT_SHADER_HEADER
                    "uniform vec4 color0;                                           \n\
                    uniform sampler2D TextureObject0;                               \n\
                    varying vec4 varyTexCoord0;                                     \n\
                    varying vec4 varyVertexColor;                                   \n\
                    %s                                                              \n\
                    void main()                                                     \n\
                    {                                                               \n\
                      vec4 tex = texture2D(TextureObject0, varyTexCoord0.st)*varyVertexColor;       \n\
                      gl_FragColor.rgb = mix(tex.rgb,%s(tex.rgb,color0.rgb),color0.a);  \n\
                      gl_FragColor.a = 1.0;                                         \n\
                    }";

    int l = PSString.Size();
    l += strlen(GetBlendModeBlendFunc(layer_blend_mode));
    l += strlen(GetBlendModeString(layer_blend_mode)) + 1;
    
    char* shader_prog = new char[l];
    sprintf(shader_prog, PSString.GetTCharPtr(), GetBlendModeBlendFunc(layer_blend_mode),
           GetBlendModeString(layer_blend_mode));
    
    blend_tex_color_prog_[layer_blend_mode] = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(shader_prog, "#define SAMPLERTEX2D");
    
    delete [] shader_prog;
    
    blend_tex_color_prog_[layer_blend_mode]->ClearShaderObjects();
    blend_tex_color_prog_[layer_blend_mode]->AddShaderObject(VS);
    blend_tex_color_prog_[layer_blend_mode]->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(blend_tex_color_prog_[layer_blend_mode]->GetOpenGLID(), 0, "AVertex"));
    blend_tex_color_prog_[layer_blend_mode]->Link();
    
    return blend_tex_color_prog_[layer_blend_mode];    
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 384 of file GraphicsEngine.cpp.

Here is the caller graph for this function:

void nux::GraphicsEngine::GetContextSize ( int &  w,
int &  h 
) const

Definition at line 373 of file GraphicsEngine.cpp.

Here is the caller graph for this function:

Definition at line 379 of file GraphicsEngine.cpp.

  {
    return m_CurrrentContext.width;
  }

Here is the caller graph for this function:

Definition at line 389 of file GraphicsEngine.cpp.

  {
    return m_CurrrentContext.x;
  }

Here is the caller graph for this function:

Definition at line 394 of file GraphicsEngine.cpp.

  {
    return m_CurrrentContext.y;
  }

Here is the caller graph for this function:

Definition at line 307 of file GraphicsEngine.cpp.

  {
#if defined(NUX_OS_WINDOWS)
      if (_normal_font.IsNull())
      {
        FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/Tahoma_size_8.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION);
        _normal_font = ObjectPtr<FontTexture> (fnt);
        fnt->UnReference();
      }
#else
      if (_normal_font.IsNull())
      {
        FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/nuxfont_size_8.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION);
        _normal_font = ObjectPtr<FontTexture> (fnt);
        fnt->UnReference();
      }
#endif
    return _normal_font;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1044 of file GraphicsEngine.cpp.

  {
    return _model_view_matrix;
  }

Here is the caller graph for this function:

Definition at line 1056 of file GraphicsEngine.cpp.

Definition at line 697 of file GraphicsEngine.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Return the transpose version of GetModelViewMatrix();.

Definition at line 1049 of file GraphicsEngine.cpp.

  {
    Matrix4 mat = _model_view_matrix;
    mat.Transpose();
    return mat;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1061 of file GraphicsEngine.cpp.

  {
    // This matrix is the transposed version of GetModelViewProjectionMatrix.
    Matrix4 mat = _projection_matrix * _model_view_matrix;
    mat.Transpose();
    return mat;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Return the transpose version of GetProjectionMatrix();.

Definition at line 1022 of file GraphicsEngine.cpp.

  {
    Matrix4 mat = GetProjectionMatrix();
    mat.Transpose();
    return mat;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1017 of file GraphicsEngine.cpp.

  {
    return _projection_matrix;
  }

Here is the caller graph for this function:

Definition at line 636 of file GraphicsEngine.h.

Here is the caller graph for this function:

Definition at line 1183 of file GraphicsEngine.cpp.

  {
    return Rect(_scissor.x, _scissor.y, _scissor.width, _scissor.height);
  }

Here is the caller graph for this function:

Definition at line 134 of file RenderingPipeTextureBlend.cpp.

{
  if (blend_color_tex_prog_[layer_blend_mode].IsValid())
  {
    return blend_color_tex_prog_[layer_blend_mode];
  }
  
  ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
  ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
  
  NString VSString;
  NString PSString;
  
  VSString =
                NUX_VERTEX_SHADER_HEADER
                "attribute vec4 AVertex;                               \n\
                attribute vec4 MyTextureCoord0;                        \n\
                attribute vec4 VertexColor;                            \n\
                uniform mat4 ViewProjectionMatrix;                     \n\
                varying vec4 varyTexCoord0;                            \n\
                varying vec4 varyVertexColor;                          \n\
                void main()                                            \n\
                {                                                      \n\
                  gl_Position =  ViewProjectionMatrix * (AVertex);     \n\
                  varyTexCoord0 = MyTextureCoord0;                     \n\
                  varyVertexColor = VertexColor;                       \n\
                }";

    PSString =  
                NUX_FRAGMENT_SHADER_HEADER
                "uniform vec3 color0;                                       \n\
                uniform float BlendOpacity;                                 \n\
                uniform sampler2D TextureObject0;                           \n\
                varying vec4 varyTexCoord0;                                 \n\
                varying vec4 varyVertexColor;                               \n\
                %s                                                          \n\
                void main()                                                 \n\
                {                                                           \n\
                  vec4 tex = texture2D(TextureObject0, varyTexCoord0.st) * varyVertexColor;     \n\
                  gl_FragColor.rgb = mix(color0,%s(color0.rgb,tex.rgb),tex.a);  \n\
                  gl_FragColor.a = 1.0;                                     \n\
                }";

    int l = PSString.Size();
    l += strlen(GetBlendModeBlendFunc(layer_blend_mode));
    l += strlen(GetBlendModeString(layer_blend_mode)) + 1;
    
    char* shader_prog = new char[l];
    sprintf(shader_prog, PSString.GetTCharPtr(), GetBlendModeBlendFunc(layer_blend_mode),
           GetBlendModeString(layer_blend_mode));
    
    blend_color_tex_prog_[layer_blend_mode] = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(shader_prog, "#define SAMPLERTEX2D");
    
    delete [] shader_prog;
    
    blend_color_tex_prog_[layer_blend_mode]->ClearShaderObjects();
    blend_color_tex_prog_[layer_blend_mode]->AddShaderObject(VS);
    blend_color_tex_prog_[layer_blend_mode]->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(blend_color_tex_prog_[layer_blend_mode]->GetOpenGLID(), 0, "AVertex"));
    blend_color_tex_prog_[layer_blend_mode]->Link();
    
    return blend_color_tex_prog_[layer_blend_mode];
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1109 of file GraphicsEngine.cpp.

  {
    return _viewport.height;
  }

Here is the caller graph for this function:

Definition at line 1099 of file GraphicsEngine.cpp.

  {
    return _viewport;
  }

Here is the caller graph for this function:

void nux::GraphicsEngine::GetViewportSize ( int &  viewport_width,
int &  viewport_height 
) const

Definition at line 1124 of file GraphicsEngine.cpp.

  {
    viewport_width = _viewport.width;
    viewport_height = _viewport.height;
  }

Definition at line 1104 of file GraphicsEngine.cpp.

  {
    return _viewport.width;
  }

Here is the caller graph for this function:

Definition at line 1114 of file GraphicsEngine.cpp.

  {
    return _viewport.x;
  }

Here is the caller graph for this function:

Definition at line 1119 of file GraphicsEngine.cpp.

  {
    return _viewport.y;
  }

Here is the caller graph for this function:

Definition at line 409 of file GraphicsEngine.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GraphicsEngine::GetWindowSize ( int &  w,
int &  h 
) const

Definition at line 399 of file GraphicsEngine.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 404 of file GraphicsEngine.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 222 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
        "!!ARBvp1.0                                 \n\
        ATTRIB iPos         = vertex.position;      \n\
        OUTPUT oPos         = result.position;      \n\
        OUTPUT oTexCoord0   = result.texcoord[0];   \n\
        OUTPUT oTexCoord1   = result.texcoord[1];   \n\
        # Transform the vertex to clip coordinates. \n\
        DP4   oPos.x, state.matrix.mvp.row[0], vertex.position;      \n\
        DP4   oPos.y, state.matrix.mvp.row[1], vertex.position;      \n\
        DP4   oPos.z, state.matrix.mvp.row[2], vertex.position;      \n\
        DP4   oPos.w, state.matrix.mvp.row[3], vertex.position;      \n\
        MOV   oTexCoord0, vertex.attrib[8];       \n\
        MOV   oTexCoord1, vertex.attrib[9];       \n\
        END";

    NString AsmFrg = 
        "!!ARBfp1.0                                         \n\
        PARAM color0 = program.local[0];                    \n\
        PARAM color1 = program.local[1];                    \n\
        TEMP tex0;                                          \n\
        TEMP tex1;                                          \n\
        TEMP temp;                                          \n\
        TEX tex0, fragment.texcoord[0], texture[0], 2D;     \n\
        MUL temp, color0, tex0;                             \n\
        TEX tex1, fragment.texcoord[1], texture[1], 2D;     \n\
        MAD temp, color1, tex1, temp;                       \n\
        MOV result.color, temp;                             \n\
        END";

    NString AsmFrgRect = 
      "!!ARBfp1.0                                         \n\
      PARAM color0 = program.local[0];                    \n\
      PARAM color1 = program.local[1];                    \n\
      TEMP tex0;                                          \n\
      TEMP tex1;                                          \n\
      TEMP temp;                                          \n\
      TEX tex0, fragment.texcoord[0], texture[0], RECT;   \n\
      MUL temp, color0, tex0;                             \n\
      TEX tex1, fragment.texcoord[1], texture[1], RECT;   \n\
      MAD temp, color1, tex1, temp;                       \n\
      MOV result.color, temp;                             \n\
      END";

    m_Asm2TextureAdd = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_Asm2TextureAdd->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_Asm2TextureAdd->LoadPixelShader(AsmFrg.GetTCharPtr());
    m_Asm2TextureAdd->Link();

    m_Asm2TextureRectAdd = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_Asm2TextureRectAdd->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_Asm2TextureRectAdd->LoadPixelShader(AsmFrgRect.GetTCharPtr());
    m_Asm2TextureRectAdd->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 278 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
      "!!ARBvp1.0                                 \n\
      ATTRIB iPos         = vertex.position;      \n\
      OUTPUT oPos         = result.position;      \n\
      OUTPUT oTexCoord0   = result.texcoord[0];   \n\
      OUTPUT oTexCoord1   = result.texcoord[1];   \n\
      # Transform the vertex to clip coordinates. \n\
      DP4   oPos.x, state.matrix.mvp.row[0], vertex.position;      \n\
      DP4   oPos.y, state.matrix.mvp.row[1], vertex.position;      \n\
      DP4   oPos.z, state.matrix.mvp.row[2], vertex.position;      \n\
      DP4   oPos.w, state.matrix.mvp.row[3], vertex.position;      \n\
      MOV   oTexCoord0, vertex.attrib[8];       \n\
      MOV   oTexCoord1, vertex.attrib[9];       \n\
      END";

    NString AsmFrg = 
      "!!ARBfp1.0                                         \n\
      PARAM color0 = program.local[0];                    \n\
      PARAM color1 = program.local[1];                    \n\
      TEMP tex0;                                          \n\
      TEMP tex1;                                          \n\
      TEMP temp;                                          \n\
      TEMP temp0;                                          \n\
      TEMP temp1;                                          \n\
      TEX tex0, fragment.texcoord[0], texture[0], 2D;     \n\
      MAD temp, {2.0, 2.0, 2.0, 2.0}, tex0, {-1.0, -1.0, -1.0, -1.0}; \n\
      MUL temp0, color0, temp;                             \n\
      ADD temp1, texture[1];                         \n\
      TEX tex1, fragment.texcoord[1], texture[1], 2D;           \n\
      MUL result.color, color1, tex1;                     \n\
      END";

    NString AsmFrgRect = 
      "!!ARBfp1.0                                         \n\
      PARAM color0 = program.local[0];                    \n\
      PARAM color1 = program.local[1];                    \n\
      TEMP tex0;                                          \n\
      TEMP tex1;                                          \n\
      TEMP temp;                                          \n\
      TEX tex0, fragment.texcoord[0], texture[0], RECT;   \n\
      MAD temp, {2.0, 2.0, 2.0, 2.0}, tex0, {-1.0, -1.0, -1.0, -1.0}; \n\
      MUL temp, color0, tex0;                             \n\
      TEX tex1, fragment.texcoord[1], temp, RECT;         \n\
      MUL result.color, color1, tex1;                     \n\
      END";

    m_ASM2TextureDepRead = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_ASM2TextureDepRead->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_ASM2TextureDepRead->LoadPixelShader(AsmFrg.GetTCharPtr());
    m_ASM2TextureDepRead->Link();

    m_ASM2TextureRectDepRead = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_ASM2TextureRectDepRead->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_ASM2TextureRectDepRead->LoadPixelShader(AsmFrgRect.GetTCharPtr());
    m_ASM2TextureRectDepRead->Link();
  }

Here is the call graph for this function:

Definition at line 337 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
      "!!ARBvp1.0                                 \n\
      ATTRIB iPos         = vertex.position;      \n\
      OUTPUT oPos         = result.position;      \n\
      OUTPUT oTexCoord0   = result.texcoord[0];   \n\
      OUTPUT oTexCoord1   = result.texcoord[1];   \n\
      # Transform the vertex to clip coordinates. \n\
      DP4   oPos.x, state.matrix.mvp.row[0], vertex.position;      \n\
      DP4   oPos.y, state.matrix.mvp.row[1], vertex.position;      \n\
      DP4   oPos.z, state.matrix.mvp.row[2], vertex.position;      \n\
      DP4   oPos.w, state.matrix.mvp.row[3], vertex.position;      \n\
      MOV   oTexCoord0, vertex.attrib[8];       \n\
      MOV   oTexCoord1, vertex.attrib[9];       \n\
      END";

    NString AsmFrg = 
      "!!ARBfp1.0                                         \n\
      PARAM color0 = program.local[0];                    \n\
      PARAM color1 = program.local[1];                    \n\
      TEMP tex0;                                          \n\
      TEMP tex1;                                          \n\
      TEMP temp0;                                         \n\
      TEMP temp1;                                         \n\
      TEX tex0, fragment.texcoord[0], texture[0], 2D;     \n\
      MUL temp0, color0, tex0;                            \n\
      TEX tex1, fragment.texcoord[1], texture[1], 2D;     \n\
      MUL temp1, color1, tex1;                            \n\
      MUL result.color, temp0, temp1;                     \n\
      END";

    NString AsmFrgRect = 
      "!!ARBfp1.0                                         \n\
      PARAM color0 = program.local[0];                    \n\
      PARAM color1 = program.local[1];                    \n\
      TEMP tex0;                                          \n\
      TEMP tex1;                                          \n\
      TEMP temp0;                                         \n\
      TEMP temp1;                                         \n\
      TEX tex0, fragment.texcoord[0], texture[0], RECT;   \n\
      MUL temp0, color0, tex0;                            \n\
      TEX tex1, fragment.texcoord[1], texture[1], RECT;   \n\
      MUL temp1, color1, tex1;                            \n\
      MUL result.color, temp0, temp1;                     \n\
      END";

    m_Asm2TextureMod = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_Asm2TextureMod->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_Asm2TextureMod->LoadPixelShader(AsmFrg.GetTCharPtr());
    m_Asm2TextureMod->Link();

    m_Asm2TextureRectMod = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_Asm2TextureRectMod->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_Asm2TextureRectMod->LoadPixelShader(AsmFrgRect.GetTCharPtr());
    m_Asm2TextureRectMod->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 395 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
        "!!ARBvp1.0                                 \n\
        ATTRIB iPos         = vertex.position;      \n\
        OUTPUT oPos         = result.position;      \n\
        OUTPUT oTexCoord0   = result.texcoord[0];   \n\
        OUTPUT oTexCoord1   = result.texcoord[1];   \n\
        OUTPUT oTexCoord2   = result.texcoord[2];   \n\
        OUTPUT oTexCoord3   = result.texcoord[3];   \n\
        # Transform the vertex to clip coordinates. \n\
        DP4   oPos.x, state.matrix.mvp.row[0], vertex.position;      \n\
        DP4   oPos.y, state.matrix.mvp.row[1], vertex.position;      \n\
        DP4   oPos.z, state.matrix.mvp.row[2], vertex.position;      \n\
        DP4   oPos.w, state.matrix.mvp.row[3], vertex.position;      \n\
        MOV   oTexCoord0, vertex.attrib[8];       \n\
        MOV   oTexCoord1, vertex.attrib[9];       \n\
        MOV   oTexCoord2, vertex.attrib[10];       \n\
        MOV   oTexCoord3, vertex.attrib[11];       \n\
        END";

    NString AsmFrg = 
        "!!ARBfp1.0                                         \n\
        PARAM color0 = program.local[0];                    \n\
        PARAM color1 = program.local[1];                    \n\
        PARAM color2 = program.local[2];                    \n\
        PARAM color3 = program.local[3];                    \n\
        TEMP tex0;                                          \n\
        TEMP tex1;                                          \n\
        TEMP tex2;                                          \n\
        TEMP tex3;                                          \n\
        TEMP temp;                                          \n\
        TEX tex0, fragment.texcoord[0], texture[0], 2D;     \n\
        MUL temp, color0, tex0;                             \n\
        TEX tex1, fragment.texcoord[1], texture[1], 2D;     \n\
        MAD temp, color1, tex1, temp;                       \n\
        TEX tex2, fragment.texcoord[2], texture[2], 2D;     \n\
        MAD temp, color2, tex2, temp;                       \n\
        TEX tex3, fragment.texcoord[3], texture[3], 2D;     \n\
        MAD temp, color3, tex3, temp;                       \n\
        MOV result.color, temp;                             \n\
        END";

    NString AsmFrgRect = 
      "!!ARBfp1.0                                         \n\
      PARAM color0 = program.local[0];                    \n\
      PARAM color1 = program.local[1];                    \n\
      PARAM color2 = program.local[2];                    \n\
      PARAM color3 = program.local[3];                    \n\
      TEMP tex0;                                          \n\
      TEMP tex1;                                          \n\
      TEMP tex2;                                          \n\
      TEMP tex3;                                          \n\
      TEMP temp;                                          \n\
      TEX tex0, fragment.texcoord[0], texture[0], RECT;   \n\
      MUL temp, color0, tex0;                             \n\
      TEX tex1, fragment.texcoord[1], texture[1], RECT;   \n\
      MAD temp, color1, tex1, temp;                       \n\
      TEX tex2, fragment.texcoord[2], texture[2], RECT;   \n\
      MAD temp, color2, tex2, temp;                       \n\
      TEX tex3, fragment.texcoord[3], texture[3], RECT;   \n\
      MAD temp, color3, tex3, temp;                       \n\
      MOV result.color, temp;                             \n\
      END";

    m_Asm4TextureAdd = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_Asm4TextureAdd->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_Asm4TextureAdd->LoadPixelShader(AsmFrg.GetTCharPtr());
    m_Asm4TextureAdd->Link();

    m_Asm4TextureRectAdd = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_Asm4TextureRectAdd->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_Asm4TextureRectAdd->LoadPixelShader(AsmFrgRect.GetTCharPtr());
    m_Asm4TextureRectAdd->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1352 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
      "!!ARBvp1.0                                 \n\
      ATTRIB iPos         = vertex.position;      \n\
      OUTPUT oPos         = result.position;      \n\
      OUTPUT oTexCoord0   = result.texcoord[0];   \n\
      # Transform the vertex to clip coordinates. \n\
      DP4   oPos.x, state.matrix.mvp.row[0], vertex.position;      \n\
      DP4   oPos.y, state.matrix.mvp.row[1], vertex.position;      \n\
      DP4   oPos.z, state.matrix.mvp.row[2], vertex.position;      \n\
      DP4   oPos.w, state.matrix.mvp.row[3], vertex.position;      \n\
      MOV   oTexCoord0, vertex.attrib[8];       \n\
      END";


    NString AsmFrg = 
      "!!ARBfp1.0                                     \n\
      PARAM color0 = program.local[0];                \n\
      TEMP tex0;                                      \n\
      TEX tex0, fragment.texcoord[0], texture[0], 2D; \n\
      MUL result.color, color0, tex0.aaaa;            \n\
      END";

    NString AsmFrgRect = 
      "!!ARBfp1.0                                       \n\
      PARAM color0 = program.local[0];                  \n\
      TEMP tex0;                                        \n\
      TEX tex0, fragment.texcoord[0], texture[0], RECT; \n\
      MUL result.color, color0, tex0.aaaa;              \n\
      END";

    _asm_tex_alpha_replicate_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    _asm_tex_alpha_replicate_prog->LoadVertexShader(AsmVtx.GetTCharPtr());
    _asm_tex_alpha_replicate_prog->LoadPixelShader(AsmFrg.GetTCharPtr());
    _asm_tex_alpha_replicate_prog->Link();

  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 471 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
                       "!!ARBvp1.0                                 \n\
        OUTPUT oPos         = result.position;      \n\
        OUTPUT oTexCoord0   = result.texcoord[0];   \n\
        OUTPUT oTexCoord1   = result.texcoord[1];   \n\
        # Transform the vertex to clip coordinates. \n\
        DP4   oPos.x, state.matrix.mvp.row[0], vertex.position;      \n\
        DP4   oPos.y, state.matrix.mvp.row[1], vertex.position;      \n\
        DP4   oPos.z, state.matrix.mvp.row[2], vertex.position;      \n\
        DP4   oPos.w, state.matrix.mvp.row[3], vertex.position;      \n\
        MOV   oTexCoord0, vertex.attrib[8];       \n\
        MOV   oTexCoord1, vertex.attrib[9];       \n\
        END";

    NString AsmPSBNormal = 
                             "!!ARBfp1.0                                         \n\
        TEMP tex0;                                          \n\
        TEMP tex1;                                          \n\
        TEX tex0, fragment.texcoord[0], texture[0], 2D;     \n\
        TEX tex1, fragment.texcoord[1], texture[1], 2D;     \n\
        MOV result.color, tex0;                             \n\
        END";

    m_AsmPSBNormal = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_AsmPSBNormal->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_AsmPSBNormal->LoadPixelShader(AsmPSBNormal.GetTCharPtr());
    m_AsmPSBNormal->Link();

    // Lighten
    NString AsmPSBLighten = 
                              "!!ARBfp1.0                                         \n\
        TEMP tex0;                                          \n\
        TEMP tex1;                                          \n\
        TEMP temp;                                          \n\
        TEMP cmpres;                                        \n\
        TEX tex0, fragment.texcoord[0], texture[0], 2D;     \n\
        TEX tex1, fragment.texcoord[1], texture[1], 2D;     \n\
        SUB temp, tex0, tex1;                               \n\
        CMP cmpres, temp, tex1, tex0;                       \n\
        MOV result.color, temp;                             \n\
        END";

    m_AsmPSBLighten = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_AsmPSBLighten->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_AsmPSBLighten->LoadPixelShader(AsmPSBLighten.GetTCharPtr());
    m_AsmPSBLighten->Link();

    // Darken
    NString AsmPSBDarken = 
                             "!!ARBfp1.0                                         \n\
        TEMP tex0;                                          \n\
        TEMP tex1;                                          \n\
        TEMP temp;                                          \n\
        TEMP cmpres;                                        \n\
        TEX tex0, fragment.texcoord[0], texture[0], 2D;     \n\
        TEX tex1, fragment.texcoord[1], texture[1], 2D;     \n\
        SUB temp, tex1, tex0;                               \n\
        CMP cmpres, temp, tex1, tex0;                       \n\
        MOV result.color, temp;                             \n\
        END";

    m_AsmPSBDarken = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_AsmPSBDarken->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_AsmPSBDarken->LoadPixelShader(AsmPSBDarken.GetTCharPtr());
    m_AsmPSBDarken->Link();

    // Multiply
    NString AsmPSBMultiply = 
                               "!!ARBfp1.0                                         \n\
        TEMP tex0;                                          \n\
        TEMP tex1;                                          \n\
        TEMP temp;                                          \n\
        TEX tex0, fragment.texcoord[0], texture[0], 2D;     \n\
        TEX tex1, fragment.texcoord[1], texture[1], 2D;     \n\
        MUL result.color, tex0, tex1;                       \n\
        END";

    m_AsmPSBMultiply = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_AsmPSBMultiply->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_AsmPSBMultiply->LoadPixelShader(AsmPSBMultiply.GetTCharPtr());
    m_AsmPSBMultiply->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1451 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
      "!!ARBvp1.0                                               \n\
      ATTRIB iPos         = vertex.position;                    \n\
      OUTPUT oPos         = result.position;                    \n\
      OUTPUT oTexCoord0   = result.texcoord[0];                 \n\
      # Transform the vertex to clip coordinates.               \n\
      DP4   oPos.x, state.matrix.mvp.row[0], vertex.position;   \n\
      DP4   oPos.y, state.matrix.mvp.row[1], vertex.position;   \n\
      DP4   oPos.z, state.matrix.mvp.row[2], vertex.position;   \n\
      DP4   oPos.w, state.matrix.mvp.row[3], vertex.position;   \n\
      MOV   oTexCoord0, vertex.attrib[8];                       \n\
      END";


    NString AsmFrg = 
      "!!ARBfp1.0                                     \n\
      PARAM color0 = program.local[0];                \n\
      PARAM CM0 = program.local[1];                   \n\
      PARAM CM1 = program.local[2];                   \n\
      PARAM CM2 = program.local[3];                   \n\
      PARAM CM3 = program.local[4];                   \n\
      PARAM offset = program.local[5];                \n\
      TEMP tex0;                                      \n\
      TEMP final;                                     \n\
      TEX tex0, fragment.texcoord[0], texture[0], 2D; \n\
      MAD final.r, tex0, CM0, offset.r;               \n\
      MAD final.g, tex0, CM1, offset.g;               \n\
      MAD final.b, tex0, CM2, offset.b;               \n\
      MAD final.a, tex0, CM3, offset.a;               \n\
      MUL result.color, color0, final;                \n\
      END";

    NString AsmFrgRect = 
      "!!ARBfp1.0                                     \n\
      PARAM color0 = program.local[0];                \n\
      PARAM CM0 = program.local[1];                   \n\
      PARAM CM1 = program.local[2];                   \n\
      PARAM CM2 = program.local[3];                   \n\
      PARAM CM3 = program.local[4];                   \n\
      PARAM offset = program.local[5];                \n\
      TEMP tex0;                                      \n\
      TEMP final;                                     \n\
      TEX tex0, fragment.texcoord[0], texture[0], 2D; \n\
      MAD final.r, tex0, CM0, offset.r;               \n\
      MAD final.g, tex0, CM1, offset.g;               \n\
      MAD final.b, tex0, CM2, offset.b;               \n\
      MAD final.a, tex0, CM3, offset.a;               \n\
      MUL result.color, color0, final;                \n\
      END";

    _asm_tex_color_matrix_filter_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    _asm_tex_color_matrix_filter_prog->LoadVertexShader(AsmVtx.GetTCharPtr());
    _asm_tex_color_matrix_filter_prog->LoadPixelShader(AsmFrg.GetTCharPtr());
    _asm_tex_color_matrix_filter_prog->Link();

    _asm_texrect_color_matrix_filter_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    _asm_texrect_color_matrix_filter_prog->LoadVertexShader(AsmVtx.GetTCharPtr());
    _asm_texrect_color_matrix_filter_prog->LoadPixelShader(AsmFrgRect.GetTCharPtr());
    _asm_texrect_color_matrix_filter_prog->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 175 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
        "!!ARBvp1.0                                 \n\
        OUTPUT oPos         = result.position;      \n\
        OUTPUT oColor       = result.color;         \n\
        OUTPUT oTexCoord0   = result.texcoord[0];   \n\
        # Transform the vertex to clip coordinates. \n\
        DP4   oPos.x, state.matrix.mvp.row[0], vertex.position;      \n\
        DP4   oPos.y, state.matrix.mvp.row[1], vertex.position;      \n\
        DP4   oPos.z, state.matrix.mvp.row[2], vertex.position;      \n\
        DP4   oPos.w, state.matrix.mvp.row[3], vertex.position;      \n\
        MOV   oColor, vertex.attrib[3];             \n\
        MOV   oTexCoord0, vertex.attrib[8];         \n\
        END";

    NString AsmFrg = 
      "!!ARBfp1.0                                         \n\
      TEMP tex0;                                          \n\
      TEMP temp;                                          \n\
      TEX tex0, fragment.texcoord[0], texture[0], 2D;     \n\
      MOV temp, fragment.color;                           \n\
      MUL temp.w, fragment.color, tex0.wwww;              \n\
      MOV result.color, temp;                             \n\
      END";

    NString AsmFrgRect = 
      "!!ARBfp1.0                                         \n\
      TEMP tex0;                                          \n\
      TEMP temp;                                          \n\
      TEX tex0, fragment.texcoord[0], texture[0], RECT;   \n\
      MOV temp, fragment.color;                           \n\
      MUL temp.w, fragment.color, tex0.wwww;              \n\
      MOV result.color, temp;                             \n\
      END";

    m_AsmColorModTexMaskAlpha = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_AsmColorModTexMaskAlpha->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_AsmColorModTexMaskAlpha->LoadPixelShader(AsmFrg.GetTCharPtr());
    m_AsmColorModTexMaskAlpha->Link();

    m_AsmColorModTexRectMaskAlpha = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_AsmColorModTexRectMaskAlpha->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_AsmColorModTexRectMaskAlpha->LoadPixelShader(AsmFrgRect.GetTCharPtr());
    m_AsmColorModTexRectMaskAlpha->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 103 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
        "!!ARBvp1.0                                 \n\
        ATTRIB iPos         = vertex.position;      \n\
        ATTRIB iColor       = vertex.attrib[3];     \n\
        PARAM  mvp[4]       = {state.matrix.mvp};   \n\
        OUTPUT oPos         = result.position;      \n\
        OUTPUT oColor       = result.color;         \n\
        # Transform the vertex to clip coordinates. \n\
        DP4   oPos.x, mvp[0], iPos;      \n\
        DP4   oPos.y, mvp[1], iPos;      \n\
        DP4   oPos.z, mvp[2], iPos;      \n\
        DP4   oPos.w, mvp[3], iPos;      \n\
        MOV   oColor, iColor;            \n\
        END";

    NString AsmFrg = 
        "!!ARBfp1.0                                     \n\
        MOV result.color, fragment.color;               \n\
        END";

    m_AsmColor = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_AsmColor->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_AsmColor->LoadPixelShader(AsmFrg.GetTCharPtr());
    m_AsmColor->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2288 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
      "!!ARBvp1.0                                 \n\
      ATTRIB iPos         = vertex.position;      \n\
      ATTRIB iColor       = vertex.attrib[3];     \n\
      PARAM  mvp[4]       = {state.matrix.mvp};   \n\
      OUTPUT oPos         = result.position;      \n\
      OUTPUT oColor       = result.color;         \n\
      OUTPUT oTexCoord0   = result.texcoord[0];   \n\
      # Transform the vertex to clip coordinates. \n\
      DP4   oPos.x, mvp[0], iPos;                     \n\
      DP4   oPos.y, mvp[1], iPos;                     \n\
      DP4   oPos.z, mvp[2], iPos;                     \n\
      DP4   oPos.w, mvp[3], iPos;                     \n\
      MOV   oColor, iColor;                           \n\
      MOV   oTexCoord0, vertex.attrib[8];             \n\
      END";

    NString AsmFrg = 
      "!!ARBfp1.0                                       \n\
      TEMP tex0;                                        \n\
      TEMP tex_coord;                                   \n\
      PARAM pixel_size = program.local [0];             \n\
      PARAM pixel_size_inv = program.local [1];         \n\
      MUL tex_coord, fragment.texcoord[0], pixel_size_inv; \n\
      FLR tex_coord, tex_coord;                         \n\
      MUL tex_coord, tex_coord, pixel_size;  \n\
      TEX tex0, tex_coord, texture[0], 2D;              \n\
      MUL result.color, fragment.color, tex0;           \n\
      END";

    NString AsmFrgRect = 
      "!!ARBfp1.0                                       \n\
      TEMP tex0;                                        \n\
      TEMP tex_coord;                                   \n\
      PARAM pixel_size = program.local [0];             \n\
      PARAM pixel_size_inv = program.local [1];         \n\
      MUL tex_coord, fragment.texcoord[0], pixel_size_inv; \n\
      FLR tex_coord, tex_coord;                         \n\
      MUL tex_coord, tex_coord, pixel_size;  \n\
      TEX tex0, tex_coord, texture[0], RECT;            \n\
      MUL result.color, fragment.color, tex0;           \n\
      END";

    m_AsmPixelate = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_AsmPixelate->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_AsmPixelate->LoadPixelShader(AsmFrg.GetTCharPtr());
    m_AsmPixelate->Link();

    m_AsmPixelateRect = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_AsmPixelateRect->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_AsmPixelateRect->LoadPixelShader(AsmFrgRect.GetTCharPtr());
    m_AsmPixelateRect->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1242 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
      "!!ARBvp1.0                                 \n\
      ATTRIB iPos         = vertex.position;      \n\
      OUTPUT oPos         = result.position;      \n\
      OUTPUT oTexCoord0   = result.texcoord[0];   \n\
      # Transform the vertex to clip coordinates. \n\
      DP4   oPos.x, state.matrix.mvp.row[0], vertex.position;      \n\
      DP4   oPos.y, state.matrix.mvp.row[1], vertex.position;      \n\
      DP4   oPos.z, state.matrix.mvp.row[2], vertex.position;      \n\
      DP4   oPos.w, state.matrix.mvp.row[3], vertex.position;      \n\
      MOV   oTexCoord0, vertex.attrib[8];       \n\
      END";


    NString AsmFrg = 
      "!!ARBfp1.0                                       \n\
      PARAM color0 = program.local[0];                  \n\
      PARAM exponent = program.local[1];                \n\
      TEMP tex0;                                        \n\
      TEMP final;                                       \n\
      TEX tex0, fragment.texcoord[0], texture[0], 2D;   \n\
      POW final.r, tex0.r, exponent.r;             \n\
      POW final.g, tex0.g, exponent.g;             \n\
      POW final.b, tex0.b, exponent.b;             \n\
      MOV final.a, tex0.a;                         \n\
      MUL result.color, color0, final;             \n\
      END";

    NString AsmFrgRect = 
      "!!ARBfp1.0                                       \n\
      PARAM color0 = program.local[0];                  \n\
      PARAM exponent = program.local[1];                \n\
      TEMP tex0;                                        \n\
      TEMP final;                                       \n\
      TEX tex0, fragment.texcoord[0], texture[0], RECT;   \n\
      POW final.r, tex0.r, exponent.r;             \n\
      POW final.g, tex0.g, exponent.g;             \n\
      POW final.b, tex0.b, exponent.b;             \n\
      MOV final.a, tex0.a;                         \n\
      MUL result.color, color0, final;             \n\
      END";

    _asm_tex_component_exponentiation_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    _asm_tex_component_exponentiation_prog->LoadVertexShader(AsmVtx.GetTCharPtr());
    _asm_tex_component_exponentiation_prog->LoadPixelShader(AsmFrg.GetTCharPtr());
    _asm_tex_component_exponentiation_prog->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1579 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
      "!!ARBvp1.0                                 \n\
      ATTRIB iPos         = vertex.position;      \n\
      OUTPUT oPos         = result.position;      \n\
      OUTPUT oTexCoord0   = result.texcoord[0];   \n\
      OUTPUT oTexCoord1   = result.texcoord[1];   \n\
      OUTPUT oTexCoord2   = result.texcoord[2];   \n\
      OUTPUT oTexCoord3   = result.texcoord[3];   \n\
      OUTPUT oTexCoord4   = result.texcoord[4];   \n\
      OUTPUT oTexCoord5   = result.texcoord[5];   \n\
      OUTPUT oTexCoord6   = result.texcoord[6];   \n\
      # Transform the vertex to clip coordinates. \n\
      DP4   oPos.x, state.matrix.mvp.row[0], vertex.position;      \n\
      DP4   oPos.y, state.matrix.mvp.row[1], vertex.position;      \n\
      DP4   oPos.z, state.matrix.mvp.row[2], vertex.position;      \n\
      DP4   oPos.w, state.matrix.mvp.row[3], vertex.position;      \n\
      MOV   oTexCoord0, vertex.attrib[8];         \n\
      MOV   oTexCoord1, vertex.attrib[9];         \n\
      MOV   oTexCoord2, vertex.attrib[10];        \n\
      MOV   oTexCoord3, vertex.attrib[11];        \n\
      MOV   oTexCoord4, vertex.attrib[12];        \n\
      MOV   oTexCoord5, vertex.attrib[13];        \n\
      MOV   oTexCoord6, vertex.attrib[14];        \n\
      END";


    NString AsmFrg = 
      "!!ARBfp1.0                                                   \n\
      TEMP tex0;                                                    \n\
      TEMP final;                                                   \n\
      MOV final, {0, 0, 0, 0};                                      \n\
      TEX tex0, fragment.texcoord[0], texture[0], 2D;               \n\
      MAD final, tex0, program.local[0], final;                     \n\
      TEX tex0, fragment.texcoord[1], texture[0], 2D;               \n\
      MAD final, tex0, program.local[1], final;                     \n\
      TEX tex0, fragment.texcoord[2], texture[0], 2D;               \n\
      MAD final, tex0, program.local[2], final;                     \n\
      TEX tex0, fragment.texcoord[3], texture[0], 2D;               \n\
      MAD final, tex0, program.local[3], final;                     \n\
      TEX tex0, fragment.texcoord[4], texture[0], 2D;               \n\
      MAD final, tex0, program.local[4], final;                     \n\
      TEX tex0, fragment.texcoord[5], texture[0], 2D;               \n\
      MAD final, tex0, program.local[5], final;                     \n\
      TEX tex0, fragment.texcoord[6], texture[0], 2D;               \n\
      MAD final, tex0, program.local[6], final;                     \n\
      MOV result.color, final;                                      \n\
      END";


    NString AsmFrgRect = 
      "!!ARBfp1.0                                                   \n\
      TEMP tex0;                                                    \n\
      TEMP final;                                                   \n\
      MOV final, {0, 0, 0, 0};                                      \n\
      TEX tex0, fragment.texcoord[0], texture[0], RECT;             \n\
      MAD final, tex0, program.local[0], final;                     \n\
      TEX tex0, fragment.texcoord[1], texture[0], RECT;             \n\
      MAD final, tex0, program.local[1], final;                     \n\
      TEX tex0, fragment.texcoord[2], texture[0], RECT;             \n\
      MAD final, tex0, program.local[2], final;                     \n\
      TEX tex0, fragment.texcoord[3], texture[0], RECT;             \n\
      MAD final, tex0, program.local[3], final;                     \n\
      TEX tex0, fragment.texcoord[4], texture[0], RECT;             \n\
      MAD final, tex0, program.local[4], final;                     \n\
      TEX tex0, fragment.texcoord[5], texture[0], RECT;             \n\
      MAD final, tex0, program.local[5], final;                     \n\
      TEX tex0, fragment.texcoord[6], texture[0], RECT;             \n\
      MAD final, tex0, program.local[6], final;                     \n\
      MOV result.color, final;                                      \n\
      END";

    _asm_tex_separable_gauss_filter_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    _asm_tex_separable_gauss_filter_prog->LoadVertexShader(AsmVtx.GetTCharPtr());
    _asm_tex_separable_gauss_filter_prog->LoadPixelShader(AsmFrg.GetTCharPtr());
    _asm_tex_separable_gauss_filter_prog->Link();

    _asm_texrect_separable_gauss_filter_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    _asm_texrect_separable_gauss_filter_prog->LoadVertexShader(AsmVtx.GetTCharPtr());
    _asm_texrect_separable_gauss_filter_prog->LoadPixelShader(AsmFrgRect.GetTCharPtr());
    _asm_texrect_separable_gauss_filter_prog->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 131 of file RenderingPipeAsm.cpp.

  {
    NString AsmVtx = 
        "!!ARBvp1.0                                 \n\
        ATTRIB iPos         = vertex.position;      \n\
        ATTRIB iColor       = vertex.attrib[3];     \n\
        PARAM  mvp[4]       = {state.matrix.mvp};   \n\
        OUTPUT oPos         = result.position;      \n\
        OUTPUT oColor       = result.color;         \n\
        OUTPUT oTexCoord0   = result.texcoord[0];   \n\
        # Transform the vertex to clip coordinates. \n\
        DP4   oPos.x, mvp[0], iPos;                     \n\
        DP4   oPos.y, mvp[1], iPos;                     \n\
        DP4   oPos.z, mvp[2], iPos;                     \n\
        DP4   oPos.w, mvp[3], iPos;                     \n\
        MOV   oColor, iColor;                           \n\
        MOV   oTexCoord0, vertex.attrib[8];             \n\
        END";

    NString AsmFrg = 
        "!!ARBfp1.0                                       \n\
        TEMP tex0;                                        \n\
        TEX tex0, fragment.texcoord[0], texture[0], 2D;   \n\
        MUL result.color, fragment.color, tex0;           \n\
        END";

    NString AsmFrgRect = 
      "!!ARBfp1.0                                       \n\
      TEMP tex0;                                        \n\
      TEX tex0, fragment.texcoord[0], texture[0], RECT; \n\
      MUL result.color, fragment.color, tex0;           \n\
      END";

    m_AsmTextureModColor = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_AsmTextureModColor->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_AsmTextureModColor->LoadPixelShader(AsmFrg.GetTCharPtr());
    m_AsmTextureModColor->Link();

    m_AsmTextureRectModColor = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
    m_AsmTextureRectModColor->LoadVertexShader(AsmVtx.GetTCharPtr());
    m_AsmTextureRectModColor->LoadPixelShader(AsmFrgRect.GetTCharPtr());
    m_AsmTextureRectModColor->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 169 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;

    // For some strange reason, make sure that the attribute holding the vertex position has a name that comes first in alphabetic order before all
    // other  attributes. Otherwise you get a bug on NVidia! Why is that???

    VSString =        NUX_VERTEX_SHADER_HEADER
                      "uniform mat4 ViewProjectionMatrix;                      \n\
                      attribute vec4 AVertex;                                 \n\
                      attribute vec4 MyTextureCoord0;                         \n\
                      attribute vec4 MyTextureCoord1;                         \n\
                      varying vec4 varyTexCoord0;                             \n\
                      varying vec4 varyTexCoord1;                             \n\
                      void main()                                             \n\
                      {                                                       \n\
                      varyTexCoord0 = MyTextureCoord0;                        \n\
                      varyTexCoord1 = MyTextureCoord1;                        \n\
                      gl_Position =  ViewProjectionMatrix * (AVertex);        \n\
                      }";

    PSString =      NUX_FRAGMENT_SHADER_HEADER
                    "varying vec4 varyTexCoord0;                                 \n\
                    varying vec4 varyTexCoord1;                                 \n\
                    uniform vec4 color0;                                        \n\
                    uniform vec4 color1;                                        \n\
                    #ifdef SAMPLERTEX2D                                         \n\
                    uniform sampler2D TextureObject0;                           \n\
                    uniform sampler2D TextureObject1;                           \n\
                    vec4 SampleTexture(sampler2D TexObject, vec4 TexCoord)      \n\
                    {                                                           \n\
                    return texture2D(TexObject, TexCoord.st);                   \n\
                    }                                                           \n\
                    #elif defined SAMPLERTEX2DRECT                              \n\
                    uniform sampler2DRect TextureObject0;                       \n\
                    uniform sampler2DRect TextureObject1;                       \n\
                    vec4 SampleTexture(sampler2DRect TexObject, vec4 TexCoord)  \n\
                    {                                                           \n\
                    return texture2DRect(TexObject, TexCoord.st);               \n\
                    }                                                           \n\
                    #endif                                                      \n\
                    void main()                                                 \n\
                    {                                                           \n\
                    vec4 b0 = color0*SampleTexture(TextureObject0, varyTexCoord0);     \n\
                    vec4 b1 = color1*SampleTexture(TextureObject1, varyTexCoord1);     \n\
                    gl_FragColor = b0 + b1;                                             \n\
                    }";

    m_Sl2TextureAdd = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString), "#define SAMPLERTEX2D");

    m_Sl2TextureAdd->ClearShaderObjects();
    m_Sl2TextureAdd->AddShaderObject(VS);
    m_Sl2TextureAdd->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(m_Sl2TextureAdd->GetOpenGLID(), 0, "AVertex"));
    m_Sl2TextureAdd->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 232 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;

    // For some strange reason, make sure that the attribute holding the vertex position has a name that comes first in alphabetic order before all
    // other  attributes. Otherwise you get a bug on NVidia! Why is that???

    VSString =          NUX_VERTEX_SHADER_HEADER
                        "uniform mat4 ViewProjectionMatrix;                      \n\
                        attribute vec4 AVertex;                                 \n\
                        attribute vec4 MyTextureCoord0;                         \n\
                        attribute vec4 MyTextureCoord1;                         \n\
                        varying vec4 varyTexCoord0;                             \n\
                        varying vec4 varyTexCoord1;                             \n\
                        void main()                                             \n\
                        {                                                       \n\
                        varyTexCoord0 = MyTextureCoord0;                        \n\
                        varyTexCoord1 = MyTextureCoord1;                        \n\
                        gl_Position =  ViewProjectionMatrix * (AVertex);        \n\
                        }";

    PSString =      NUX_FRAGMENT_SHADER_HEADER
                    "varying vec4 varyTexCoord0;                                 \n\
                    varying vec4 varyTexCoord1;                                 \n\
                    uniform vec4 color0;                                        \n\
                    uniform vec4 color1;                                        \n\
                    uniform sampler2D TextureObject0;                           \n\
                    uniform sampler2D TextureObject1;                           \n\
                    vec4 SampleTexture(sampler2D TexObject, vec4 TexCoord)      \n\
                    {                                                           \n\
                      return texture2D(TexObject, TexCoord.st);                 \n\
                    }                                                           \n\
                    void main()                                                 \n\
                    {                                                           \n\
                      vec4 noise = SampleTexture(TextureObject0, varyTexCoord0); \n\
                      vec4 noise_bx2 = color0 * (2.0 * noise - vec4(1.0, 1.0, 1.0, 1.0));     \n\
                      vec4 b1 = color1 * SampleTexture(TextureObject1, varyTexCoord1 + noise_bx2);     \n\
                      gl_FragColor = b1;                                          \n\
                    }";

    m_Sl2TextureDepRead = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString));

    m_Sl2TextureDepRead->ClearShaderObjects();
    m_Sl2TextureDepRead->AddShaderObject(VS);
    m_Sl2TextureDepRead->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(m_Sl2TextureDepRead->GetOpenGLID(), 0, "AVertex"));
    m_Sl2TextureDepRead->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 287 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;

    // For some strange reason, make sure that the attribute holding the vertex position has a name that comes first in alphabetic order before all
    // other  attributes. Otherwise you get a bug on NVidia! Why is that???

    VSString =           NUX_VERTEX_SHADER_HEADER
                         "uniform mat4 ViewProjectionMatrix;                      \n\
                         attribute vec4 AVertex;                                 \n\
                         attribute vec4 MyTextureCoord0;                         \n\
                         attribute vec4 MyTextureCoord1;                         \n\
                         varying vec4 varyTexCoord0;                             \n\
                         varying vec4 varyTexCoord1;                             \n\
                         void main()                                             \n\
                         {                                                       \n\
                         varyTexCoord0 = MyTextureCoord0;                        \n\
                         varyTexCoord1 = MyTextureCoord1;                        \n\
                         gl_Position =  ViewProjectionMatrix * (AVertex);        \n\
                         }";

    PSString =           NUX_FRAGMENT_SHADER_HEADER
                         "varying vec4 varyTexCoord0;                                 \n\
                         varying vec4 varyTexCoord1;                                 \n\
                         uniform vec4 color0;                                        \n\
                         uniform vec4 color1;                                        \n\
                         #ifdef SAMPLERTEX2D                                         \n\
                         uniform sampler2D TextureObject0;                           \n\
                         uniform sampler2D TextureObject1;                           \n\
                         vec4 SampleTexture(sampler2D TexObject, vec4 TexCoord)      \n\
                         {                                                           \n\
                         return texture2D(TexObject, TexCoord.st);                   \n\
                         }                                                           \n\
                         #elif defined SAMPLERTEX2DRECT                              \n\
                         uniform sampler2DRect TextureObject0;                       \n\
                         uniform sampler2DRect TextureObject1;                       \n\
                         vec4 SampleTexture(sampler2DRect TexObject, vec4 TexCoord)  \n\
                         {                                                           \n\
                         return texture2DRect(TexObject, TexCoord.st);               \n\
                         }                                                           \n\
                         #endif                                                      \n\
                         void main()                                                 \n\
                         {                                                           \n\
                         vec4 b0 = color0*SampleTexture(TextureObject0, varyTexCoord0);     \n\
                         vec4 b1 = color1*SampleTexture(TextureObject1, varyTexCoord1);     \n\
                         gl_FragColor = b0 * b1;                                            \n\
                         }";

    m_Sl2TextureMod = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString), "#define SAMPLERTEX2D");

    m_Sl2TextureMod->ClearShaderObjects();
    m_Sl2TextureMod->AddShaderObject(VS);
    m_Sl2TextureMod->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(m_Sl2TextureMod->GetOpenGLID(), 0, "AVertex"));
    m_Sl2TextureMod->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 350 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;

    // For some strange reason, make sure that the attribute holding the vertex position has a name that comes first in alphabetic order before all
    // other  attributes. Otherwise you get a bug on NVidia! Why is that???

    VSString =          NUX_VERTEX_SHADER_HEADER
                        "uniform mat4 ViewProjectionMatrix;                      \n\
                        attribute vec4 AVertex;                                 \n\
                        attribute vec4 MyTextureCoord0;                         \n\
                        attribute vec4 MyTextureCoord1;                         \n\
                        attribute vec4 MyTextureCoord2;                         \n\
                        attribute vec4 MyTextureCoord3;                         \n\
                        varying vec4 varyTexCoord0;                             \n\
                        varying vec4 varyTexCoord1;                             \n\
                        varying vec4 varyTexCoord2;                             \n\
                        varying vec4 varyTexCoord3;                             \n\
                        void main()                                             \n\
                        {                                                       \n\
                        varyTexCoord0 = MyTextureCoord0;                        \n\
                        varyTexCoord1 = MyTextureCoord1;                        \n\
                        varyTexCoord2 = MyTextureCoord2;                        \n\
                        varyTexCoord3 = MyTextureCoord3;                        \n\
                        gl_Position =  ViewProjectionMatrix * (AVertex);        \n\
                        }";

    PSString =          NUX_FRAGMENT_SHADER_HEADER
                        "varying vec4 varyTexCoord0;                                 \n\
                        varying vec4 varyTexCoord1;                                 \n\
                        varying vec4 varyTexCoord2;                                 \n\
                        varying vec4 varyTexCoord3;                                 \n\
                        uniform vec4 color0;                                        \n\
                        uniform vec4 color1;                                        \n\
                        uniform vec4 color2;                                        \n\
                        uniform vec4 color3;                                        \n\
                        uniform sampler2D TextureObject0;                           \n\
                        uniform sampler2D TextureObject1;                           \n\
                        uniform sampler2D TextureObject2;                           \n\
                        uniform sampler2D TextureObject3;                           \n\
                        vec4 SampleTexture(sampler2D TexObject, vec4 TexCoord)      \n\
                        {                                                           \n\
                        return texture2D(TexObject, TexCoord.st);                   \n\
                        }                                                           \n\
                        void main()                                                 \n\
                        {                                                           \n\
                          vec4 b0 = color0*SampleTexture(TextureObject0, varyTexCoord0);  \n\
                          vec4 b1 = color1*SampleTexture(TextureObject1, varyTexCoord1);  \n\
                          vec4 b2 = color2*SampleTexture(TextureObject2, varyTexCoord2);  \n\
                          vec4 b3 = color3*SampleTexture(TextureObject3, varyTexCoord3);  \n\
                          gl_FragColor = b0+b1+b2+b3;                                     \n\
                        }";

    // Textured 2D Primitive Shader
    m_Sl4TextureAdd = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString));

    m_Sl4TextureAdd->ClearShaderObjects();
    m_Sl4TextureAdd->AddShaderObject(VS);
    m_Sl4TextureAdd->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(m_Sl4TextureAdd->GetOpenGLID(), 0, "AVertex"));
    m_Sl4TextureAdd->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 467 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;


    VSString = NUX_VERTEX_SHADER_HEADER
        "uniform mat4 ViewProjectionMatrix;                  \n\
        attribute vec4 AVertex;                             \n\
        attribute vec4 MyTextureCoord0;                     \n\
        varying vec4 varyTexCoord0;                         \n\
        void main()                                         \n\
        {                                                   \n\
          varyTexCoord0 = MyTextureCoord0;                  \n\
          gl_Position =  ViewProjectionMatrix * (AVertex);  \n\
        }";

    PSString = NUX_FRAGMENT_SHADER_HEADER
        "varying vec4 varyTexCoord0;                                   \n\
        uniform sampler2D TextureObject0;                             \n\
        uniform vec4 color0;                                          \n\
        vec4 SampleTexture(sampler2D TexObject, vec4 TexCoord)        \n\
        {                                                             \n\
          return texture2D(TexObject, TexCoord.st);                   \n\
        }                                                             \n\
        void main()                                                  \n\
        {                                                             \n\
          vec4 v = SampleTexture(TextureObject0, varyTexCoord0);      \n\
          gl_FragColor = vec4(v.a, v.a, v.a, v.a) * color0;           \n\
        }";

    _alpha_replicate_prog = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString));

    _alpha_replicate_prog->ClearShaderObjects();
    _alpha_replicate_prog->AddShaderObject(VS);
    _alpha_replicate_prog->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(_alpha_replicate_prog->GetOpenGLID(), 0, "AVertex"));
    _alpha_replicate_prog->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 795 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;


    VSString = 
                      NUX_VERTEX_SHADER_HEADER
        "uniform mat4 ViewProjectionMatrix;  \n\
        attribute vec4 AVertex;             \n\
        attribute vec4 MyTextureCoord0;     \n\
        varying vec4 varyTexCoord0;         \n\
        void main()                         \n\
        {                                   \n\
          varyTexCoord0 = MyTextureCoord0;  \n\
          gl_Position =  ViewProjectionMatrix * (AVertex);  \n\
        }";

    PSString = 
                    NUX_FRAGMENT_SHADER_HEADER
        "varying vec4 varyTexCoord0;                                 \n\
        uniform sampler2D TextureObject0;                           \n\
        uniform vec4 color0;                                        \n\
        vec4 SampleTexture(sampler2D TexObject, vec2 TexCoord)      \n\
        {                                                           \n\
          return texture2D(TexObject, TexCoord.st);                 \n\
        }                                                           \n\
        // Color Matrix                                             \n\
        uniform float CM0[5];                                       \n\
        uniform float CM1[5];                                       \n\
        uniform float CM2[5];                                       \n\
        uniform float CM3[5];                                       \n\
        void main(void)                                            \n\
        {                                                               \n\
          vec4 tex0 = SampleTexture(TextureObject0, varyTexCoord0.st); \n\
          float r = CM0[0]* tex0.r + CM0[1]* tex0.g + CM0[2]* tex0.b + CM0[3]* tex0.a + CM0[4]; \n\
          float g = CM1[0]* tex0.r + CM1[1]* tex0.g + CM1[2]* tex0.b + CM1[3]* tex0.a + CM1[4]; \n\
          float b = CM2[0]* tex0.r + CM2[1]* tex0.g + CM2[2]* tex0.b + CM2[3]* tex0.a + CM2[4]; \n\
          float a = CM3[0]* tex0.r + CM3[1]* tex0.g + CM3[2]* tex0.b + CM3[3]* tex0.a + CM3[4]; \n\
          gl_FragColor = color0 * vec4(r, g, b, tex0.a);                                        \n\
        }";

    _color_matrix_filter_prog = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString), "#define SAMPLERTEX2D");

    _color_matrix_filter_prog->ClearShaderObjects();
    _color_matrix_filter_prog->AddShaderObject(VS);
    _color_matrix_filter_prog->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(_color_matrix_filter_prog->GetOpenGLID(), 0, "AVertex"));
    _color_matrix_filter_prog->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 120 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;

    VSString =  
                     NUX_VERTEX_SHADER_HEADER
                     "attribute vec4 AVertex;                                 \n\
                     attribute vec4 MyTextureCoord0;                         \n\
                     attribute vec4 VertexColor;                             \n\
                     uniform mat4 ViewProjectionMatrix;                      \n\
                     varying vec4 varyTexCoord0;                             \n\
                     varying vec4 varyVertexColor;                           \n\
                     void main()                                             \n\
                     {                                                       \n\
                     gl_Position =  ViewProjectionMatrix * (AVertex);        \n\
                     varyTexCoord0 = MyTextureCoord0;                        \n\
                     varyVertexColor = VertexColor;                          \n\
                     }";

    PSString =  
                    NUX_FRAGMENT_SHADER_HEADER
                    "varying vec4 varyTexCoord0;                                        \n\
                     varying vec4 varyVertexColor;                                      \n\
                     uniform sampler2D TextureObject0;                                  \n\
                     vec4 SampleTexture(sampler2D TexObject, vec4 TexCoord)             \n\
                     {                                                                  \n\
                     return texture2D(TexObject, TexCoord.st);                          \n\
                     }                                                                  \n\
                     void main()                                                        \n\
                     {                                                                  \n\
                     float alpha = SampleTexture(TextureObject0, varyTexCoord0).w;      \n\
                     gl_FragColor = vec4(varyVertexColor.xyz, alpha*varyVertexColor.a); \n\
                     }";

    m_SlColorModTexMaskAlpha = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString), "#define SAMPLERTEX2D");
    m_SlColorModTexMaskAlpha->ClearShaderObjects();
    m_SlColorModTexMaskAlpha->AddShaderObject(VS);
    m_SlColorModTexMaskAlpha->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(m_SlColorModTexMaskAlpha->GetOpenGLID(), 0, "AVertex"));
    CHECKGL(glBindAttribLocation(m_SlColorModTexMaskAlpha->GetOpenGLID(), 1, "MyTextureCoord0"));
    CHECKGL(glBindAttribLocation(m_SlColorModTexMaskAlpha->GetOpenGLID(), 2, "VectexColor"));
    m_SlColorModTexMaskAlpha->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 34 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;

    VSString =  
                     NUX_VERTEX_SHADER_HEADER
                     "uniform mat4 ViewProjectionMatrix;                \n\
                     attribute vec4 AVertex;                            \n\
                     attribute vec4 VertexColor;                        \n\
                     varying vec4 vColor;                               \n\
                     void main()                                        \n\
                     {                                                  \n\
                         gl_Position = ViewProjectionMatrix * AVertex;  \n\
                         vColor = VertexColor;                          \n\
                     }";

    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));

    PSString =  
                    NUX_FRAGMENT_SHADER_HEADER
                    "varying vec4 vColor;           \n\
                     void main()                    \n\
                     {                              \n\
                         gl_FragColor = vColor;     \n\
                     }";
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString));

    m_SlColor = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    m_SlColor->ClearShaderObjects();
    m_SlColor->AddShaderObject(VS);
    m_SlColor->AddShaderObject(PS);
    m_SlColor->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 511 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;


    VSString = NUX_VERTEX_SHADER_HEADER
        "uniform mat4 ViewProjectionMatrix;  \n\
        attribute vec4 AVertex;             \n\
        attribute vec4 MyTextureCoord0;     \n\
        attribute vec4 VertexColor;         \n\
        varying vec4 varyTexCoord0;         \n\
        varying vec4 varyVertexColor;       \n\
        void main()                         \n\
        {                                   \n\
          varyTexCoord0 = MyTextureCoord0;  \n\
          varyVertexColor = VertexColor;    \n\
          gl_Position =  ViewProjectionMatrix * (AVertex);  \n\
        }";


    PSString = NUX_FRAGMENT_SHADER_HEADER
        "varying vec4 varyTexCoord0;                                   \n\
        varying vec4 varyVertexColor;                                 \n\
        uniform sampler2D TextureObject0;                             \n\
        uniform vec2 TextureSize0;                                    \n\
        vec4 SampleTexture(sampler2D TexObject, vec2 TexCoord)        \n\
        {                                                             \n\
          return texture2D(TexObject, TexCoord.st);                   \n\
        }                                                             \n\
        #define NUM_SAMPLES 7                                         \n\
        uniform float W[NUM_SAMPLES];                                 \n\
        void main()                                                   \n\
        {                                                             \n\
          vec4 sum   = vec4(0.0, 0.0, 0.0, 0.0);                     \n\
          vec2 delta = vec2(1.0 / TextureSize0.x, 0.0);              \n\
          vec2 texCoord = vec2(varyTexCoord0.s, varyTexCoord0.t);    \n\
          texCoord.x -= float((NUM_SAMPLES - 1) / 2) / TextureSize0.x; \n\
          texCoord.y += 0.0 / TextureSize0.y;                         \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[0];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[1];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[2];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[3];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[4];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[5];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[6];     \n\
          texCoord += delta;                                          \n\
          gl_FragColor = vec4(sum.x, sum.y, sum.z, sum.w);           \n\
        }";

    _horizontal_gauss_filter_prog = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString), "#define SAMPLERTEX2D");

    _horizontal_gauss_filter_prog->ClearShaderObjects();
    _horizontal_gauss_filter_prog->AddShaderObject(VS);
    _horizontal_gauss_filter_prog->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(_horizontal_gauss_filter_prog->GetOpenGLID(), 0, "AVertex"));
    _horizontal_gauss_filter_prog->Link();

  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 649 of file RenderingPipeGLSL.cpp.

  {
    int k = Clamp<int>(sigma, NUX_MIN_GAUSSIAN_SIGMA, NUX_MAX_GAUSSIAN_SIGMA);
    if (_horizontal_hq_gauss_filter_prog[k-1].IsValid())
    {
      // Shader program already compiled
      return;
    }

    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;


    VSString = NUX_VERTEX_SHADER_HEADER
                     "uniform mat4 ViewProjectionMatrix;   \n\
                     attribute vec4 AVertex;              \n\
                     attribute vec4 MyTextureCoord0;      \n\
                     attribute vec4 VertexColor;          \n\
                     varying vec4 varyTexCoord0;          \n\
                     varying vec4 varyVertexColor;        \n\
                     void main()                          \n\
                     {                                    \n\
                     varyTexCoord0 = MyTextureCoord0;     \n\
                     varyVertexColor = VertexColor;       \n\
                     gl_Position =  ViewProjectionMatrix * (AVertex);  \n\
                     }";


    PSString =       NUX_FRAGMENT_SHADER_HEADER
                     "varying vec4 varyTexCoord0;                                  \n\
                     varying vec4 varyVertexColor;                                \n\
                     uniform sampler2D TextureObject0;                            \n\
                     uniform vec2 TextureSize0;                                   \n\
                     vec4 SampleTexture(sampler2D TexObject, vec2 TexCoord)       \n\
                     {                                                            \n\
                     return texture2D(TexObject, TexCoord.st);                    \n\
                     }                                                            \n\
                     #define NUM_SAMPLES %d                                       \n\
                     uniform float W[NUM_SAMPLES];                                \n\
                     void main()                                                  \n\
                     {                                                            \n\
                     vec4 sum   = vec4(0.0, 0.0, 0.0, 0.0);                       \n\
                     vec2 delta = vec2(1.0 / TextureSize0.x, 0.0);                \n\
                     vec2 texCoord = vec2(varyTexCoord0.s, varyTexCoord0.t);      \n\
                     texCoord.x -= float((NUM_SAMPLES - 1) / 2) / TextureSize0.x;      \n\
                     texCoord.y += 0.0 / TextureSize0.y;                          \n\
                     for (int i = 0; i < NUM_SAMPLES; i++)                         \n\
                     {                                                            \n\
                     sum += SampleTexture(TextureObject0, texCoord) * W[i];       \n\
                     texCoord += delta;                                           \n\
                     }                                                            \n\
                     gl_FragColor = vec4(sum.x, sum.y, sum.z, 1.0);             \n\
                     }";

    int l = PSString.Size();
    char* shader_prog = new char[l+10];
    sprintf(shader_prog, PSString.GetTCharPtr(), 6 * k + 1);

    _horizontal_hq_gauss_filter_prog[k-1] = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(shader_prog, "#define SAMPLERTEX2D");
    delete [] shader_prog;

    _horizontal_hq_gauss_filter_prog[k-1]->ClearShaderObjects();
    _horizontal_hq_gauss_filter_prog[k-1]->AddShaderObject(VS);
    _horizontal_hq_gauss_filter_prog[k-1]->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(_horizontal_hq_gauss_filter_prog[k-1]->GetOpenGLID(), 0, "AVertex"));
    _horizontal_hq_gauss_filter_prog[k-1]->Link();

  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2616 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;

    VSString =  
                      NUX_VERTEX_SHADER_HEADER
                      "attribute vec4 AVertex;                                 \n\
                      attribute vec4 MyTextureCoord0;                         \n\
                      attribute vec4 VertexColor;                             \n\
                      uniform mat4 ViewProjectionMatrix;                      \n\
                      varying vec4 varyTexCoord0;                             \n\
                      varying vec4 varyVertexColor;                           \n\
                      void main()                                             \n\
                      {                                                       \n\
                      gl_Position =  ViewProjectionMatrix * (AVertex);        \n\
                      varyTexCoord0 = MyTextureCoord0;                        \n\
                      varyVertexColor = VertexColor;                          \n\
                      }";

    PSString =  
                    NUX_FRAGMENT_SHADER_HEADER
                      "varying vec4 varyTexCoord0;                                 \n\
                      varying vec4 varyVertexColor;                               \n\
                      uniform vec4 pixel_size;                                    \n\
                      uniform vec4 pixel_size_inv;                                \n\
                      uniform sampler2D TextureObject0;                           \n\
                      vec4 SampleTexture(sampler2D TexObject, vec4 TexCoord)      \n\
                      {                                                           \n\
                        return texture2D(TexObject, TexCoord.st);                 \n\
                      }                                                           \n\
                      void main()                                                 \n\
                      {                                                           \n\
                        vec4 tex_coord = floor(varyTexCoord0 * pixel_size_inv) * pixel_size;          \n\
                        vec4 v = SampleTexture(TextureObject0, tex_coord);        \n\
                        gl_FragColor = v*varyVertexColor;                         \n\
                      }";

    // Textured 2D Primitive Shader
    m_SLPixelate = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString), "#define SAMPLERTEX2D");

    m_SLPixelate->ClearShaderObjects();
    m_SLPixelate->AddShaderObject(VS);
    m_SLPixelate->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(m_SLPixelate->GetOpenGLID(), 0, "AVertex"));
    m_SLPixelate->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 419 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;

    VSString =  NUX_VERTEX_SHADER_HEADER
        "uniform mat4 ViewProjectionMatrix;                  \n\
        attribute vec4 AVertex;                             \n\
        attribute vec4 MyTextureCoord0;                     \n\
        varying vec4 varyTexCoord0;                         \n\
        void main()                                         \n\
        {                                                   \n\
          varyTexCoord0 = MyTextureCoord0;                  \n\
          gl_Position =  ViewProjectionMatrix * (AVertex);  \n\
        }";

    PSString =  NUX_FRAGMENT_SHADER_HEADER
        "varying vec4 varyTexCoord0;                                                                           \n\
        uniform sampler2D TextureObject0;                                                                     \n\
        uniform vec2 TextureSize0;                                                                            \n\
        uniform vec4 exponent;                                                                                \n\
        uniform vec4 color0;                                                                                  \n\
        vec4 SampleTexture(sampler2D TexObject, vec2 TexCoord)                                                \n\
        {                                                                                                     \n\
          return texture2D(TexObject, TexCoord.st);                                                           \n\
        }                                                                                                     \n\
        void main(void)                                                                                      \n\
        {                                                                                                         \n\
          vec4 TexColor = SampleTexture(TextureObject0, varyTexCoord0.st);                                    \n\
          vec4 result = pow(TexColor, exponent);                                                              \n\
          gl_FragColor = color0*result;                                                                       \n\
        }";


    _component_exponentiation_prog = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString));

    _component_exponentiation_prog->ClearShaderObjects();
    _component_exponentiation_prog->AddShaderObject(VS);
    _component_exponentiation_prog->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(_component_exponentiation_prog->GetOpenGLID(), 0, "AVertex"));
    _component_exponentiation_prog->Link();

  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 71 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;

    VSString =  
                     NUX_VERTEX_SHADER_HEADER
                     "attribute vec4 AVertex;                                 \n\
                     attribute vec4 MyTextureCoord0;                         \n\
                     attribute vec4 VertexColor;                             \n\
                     uniform mat4 ViewProjectionMatrix;                      \n\
                     varying vec4 varyTexCoord0;                             \n\
                     varying vec4 varyVertexColor;                           \n\
                     void main()                                             \n\
                     {                                                       \n\
                     gl_Position =  ViewProjectionMatrix * (AVertex);        \n\
                     varyTexCoord0 = MyTextureCoord0;                        \n\
                     varyVertexColor = VertexColor;                          \n\
                     }";

    PSString =  
                    NUX_FRAGMENT_SHADER_HEADER
                     "varying vec4 varyTexCoord0;                                 \n\
                     varying vec4 varyVertexColor;                               \n\
                     uniform sampler2D TextureObject0;                           \n\
                     vec4 SampleTexture(sampler2D TexObject, vec4 TexCoord)      \n\
                     {                                                           \n\
                     return texture2D(TexObject, TexCoord.st);                   \n\
                     }                                                           \n\
                     void main()                                                 \n\
                     {                                                           \n\
                     vec4 v = SampleTexture(TextureObject0, varyTexCoord0);      \n\
                     gl_FragColor = v*varyVertexColor;                           \n\
                     }";

    // Textured 2D Primitive Shader
    m_SlTextureModColor = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString), "#define SAMPLERTEX2D");

    m_SlTextureModColor->ClearShaderObjects();
    m_SlTextureModColor->AddShaderObject(VS);
    m_SlTextureModColor->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(m_SlTextureModColor->GetOpenGLID(), 0, "AVertex"));
    m_SlTextureModColor->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 581 of file RenderingPipeGLSL.cpp.

  {
    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;

    VSString = NUX_VERTEX_SHADER_HEADER
        "uniform mat4 ViewProjectionMatrix;  \n\
        attribute vec4 AVertex;             \n\
        attribute vec4 MyTextureCoord0;     \n\
        attribute vec4 VertexColor;         \n\
        varying vec4 varyTexCoord0;         \n\
        varying vec4 varyVertexColor;       \n\
        void main()                         \n\
        {                                   \n\
          varyTexCoord0 = MyTextureCoord0;  \n\
          varyVertexColor = VertexColor;    \n\
          gl_Position =  ViewProjectionMatrix * (AVertex);  \n\
        }";


    PSString = NUX_FRAGMENT_SHADER_HEADER
        "varying vec4 varyTexCoord0;                                   \n\
        varying vec4 varyVertexColor;                                 \n\
        uniform sampler2D TextureObject0;                             \n\
        uniform vec2 TextureSize0;                                    \n\
        vec4 SampleTexture(sampler2D TexObject, vec2 TexCoord)       \n\
        {                                                             \n\
          return texture2D(TexObject, TexCoord.st);                  \n\
        }                                                             \n\
        #define NUM_SAMPLES 7                                         \n\
        uniform float W [NUM_SAMPLES];                                \n\
        void main()                                                  \n\
        {                                                             \n\
          vec4 sum   = vec4(0.0, 0.0, 0.0, 0.0);                     \n\
          vec2 delta = vec2(0.0, 1.0 / TextureSize0.y);              \n\
          vec2 texCoord = vec2(varyTexCoord0.s, varyTexCoord0.t);    \n\
          texCoord.x += 0.0 / TextureSize0.x;                         \n\
          texCoord.y -= float((NUM_SAMPLES - 1) / 2) / TextureSize0.y;     \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[0];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[1];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[2];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[3];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[4];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[5];     \n\
          texCoord += delta;                                          \n\
          sum += SampleTexture(TextureObject0, texCoord) * W[6];     \n\
          texCoord += delta;                                          \n\
          gl_FragColor = vec4(sum.x, sum.y, sum.z, sum.w);           \n\
        }";

    _vertical_gauss_filter_prog = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(TCHAR_TO_ANSI(*PSString), "#define SAMPLERTEX2D");

    _vertical_gauss_filter_prog->ClearShaderObjects();
    _vertical_gauss_filter_prog->AddShaderObject(VS);
    _vertical_gauss_filter_prog->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(_vertical_gauss_filter_prog->GetOpenGLID(), 0, "AVertex"));
    _vertical_gauss_filter_prog->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GraphicsEngine::InitSLVerticalHQGaussFilter ( int  sigma) [private]

Definition at line 722 of file RenderingPipeGLSL.cpp.

  {
    int k = Clamp<int>(sigma, NUX_MIN_GAUSSIAN_SIGMA, NUX_MAX_GAUSSIAN_SIGMA);
    if (_vertical_hq_gauss_filter_prog[k-1].IsValid())
    {
      // Shader program already compiled
      return;
    }

    ObjectPtr<IOpenGLVertexShader> VS = _graphics_display.m_DeviceFactory->CreateVertexShader();
    ObjectPtr<IOpenGLPixelShader> PS = _graphics_display.m_DeviceFactory->CreatePixelShader();
    NString VSString;
    NString PSString;

    VSString = 
                      NUX_VERTEX_SHADER_HEADER
                     "uniform mat4 ViewProjectionMatrix;   \n\
                     attribute vec4 AVertex;              \n\
                     attribute vec4 MyTextureCoord0;      \n\
                     attribute vec4 VertexColor;          \n\
                     varying vec4 varyTexCoord0;          \n\
                     varying vec4 varyVertexColor;        \n\
                     void main()                          \n\
                     {                                    \n\
                     varyTexCoord0 = MyTextureCoord0;     \n\
                     varyVertexColor = VertexColor;       \n\
                     gl_Position =  ViewProjectionMatrix * (AVertex);  \n\
                     }";


    PSString = 
                    NUX_FRAGMENT_SHADER_HEADER
                     "varying vec4 varyTexCoord0;                                  \n\
                     varying vec4 varyVertexColor;                                \n\
                     uniform sampler2D TextureObject0;                            \n\
                     uniform vec2 TextureSize0;                                   \n\
                     vec4 SampleTexture(sampler2D TexObject, vec2 TexCoord)      \n\
                     {                                                            \n\
                     return texture2D(TexObject, TexCoord.st);                   \n\
                     }                                                            \n\
                     #define NUM_SAMPLES %d                                       \n\
                     uniform float W [NUM_SAMPLES];                               \n\
                     void main()                                                 \n\
                     {                                                            \n\
                     vec4 sum   = vec4(0.0, 0.0, 0.0, 0.0);                      \n\
                     vec2 delta = vec2(0.0, 1.0 / TextureSize0.y);               \n\
                     vec2 texCoord = vec2(varyTexCoord0.s, varyTexCoord0.t);     \n\
                     texCoord.x += 0.0 / TextureSize0.x;                          \n\
                     texCoord.y -= float((NUM_SAMPLES - 1) / 2) / TextureSize0.y;      \n\
                     for (int i = 0; i < NUM_SAMPLES; ++i)                        \n\
                     {                                                            \n\
                     sum += SampleTexture(TextureObject0, texCoord) * W[i];      \n\
                     texCoord += delta;                                           \n\
                     }                                                            \n\
                     gl_FragColor = vec4(sum.x, sum.y, sum.z, 1.0);            \n\
                     }";

    int l = PSString.Size();
    char* shader_prog = new char[l+10];
    sprintf(shader_prog, PSString.GetTCharPtr(), 6 * k + 1);

    _vertical_hq_gauss_filter_prog[k-1] = _graphics_display.m_DeviceFactory->CreateShaderProgram();
    VS->SetShaderCode(TCHAR_TO_ANSI(*VSString));
    PS->SetShaderCode(shader_prog, "#define SAMPLERTEX2D");
    delete [] shader_prog;

    _vertical_hq_gauss_filter_prog[k-1]->ClearShaderObjects();
    _vertical_hq_gauss_filter_prog[k-1]->AddShaderObject(VS);
    _vertical_hq_gauss_filter_prog[k-1]->AddShaderObject(PS);
    CHECKGL(glBindAttribLocation(_vertical_hq_gauss_filter_prog[k-1]->GetOpenGLID(), 0, "AVertex"));
    _vertical_hq_gauss_filter_prog[k-1]->Link();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1289 of file GraphicsEngine.cpp.

  {
    return ResourceCache.IsCachedResource(Resource);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

BaseTexture* nux::GraphicsEngine::Load2DTextureFileGenerateAlpha ( const char *  filename,
int  red,
int  green,
int  blue 
)

Return the depth of the model view matrix stack.

Returns:
The depth of the model view matrix stack.

Definition at line 971 of file GraphicsEngine.cpp.

  {
    return(int)_model_view_stack.size();
  }

Transform a rectangle with the model view matrix.

This transformation is only good as long as the model view matrix only contains 2D translations. The output rectangle width and height are the same as the input rectangle.

Parameters:
rectThe rectangle to transform.

Definition at line 963 of file GraphicsEngine.cpp.

  {
    Vector4 v0(rect.x, rect.y, 0.0f, 1.0f);
    Vector4 v1 = _model_view_matrix * v0;
    Rect r(v1.x, v1.y, rect.width, rect.height);
    return r;
  }

Here is the caller graph for this function:

GraphicsEngine* nux::GraphicsEngine::operator& ( ) [private]
GraphicsEngine& nux::GraphicsEngine::operator= ( const GraphicsEngine ) [private]

Definition at line 860 of file GraphicsEngine.cpp.

  {
    Matrix4 Mat;
    Mat.Zero();

    if (m_2DModelViewMatricesStack.size() <= 0)
      return Mat;

    std::list<Matrix4>::iterator it;
    it = m_2DModelViewMatricesStack.end();
    --it;
    Mat = (*it);
    m_2DModelViewMatricesStack.pop_back();

    {
      _model_view_matrix.Translate(m_CurrrentContext.x + RASTERIZATION_OFFSET, m_CurrrentContext.y + RASTERIZATION_OFFSET, 0);
      Matrix4 temp;
      std::list<Matrix4>::iterator it;

      for (it = m_2DModelViewMatricesStack.begin(); it != m_2DModelViewMatricesStack.end(); it++)
      {
        temp = _model_view_matrix;
        _model_view_matrix = temp * (*it);
      }
    }
    return Mat;
  }

Here is the call graph for this function:

Definition at line 825 of file GraphicsEngine.cpp.

  {
#ifndef NUX_OPENGLES_20
    CHECKGL(glMatrixMode(GL_PROJECTION));
    CHECKGL(glLoadIdentity());
    CHECKGL(glMatrixMode(GL_MODELVIEW));
    CHECKGL(glLoadIdentity());
    CHECKGL(glFrustum(
                -1.0,     // left
                1.0,      // right
                -1.0,     // bottom
                1.0,      // top
                0.1,    // near,
                2000.0  // far
              ));
#endif
  }

Here is the caller graph for this function:

Pop a raster operation configuration setting off the stack.

Return True is a matrix was successfully popped. False if there was no matrix to pop.

Definition at line 996 of file GraphicsEngine.cpp.

  {
    if (_blend_stack.size() == 0)
    {
      GetRenderStates().SetBlend(false, GL_ONE, GL_ZERO);
      return false;
    }

    _blend_stack.pop_front();
    
    BlendOperator blend_op = (*_blend_stack.begin());
    GetRenderStates().SetBlend(blend_op._enable, blend_op._src_blend, blend_op._dst_blend);

    return true;
  }

Here is the call graph for this function:

Definition at line 728 of file GraphicsEngine.cpp.

  {
    if (_clip_offset_stack.size() == 0)
    {
      _clip_offset_x = 0;
      _clip_offset_y = 0;
    }

    _clip_offset_stack.pop_back();

    _clip_offset_x = 0;
    _clip_offset_y = 0;

    std::list<Point>::iterator it;
    for (it = _clip_offset_stack.begin(); it != _clip_offset_stack.end(); it++)
    {
      _clip_offset_x += (*it).x;
      _clip_offset_y += (*it).y;
    }
  }

Definition at line 567 of file GraphicsEngine.cpp.

  {
    if (_graphics_display.m_DeviceFactory->GetCurrentFrameBufferObject().IsValid())
    {
      _graphics_display.m_DeviceFactory->GetCurrentFrameBufferObject()->PopClippingRegion();
      return;
    }

    ClippingRect.pop_back();
    unsigned int stacksize = (unsigned int) ClippingRect.size();

    if (stacksize == 0)
    {
      _clipping_rect = Rect(0, 0, _viewport.width, _viewport.height);
      EnableScissoring(true);
      SetOpenGLClippingRectangle(0, 0, _viewport.width, _viewport.height);
    }
    else
    {
      _clipping_rect = ClippingRect [stacksize-1];
      Rect B = _clipping_rect;
      EnableScissoring(true);
      SetOpenGLClippingRectangle(B.x, _viewport.height - B.y - B.GetHeight(), B.GetWidth(), B.GetHeight());
    }
  }

Here is the call graph for this function:

Pop a model view matrix off the stack.

Return True is a matrix was successfully popped. False if there was no matrix to pop.

Definition at line 928 of file GraphicsEngine.cpp.

  {
    if (!_model_view_stack.empty())
      _model_view_stack.pop_back();

    if (_model_view_stack.empty())
    {
      _model_view_matrix = Matrix4::IDENTITY();
      return false;
    }

    _model_view_matrix = _model_view_stack.back();

    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Pop a projection matrix off the stack.

Return True is a matrix was successfully popped. False if there was no matrix to pop.

Return the depth of the projection matrix stack.

Returns:
The depth of the projection matrix stack.

Definition at line 843 of file GraphicsEngine.cpp.

  {
    m_2DModelViewMatricesStack.push_back(mat);
    {
      _model_view_matrix.Translate(m_CurrrentContext.x + RASTERIZATION_OFFSET, m_CurrrentContext.y + RASTERIZATION_OFFSET, 0);
      Matrix4 temp;
      std::list<Matrix4>::iterator it;

      for (it = m_2DModelViewMatricesStack.begin(); it != m_2DModelViewMatricesStack.end(); it++)
      {
        temp = _model_view_matrix;
        _model_view_matrix = (*it) * temp;
      }

    }
  }

Here is the call graph for this function:

void nux::GraphicsEngine::Push2DTranslationModelViewMatrix ( float  tx,
float  ty,
float  tz 
)

Push a 2D Translation model view matrix.

This is used by Nux to harmonize quads and lines pixel rendering in OpenGL.

Definition at line 920 of file GraphicsEngine.cpp.

  {
    Matrix4 temp;
    temp.Translate(tx, ty, tz);

    PushModelViewMatrix(temp);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GraphicsEngine::Push2DWindow ( int  w,
int  h 
)

Push a screen aligned 2D matrix.

Definition at line 784 of file GraphicsEngine.cpp.

  {
#ifndef NUX_OPENGLES_20
    {
      _model_view_matrix.Translate(m_CurrrentContext.x + RASTERIZATION_OFFSET, m_CurrrentContext.y + RASTERIZATION_OFFSET, 0);
      Matrix4 temp;
      std::list<Matrix4>::iterator it;

      for (it = m_2DModelViewMatricesStack.begin(); it != m_2DModelViewMatricesStack.end(); it++)
      {
        temp = _model_view_matrix;
        _model_view_matrix = temp * (*it);
      }

    }

    {
      _projection_matrix.Orthographic(0, w, h, 0, -1.0f, 1.0f);
    }
#else
    // ModelView
    {
      _model_view_matrix.Translate(m_CurrrentContext.x + RASTERIZATION_OFFSET, m_CurrrentContext.y + RASTERIZATION_OFFSET, 0);
      Matrix4 temp;
      std::list<Matrix4>::iterator it;

      for (it = m_2DModelViewMatricesStack.begin(); it != m_2DModelViewMatricesStack.end(); it++)
      {
        temp = _model_view_matrix;
        _model_view_matrix = temp * (*it);
      }

    }

    // Projection
    {
      _projection_matrix.Orthographic(0, w, h, 0, -1.0f, 1.0f);
    }
#endif
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GraphicsEngine::PushBlend ( unsigned int  src_blend,
unsigned int  dst_blend 
)

Push a custom blend state.

Parameters:
src_blendOpenGL source blending mode.
dst_blendOpenGL destination blending mode.
void nux::GraphicsEngine::PushClipOffset ( int  x,
int  y 
)

Definition at line 713 of file GraphicsEngine.cpp.

  {
    _clip_offset_stack.push_back(Point(x, y));

    _clip_offset_x = 0;
    _clip_offset_y = 0;

    std::list<Point>::iterator it;
    for (it = _clip_offset_stack.begin(); it != _clip_offset_stack.end(); it++)
    {
      _clip_offset_x += (*it).x;
      _clip_offset_y += (*it).y;
    }
  }

Here is the caller graph for this function:

Definition at line 507 of file GraphicsEngine.cpp.

  {
    if (_graphics_display.m_DeviceFactory->GetCurrentFrameBufferObject().IsValid())
    {
      // There is an active framebuffer set. Push the clipping rectangles to that fbo clipping stack.
      _graphics_display.m_DeviceFactory->GetCurrentFrameBufferObject()->PushClippingRegion(rect);
      return;
    }

    Rect r0 = ModelViewXFormRect(rect);

    Rect r1;
    unsigned int stacksize = (unsigned int) ClippingRect.size();
    int x0, y0, x1, y1;

    int window_width, window_height;
    window_width = _viewport.width;
    window_height = _viewport.height;

    if (stacksize == 0)
    {
      r1 = Rect(0, 0, window_width, window_height);
    }
    else
    {
      r1 = ClippingRect[stacksize-1];
    }

//    http://www.codecomments.com/archive263-2004-12-350347.html
//    If your rectangles are given in 2D as Top,Left,Bottom,Right coordinates, as typical for GUI programming, then it's simply:
//        intersect.Left = max(a.Left, b.Left);
//        intersect.Top = max(a.Top, b.Top);
//        intersect.Right = min(a.Right, b.Right );
//        intersect.Bottom = min(a.Bottom, b.Bottom);
//    And the intersection is empty unless intersect.Right > intersect.Left && intersect.Bottom > intersect.Top

    x0 = Max(r0.x, r1.x);
    y0 = Max(r0.y, r1.y);
    x1 = Min(r0.x + r0.width, r1.x + r1.width);
    y1 = Min(r0.y + r0.height, r1.y + r1.height);

    Rect r = r0.Intersect(r1);

    if ((x1 > x0) && (y1 > y0))
    {
      _clipping_rect = Rect(x0, y0, x1 - x0, y1 - y0);
      ClippingRect.push_back(Rect(x0, y0, x1 - x0, y1 - y0));

      EnableScissoring(true);
      SetOpenGLClippingRectangle(x0, window_height - y0 - (y1 - y0), x1 - x0, y1 - y0);
    }
    else
    {
      _clipping_rect = Rect(0, 0, 0, 0);
      ClippingRect.push_back(_clipping_rect);
      EnableScissoring(true);
      SetOpenGLClippingRectangle(0, 0, 0, 0);
    }
  }

Here is the call graph for this function:

Push a state that disables the blending.

Definition at line 986 of file GraphicsEngine.cpp.

  {
    BlendOperator blend_op;
    blend_op.EnableBlending(false);

    _blend_stack.push_front(blend_op);

    GetRenderStates().SetBlend(blend_op._enable);
  }

Here is the call graph for this function:

Push an Identity model view matrix on the stack.

Definition at line 905 of file GraphicsEngine.cpp.

Here is the call graph for this function:

Push a model view matrix on the stack.

Definition at line 910 of file GraphicsEngine.cpp.

  {
    if (_model_view_stack.empty())
      _model_view_matrix = matrix;
    else
      _model_view_matrix = matrix * _model_view_stack.back();

    _model_view_stack.push_back(_model_view_matrix);
  }

Here is the caller graph for this function:

Push a raster operation configuration setting on the stack.

Definition at line 976 of file GraphicsEngine.cpp.

  {
    BlendOperator blend_op;
    blend_op.SetPorterDuffOperator(porter_duff_op);

    _blend_stack.push_front(blend_op);

    GetRenderStates().SetBlend(blend_op._enable, blend_op._src_blend, blend_op._dst_blend);
  }

Here is the call graph for this function:

Push a projection matrix on the stack.

void nux::GraphicsEngine::QRP_1Tex ( int  x,
int  y,
int  width,
int  height,
ObjectPtr< IOpenGLBaseTexture Tex0,
TexCoordXForm texxform,
const Color &  color0 
)

Definition at line 360 of file RenderingPipe.cpp.

  {
#ifndef NUX_OPENGLES_20
    if (UsingGLSLCodePath())
      QRP_GLSL_1Tex(x, y, width, height, DeviceTexture, texxform0, color0);
    else
      QRP_ASM_1Tex(x, y, width, height, DeviceTexture, texxform0, color0);
#else
    QRP_GLSL_1Tex(x, y, width, height, DeviceTexture, texxform0, color0);
#endif
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GraphicsEngine::QRP_2Tex ( int  x,
int  y,
int  width,
int  height,
ObjectPtr< IOpenGLBaseTexture DeviceTexture0,
TexCoordXForm texxform0,
const Color &  color0,
ObjectPtr< IOpenGLBaseTexture DeviceTexture1,
TexCoordXForm texxform1,
const Color &  color1 
)

Definition at line 399 of file RenderingPipe.cpp.

  {
#ifndef NUX_OPENGLES_20
    if (UsingGLSLCodePath())
      QRP_GLSL_2Tex(x, y, width, height, DeviceTexture0, texxform0, color0, DeviceTexture1, texxform1, color1);
    else
      QRP_ASM_2Tex(x, y, width, height, DeviceTexture0, texxform0, color0, DeviceTexture1, texxform1, color1);
#else
    QRP_GLSL_2Tex(x, y, width, height, DeviceTexture0, texxform0, color0, DeviceTexture1, texxform1, color1);
#endif
  }

Here is the call graph for this function:

void nux::GraphicsEngine::QRP_2TexMod ( int  x,
int  y,
int  width,
int  height,
ObjectPtr< IOpenGLBaseTexture DeviceTexture0,
TexCoordXForm texxform0,
const Color &  color0,
ObjectPtr< IOpenGLBaseTexture DeviceTexture1,
TexCoordXForm texxform1,
const Color &  color1 
)

Definition at line 414 of file RenderingPipe.cpp.

  {
#ifndef NUX_OPENGLES_20
    if (UsingGLSLCodePath())
      QRP_GLSL_2TexMod(x, y, width, height, DeviceTexture0, texxform0, color0, DeviceTexture1, texxform1, color1);
    else
      QRP_ASM_2TexMod(x, y, width, height, DeviceTexture0, texxform0, color0, DeviceTexture1, texxform1, color1);
#else
    QRP_GLSL_2TexMod(x, y, width, height, DeviceTexture0, texxform0, color0, DeviceTexture1, texxform1, color1);
#endif
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GraphicsEngine::QRP_4Tex ( int  x,
int  y,
int  width,
int  height,
ObjectPtr< IOpenGLBaseTexture DeviceTexture0,
TexCoordXForm texxform0,
const Color &  color0,
ObjectPtr< IOpenGLBaseTexture DeviceTexture1,
TexCoordXForm texxform1,
const Color &  color1,
ObjectPtr< IOpenGLBaseTexture DeviceTexture2,
TexCoordXForm texxform2,
const Color &  color2,
ObjectPtr< IOpenGLBaseTexture DeviceTexture3,
TexCoordXForm texxform3,
const Color &  color3 
)

Definition at line 428 of file RenderingPipe.cpp.

  {
#ifndef NUX_OPENGLES_20
    if (UsingGLSLCodePath())
      QRP_GLSL_4Tex(x, y, width, height, DeviceTexture0, texxform0, color0, DeviceTexture1, texxform1, color1,
      DeviceTexture2, texxform2, color2, DeviceTexture3, texxform3, color3);
    else
      QRP_ASM_4Tex(x, y, width, height, DeviceTexture0, texxform0, color0, DeviceTexture1, texxform1, color1,
      DeviceTexture2, texxform2, color2, DeviceTexture3, texxform3, color3);
#else
    QRP_GLSL_4Tex(x, y, width, height, DeviceTexture0, texxform0, color0, DeviceTexture1, texxform1, color1,
      DeviceTexture2, texxform2, color2, DeviceTexture3, texxform3, color3);
#endif
  }

Here is the call graph for this function:

void nux::GraphicsEngine::QRP_ASM_1Tex ( int  x,
int  y,
int  width,
int  height,
ObjectPtr< IOpenGLBaseTexture Tex0,
TexCoordXForm texxform,
const Color &  color0 
)

Definition at line 613 of file RenderingPipeAsm.cpp.

  {
    NUX_RETURN_IF_FALSE(m_AsmTextureModColor.IsValid());
    NUX_RETURN_IF_FALSE(m_AsmTextureRectModColor.IsValid());

    QRP_Compute_Texture_Coord(width, height, device_texture, texxform);
    float fx = x, fy = y;
    float VtxBuffer[] =
    {
      fx,          fy,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
      fx,          fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
      fx + width,  fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
      fx + width,  fy,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
    };

    CHECKGL(glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0));
    CHECKGL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0));
    
    ObjectPtr<IOpenGLAsmShaderProgram> shader_program = m_AsmTextureModColor;
    if (device_texture->Type().IsDerivedFromType(IOpenGLRectangleTexture::StaticObjectType))
    {
      shader_program = m_AsmTextureRectModColor;
    }
    shader_program->Begin();

    SetTexture(GL_TEXTURE0, device_texture);

    CHECKGL(glMatrixMode(GL_MODELVIEW));
    CHECKGL(glLoadIdentity());
    CHECKGL(glLoadMatrixf((FLOAT *) GetOpenGLModelViewMatrix().m));
    CHECKGL(glMatrixMode(GL_PROJECTION));
    CHECKGL(glLoadIdentity());
    CHECKGL(glLoadMatrixf((FLOAT *) GetOpenGLProjectionMatrix().m));


    int VertexLocation          = VTXATTRIB_POSITION;
    int TextureCoord0Location   = VTXATTRIB_TEXCOORD0;
    int VertexColorLocation     = VTXATTRIB_COLOR;

    CHECKGL(glEnableVertexAttribArrayARB(VertexLocation));
    CHECKGL(glVertexAttribPointerARB((GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer));

    if (TextureCoord0Location != -1)
    {
      CHECKGL(glEnableVertexAttribArrayARB(TextureCoord0Location));
      CHECKGL(glVertexAttribPointerARB((GLuint) TextureCoord0Location, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer + 4));
    }

    if (VertexColorLocation != -1)
    {
      CHECKGL(glEnableVertexAttribArrayARB(VertexColorLocation));
      CHECKGL(glVertexAttribPointerARB((GLuint) VertexColorLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer + 8));
    }

    CHECKGL(glDrawArrays(GL_TRIANGLE_FAN, 0, 4));

    CHECKGL(glDisableVertexAttribArrayARB(VertexLocation));

    if (TextureCoord0Location != -1)
      CHECKGL(glDisableVertexAttribArrayARB(TextureCoord0Location));

    if (VertexColorLocation != -1)
      CHECKGL(glDisableVertexAttribArrayARB(VertexColorLocation));

    shader_program->End();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GraphicsEngine::QRP_ASM_2Tex ( int  x,
int  y,
int  width,
int  height,
ObjectPtr< IOpenGLBaseTexture DeviceTexture0,
TexCoordXForm texxform0,
const Color &  color0,
ObjectPtr< IOpenGLBaseTexture DeviceTexture1,
TexCoordXForm texxform1,
const Color &  color1 
)

Definition at line 749 of file RenderingPipeAsm.cpp.

  {
    NUX_RETURN_IF_FALSE(m_Asm2TextureAdd.IsValid());
    NUX_RETURN_IF_FALSE(m_Asm2TextureRectAdd.IsValid());

    QRP_Compute_Texture_Coord(width, height, device_texture0, texxform0);
    QRP_Compute_Texture_Coord(width, height, device_texture1, texxform1);

    float fx = x, fy = y;
    float VtxBuffer[] =
    {
      fx,          fy,          0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
      fx,          fy + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
      fx + width,  fy + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
      fx + width,  fy,          0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
    };

    CHECKGL(glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0));
    CHECKGL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0));

    ObjectPtr<IOpenGLAsmShaderProgram> shader_program = m_Asm2TextureAdd;
    if (device_texture0->Type().IsDerivedFromType(IOpenGLRectangleTexture::StaticObjectType))
    {
      shader_program = m_Asm2TextureRectAdd;
    }
    shader_program->Begin();

    SetTexture(GL_TEXTURE0, device_texture0);
    SetTexture(GL_TEXTURE1, device_texture1);

    CHECKGL(glMatrixMode(GL_MODELVIEW));
    CHECKGL(glLoadIdentity());
    CHECKGL(glLoadMatrixf((FLOAT *) GetOpenGLModelViewMatrix().m));
    CHECKGL(glMatrixMode(GL_PROJECTION));
    CHECKGL(glLoadIdentity());
    CHECKGL(glLoadMatrixf((FLOAT *) GetOpenGLProjectionMatrix().m));

    int VertexLocation          = VTXATTRIB_POSITION;
    int TextureCoord0Location   = VTXATTRIB_TEXCOORD0;
    int TextureCoord1Location   = VTXATTRIB_TEXCOORD1;

    CHECKGL(glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, color0.red, color0.green, color0.blue, color0.alpha ));
    CHECKGL(glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, color1.red, color1.green, color1.blue, color1.alpha ));

    CHECKGL(glEnableVertexAttribArrayARB(VertexLocation));
    CHECKGL(glVertexAttribPointerARB((GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer));

    if (TextureCoord0Location != -1)
    {
      CHECKGL(glEnableVertexAttribArrayARB(TextureCoord0Location));
      CHECKGL(glVertexAttribPointerARB((GLuint) TextureCoord0Location, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer + 4));
    }

    if (TextureCoord1Location != -1)
    {
      CHECKGL(glEnableVertexAttribArrayARB(TextureCoord1Location));
      CHECKGL(glVertexAttribPointerARB((GLuint) TextureCoord1Location, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer + 8));
    }

    CHECKGL(glDrawArrays(GL_TRIANGLE_FAN, 0, 4));

    CHECKGL(glDisableVertexAttribArrayARB(VertexLocation));

    if (TextureCoord0Location != -1)
      CHECKGL(glDisableVertexAttribArrayARB(TextureCoord0Location));

    if (TextureCoord1Location != -1)
      CHECKGL(glDisableVertexAttribArrayARB(TextureCoord1Location));

    shader_program->End();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GraphicsEngine::QRP_ASM_2TexMod ( int  x,
int  y,
int  width,
int  height,
ObjectPtr< IOpenGLBaseTexture DeviceTexture0,
TexCoordXForm texxform0,
const Color &  color0,
ObjectPtr< IOpenGLBaseTexture DeviceTexture1,
TexCoordXForm texxform1,
const Color &  color1 
)

Definition at line 898 of file RenderingPipeAsm.cpp.

  {
    NUX_RETURN_IF_FALSE(m_Asm2TextureMod.IsValid());
    NUX_RETURN_IF_FALSE(m_Asm2TextureRectMod.IsValid());

    QRP_Compute_Texture_Coord(width, height, device_texture0, texxform0);
    QRP_Compute_Texture_Coord(width, height, device_texture1, texxform1);

    float fx = x, fy = y;
    float VtxBuffer[] =
    {
      fx,          fy,          0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
      fx,          fy + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
      fx + width,  fy + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
      fx + width,  fy,          0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
    };

    CHECKGL(glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0));
    CHECKGL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0));

    ObjectPtr<IOpenGLAsmShaderProgram> shader_program = m_Asm2TextureMod;
    if (device_texture0->Type().IsDerivedFromType(IOpenGLRectangleTexture::StaticObjectType))
    {
      shader_program = m_Asm2TextureRectMod;
    }
    shader_program->Begin();

    SetTexture(GL_TEXTURE0, device_texture0);
    SetTexture(GL_TEXTURE1, device_texture1);

    CHECKGL(glMatrixMode(GL_MODELVIEW));
    CHECKGL(glLoadIdentity());
    CHECKGL(glLoadMatrixf((FLOAT *) GetOpenGLModelViewMatrix().m));
    CHECKGL(glMatrixMode(GL_PROJECTION));
    CHECKGL(glLoadIdentity());
    CHECKGL(glLoadMatrixf((FLOAT *) GetOpenGLProjectionMatrix().m));

    int VertexLocation          = VTXATTRIB_POSITION;
    int TextureCoord0Location   = VTXATTRIB_TEXCOORD0;
    int TextureCoord1Location   = VTXATTRIB_TEXCOORD1;

    CHECKGL(glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, color0.red, color0.green, color0.blue, color0.alpha ));
    CHECKGL(glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, color1.red, color1.green, color1.blue, color1.alpha ));

    CHECKGL(glEnableVertexAttribArrayARB(VertexLocation));
    CHECKGL(glVertexAttribPointerARB((GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer));

    if (TextureCoord0Location != -1)
    {
      CHECKGL(glEnableVertexAttribArrayARB(TextureCoord0Location));
      CHECKGL(glVertexAttribPointerARB((GLuint) TextureCoord0Location, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer + 4));
    }

    if (TextureCoord1Location != -1)
    {
      CHECKGL(glEnableVertexAttribArrayARB(TextureCoord1Location));
      CHECKGL(glVertexAttribPointerARB((GLuint) TextureCoord1Location, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer + 8));
    }

    CHECKGL(glDrawArrays(GL_TRIANGLE_FAN, 0, 4));

    CHECKGL(glDisableVertexAttribArrayARB(VertexLocation));

    if (TextureCoord0Location != -1)
      CHECKGL(glDisableVertexAttribArrayARB(TextureCoord0Location));

    if (TextureCoord1Location != -1)
      CHECKGL(glDisableVertexAttribArrayARB(TextureCoord1Location));

    shader_program->End();
  }

Here is the call graph for this function: