mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
press 's' to toggle smoothing
This commit is contained in:
parent
563479552e
commit
5796056e28
1 changed files with 15 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue