[Mesa-dev] [PATCH 2/2] demos/pixeltest: Adapt the example for points too.

Jose Fonseca jfonseca at vmware.com
Wed Jan 8 10:06:25 PST 2014



----- Original Message -----
> On Wed, Jan 8, 2014 at 6:30 PM,  <jfonseca at vmware.com> wrote:
> > From: José Fonseca <jfonseca at vmware.com>
> >
> > This example is very useful to understand the rasterization of lines.
> > And with this change, points too.
> >
> > Adding a key / command-line option to switch modes is left for a future
> > opportunity though.
> > ---
> >  src/demos/pixeltest.c | 109
> >  ++++++++++++++++++++++++++++++++------------------
> >  1 file changed, 69 insertions(+), 40 deletions(-)
> >
> > diff --git a/src/demos/pixeltest.c b/src/demos/pixeltest.c
> > index 0898290..0b6a580 100644
> > --- a/src/demos/pixeltest.c
> > +++ b/src/demos/pixeltest.c
> > @@ -31,6 +31,10 @@ float width = 1.0f;
> >  #define SIZE 128                /* of non-zoomed drawing region */
> >  #define ZOOM 32                 /* scale factor for zooming */
> >
> > +// TODO: Allow to switch mode via key and/or command-line option.
> > +//GLenum mode = GL_POINT;
> > +GLenum mode = GL_LINE;
> > +
> 
> C++/C99 comments in source-file normally using traditional C comments
> 

I don't think we are following that rule:

  $ cd mesa/demos
  $ grep -R '^\s\+\/\/' --include '*.c' src/ | wc -l
  91

Anyway I'll fix before commit, as below.

Jose


diff --git a/src/demos/pixeltest.c b/src/demos/pixeltest.c
index 0b6a580..0348daa 100644
--- a/src/demos/pixeltest.c
+++ b/src/demos/pixeltest.c
@@ -31,9 +31,12 @@ float width = 1.0f;
 #define SIZE 128                /* of non-zoomed drawing region */
 #define ZOOM 32                 /* scale factor for zooming */
 
-// TODO: Allow to switch mode via key and/or command-line option.
-//GLenum mode = GL_POINT;
+/* TODO: Allow to switch mode via key and/or command-line option. */
+#if 0
+GLenum mode = GL_POINT;
+#else
 GLenum mode = GL_LINE;
+#endif
 
 static GLboolean DrawFront = GL_FALSE;
 GLushort TempImage[SIZE][SIZE]; /* original 128 by 128 pixel image */


More information about the mesa-dev mailing list