Cairo-Dock  3.4.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cairo-dock-draw-opengl.h File Reference

Macros

#define cairo_dock_create_texture_from_image(cImagePath)
 
#define _cairo_dock_delete_texture(iTexture)
 
#define _cairo_dock_enable_texture(...)
 
#define _cairo_dock_disable_texture(...)
 
#define _cairo_dock_set_alpha(fAlpha)
 
#define _cairo_dock_set_blend_source(...)
 
#define _cairo_dock_set_blend_alpha(...)
 
#define _cairo_dock_set_blend_over(...)
 
#define _cairo_dock_set_blend_pbuffer(...)
 
#define _cairo_dock_apply_texture_at_size(iTexture, w, h)
 
#define _cairo_dock_apply_texture(iTexture)
 
#define _cairo_dock_apply_texture_at_size_with_alpha(iTexture, w, h, fAlpha)
 

Functions

void cairo_dock_render_one_icon_opengl (Icon *icon, CairoDock *pDock, double fDockMagnitude, gboolean bUseText)
 
GLuint cairo_dock_create_texture_from_surface (cairo_surface_t *pImageSurface)
 
GLuint cairo_dock_create_texture_from_raw_data (const guchar *pTextureRaw, int iWidth, int iHeight)
 
GLuint cairo_dock_create_texture_from_image_full (const gchar *cImagePath, double *fImageWidth, double *fImageHeight)
 
void cairo_dock_update_icon_texture (Icon *pIcon)
 

Detailed Description

This class provides some useful functions to draw with OpenGL.

Macro Definition Documentation

#define cairo_dock_create_texture_from_image (   cImagePath)

Load an image on the dock into an OpenGL texture. The texture will have the same size as the image.

Parameters
cImagePathpath to an image.
Returns
the newly allocated texture, to be destroyed with _cairo_dock_delete_texture.
#define _cairo_dock_delete_texture (   iTexture)

Delete an OpenGL texture from the Graphic Card.

Parameters
iTexturevariable containing the ID of a texture.
#define _cairo_dock_enable_texture (   ...)

Enable texture drawing.

#define _cairo_dock_disable_texture (   ...)

Disable texture drawing.

#define _cairo_dock_set_alpha (   fAlpha)

Set the alpha channel to a current value, other channels are set to 1.

Parameters
fAlphaalpha
#define _cairo_dock_set_blend_source (   ...)

Set the color blending to overwrite.

#define _cairo_dock_set_blend_alpha (   ...)

Set the color blending to mix, for premultiplied texture.

#define _cairo_dock_set_blend_over (   ...)

Set the color blending to mix.

#define _cairo_dock_set_blend_pbuffer (   ...)

Set the color blending to mix on a pbuffer.

#define _cairo_dock_apply_texture_at_size (   iTexture,
  w,
 
)

Draw a texture centered on the current point, at a given size.

Parameters
iTexturethe texture
wwidth
hheight
#define _cairo_dock_apply_texture (   iTexture)

Apply a texture centered on the current point and at the given scale.

Parameters
iTexturethe texture
#define _cairo_dock_apply_texture_at_size_with_alpha (   iTexture,
  w,
  h,
  fAlpha 
)

Draw a texture centered on the current point, at a given size, and with a given transparency.

Parameters
iTexturethe texture
wwidth
hheight
fAlphathe transparency, between 0 and 1.

Function Documentation

void cairo_dock_render_one_icon_opengl ( Icon icon,
CairoDock pDock,
double  fDockMagnitude,
gboolean  bUseText 
)

Draw an icon, according to its current parameters : position, transparency, reflect, rotation, stretching. Also draws its indicators, label, and quick-info. It generates a CAIRO_DOCK_RENDER_ICON notification.

Parameters
iconthe icon to draw.
pDockthe dock containing the icon.
fDockMagnitudecurrent magnitude of the dock.
bUseTextTRUE to draw the labels.
GLuint cairo_dock_create_texture_from_surface ( cairo_surface_t *  pImageSurface)

Load a cairo surface into an OpenGL texture. The surface can be destroyed after that if you don't need it. The texture will have the same size as the surface.

Parameters
pImageSurfacethe surface, created with one of the 'cairo_dock_create_surface_xxx' functions.
Returns
the newly allocated texture, to be destroyed with _cairo_dock_delete_texture.
GLuint cairo_dock_create_texture_from_raw_data ( const guchar *  pTextureRaw,
int  iWidth,
int  iHeight 
)

Load a pixels buffer representing an image into an OpenGL texture.

Parameters
pTextureRawa buffer of pixels.
iWidthwidth of the image.
iHeightheight of the image.
Returns
the newly allocated texture, to be destroyed with _cairo_dock_delete_texture.
GLuint cairo_dock_create_texture_from_image_full ( const gchar *  cImagePath,
double *  fImageWidth,
double *  fImageHeight 
)

Load an image on the dock into an OpenGL texture. The texture will have the same size as the image. The size is given as an output, if you need it for some reason.

Parameters
cImagePathpath to an image.
fImageWidthpointer that will be filled with the width of the image.
fImageHeightpointer that will be filled with the height of the image.
Returns
the newly allocated texture, to be destroyed with _cairo_dock_delete_texture.
void cairo_dock_update_icon_texture ( Icon pIcon)

Update the icon's texture with its current cairo surface. This allows you to draw an icon with libcairo, and just copy the result to the OpenGL texture to be able to draw the icon in OpenGL too.

Parameters
pIconthe icon.