summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-07-13 10:32:56 -0600
committerBrian <[email protected]>2007-07-13 10:32:56 -0600
commit5796056e289c5a698a1883586c7acde36f86618f (patch)
tree25cb1853e33bf2d3da5eb02011bb2c8c0d3470df
parent563479552e2f491fb94e7fac5772f3c72cee962a (diff)
press 's' to toggle smoothing
-rw-r--r--progs/trivial/point-wide.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/progs/trivial/point-wide.c b/progs/trivial/point-wide.c
index 196e09cc6f9..d1038ecfa15 100644
--- a/progs/trivial/point-wide.c
+++ b/progs/trivial/point-wide.c
@@ -33,6 +33,8 @@
GLenum doubleBuffer;
+static GLboolean smooth = GL_FALSE;
+
static void Init(void)
{
@@ -58,6 +60,9 @@ static void Key(unsigned char key, int x, int y)
{
switch (key) {
+ case 's':
+ smooth = !smooth;
+ break;
case 27:
exit(1);
default:
@@ -73,6 +78,16 @@ static void Draw(void)
glPointSize(8.0);
+ if (smooth) {
+ glEnable(GL_POINT_SMOOTH);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ }
+ else {
+ glDisable(GL_POINT_SMOOTH);
+ glDisable(GL_BLEND);
+ }
+
glBegin(GL_POINTS);
glColor3f(1,0,0);
glVertex3f( 0.9, -0.9, -30.0);