From http://www.jwz.org/xscreensaver/xscreensaver-5.16.tar.gz
[xscreensaver] / hacks / glx / dropshadow.h
1 /* dropshadow.h, Copyright (c) 2009 Jens Kilian <jjk@acm.org>
2  *
3  * Permission to use, copy, modify, distribute, and sell this software and its
4  * documentation for any purpose is hereby granted without fee, provided that
5  * the above copyright notice appear in all copies and that both that
6  * copyright notice and this permission notice appear in supporting
7  * documentation.  No representations are made about the suitability of this
8  * software for any purpose.  It is provided "as is" without express or
9  * implied warranty.
10  */
11
12 #ifndef __DROPSHADOW_H__
13 #define __DROPSHADOW_H__
14
15 #ifdef HAVE_CONFIG_H
16 # include "config.h"
17 #endif /* HAVE_CONFIG_H */
18
19 #ifdef HAVE_COCOA
20 # ifndef HAVE_JWZGLES
21 #  include <OpenGL/glu.h>
22 # endif
23 #else /* !HAVE_COCOA */
24 # include <GL/gl.h>
25 # include <GL/glu.h>
26 #endif /* !HAVE_COCOA */
27
28 #ifdef HAVE_JWZGLES
29 # include "jwzgles.h"
30 #endif /* HAVE_JWZGLES */
31
32 /* Initialize drop shadow texture, return a texture ID.
33  */
34 GLuint
35 init_drop_shadow(void);
36
37 /* Draw a drop shadow around a rectangle.
38
39    t                Texture ID (as returned by init_drop_shadow()).
40    x, y, z; w, h    Position (left bottom), depth and size of rectangle.
41    r                Radius of drop shadow.
42
43    The shadow will be drawn using the current color.
44  */
45
46 void
47 draw_drop_shadow (GLuint t,
48                   GLfloat x, GLfloat y, GLfloat z, GLfloat w, GLfloat h,
49                   GLfloat r);
50
51 #endif /* __DROPSHADOW_H__ */