gtkglarea r110 - in trunk: . examples gtkgl



Author: samh
Date: Mon Sep 22 13:21:54 2008
New Revision: 110
URL: http://svn.gnome.org/viewvc/gtkglarea?rev=110&view=rev

Log:
* Cosmetic fix: remove trailing spaces from source files.

Modified:
   trunk/ChangeLog
   trunk/examples/gdkfont.c
   trunk/examples/glpixmap.c
   trunk/examples/gtkglarea_demo.c
   trunk/examples/lw.c
   trunk/examples/shaders.c
   trunk/examples/simple.c
   trunk/examples/viewlw.c
   trunk/gtkgl/gdkgl.c
   trunk/gtkgl/gdkgl.h
   trunk/gtkgl/gtkglarea.c

Modified: trunk/examples/gdkfont.c
==============================================================================
--- trunk/examples/gdkfont.c	(original)
+++ trunk/examples/gdkfont.c	Mon Sep 22 13:21:54 2008
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 1998 Janne LÃf <jlof mail student oulu fi>
  *
  * This library is free software; you can redistribute it and/or
@@ -170,7 +170,7 @@
 		     GTK_SIGNAL_FUNC(init), NULL);
 
   gtk_widget_set_usize(GTK_WIDGET(glarea), 450,100);
-		    
+
   /* put glarea into window and show it all */
   gtk_container_add(GTK_CONTAINER(window),GTK_WIDGET(glarea));
   gtk_widget_show(GTK_WIDGET(glarea));

Modified: trunk/examples/glpixmap.c
==============================================================================
--- trunk/examples/glpixmap.c	(original)
+++ trunk/examples/glpixmap.c	Mon Sep 22 13:21:54 2008
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 1998 Janne LÃf <jlof mail student oulu fi>
  *
  * This library is free software; you can redistribute it and/or

Modified: trunk/examples/gtkglarea_demo.c
==============================================================================
--- trunk/examples/gtkglarea_demo.c	(original)
+++ trunk/examples/gtkglarea_demo.c	Mon Sep 22 13:21:54 2008
@@ -73,7 +73,7 @@
 GtkWidget* create_glarea (void) {
 
   GtkWidget* glarea;
-  
+
   /* Choose the attributes that we would like for our visual. */
   /* These attributes are passed to glXChooseVisual by the    */
   /* gdk (see gdk_gl_choose_visual in gdkgl.c from the        */
@@ -145,31 +145,31 @@
 
   gtk_signal_connect (GTK_OBJECT(glarea), "button_press_event",
                       GTK_SIGNAL_FUNC(glarea_button_press), NULL);
-  
+
   /* motion_notify_event - The mouse is moving in the window. */
 
   gtk_signal_connect (GTK_OBJECT(glarea), "motion_notify_event",
                       GTK_SIGNAL_FUNC(glarea_motion_notify), NULL);
-  
+
   /* expose_event - The window was exposed and the contents   */
   /*                need to be redrawn.                       */
 
   gtk_signal_connect (GTK_OBJECT(glarea), "expose_event",
                       GTK_SIGNAL_FUNC(glarea_draw), NULL);
-  
+
   /* configure_event - The window has been resized. You will  */
   /*                   probably want to call your reshape     */
   /*                   function here.                         */
 
   gtk_signal_connect (GTK_OBJECT(glarea), "configure_event",
                       GTK_SIGNAL_FUNC(glarea_reshape), NULL);
-  
+
   /* realize - The window has been created, this is where you */
   /*           can hook up your initialization routines.      */
 
   gtk_signal_connect (GTK_OBJECT(glarea), "realize",
                       GTK_SIGNAL_FUNC(glarea_init), NULL);
-  
+
   /* destroy - The window has received a destroy event, this  */
   /*           is where you should do any cleanup that needs  */
   /*           to happen, such as de-allocating data objects  */
@@ -278,7 +278,7 @@
     y = event->y;
     state = event->state;
   }
-  
+
   if (state & GDK_BUTTON1_MASK) {
 
     /* Mouse button 1 is engaged */
@@ -325,7 +325,7 @@
     /* before drawing.                                  */
 
     glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-    
+
     /*                                */
     /* Insert your drawing code here. */
     /*                                */
@@ -336,7 +336,7 @@
     /* single vs. double buffered windows.                  */
 
     gtk_gl_area_swapbuffers (GTK_GL_AREA(widget));
-    
+
   }
 
   return (TRUE);
@@ -374,10 +374,10 @@
     glMatrixMode (GL_PROJECTION);
     glLoadIdentity ();
     gluOrtho2D (-(w>>1), (w>>1), -(h>>1), h>>1);
-    glMatrixMode (GL_MODELVIEW);  
+    glMatrixMode (GL_MODELVIEW);
 
   }
-  
+
   return (TRUE);
 
 }

Modified: trunk/examples/lw.c
==============================================================================
--- trunk/examples/lw.c	(original)
+++ trunk/examples/lw.c	Mon Sep 22 13:21:54 2008
@@ -146,7 +146,7 @@
 static void read_pols(FILE *f, int nbytes, lwObject *lwo)
 {
   int guess_cnt = lwo->face_cnt;
-  
+
   while (nbytes > 0) {
     lwFace *face;
     int i;
@@ -164,17 +164,17 @@
 
     /* allocate space for points */
     face->index = g_malloc0(sizeof(int)*face->index_cnt);
-    
+
     /* read points in */
     for (i=0; i<face->index_cnt; i++) {
       face->index[i] = read_short(f);
       nbytes -= 2;
     }
-    
+
     /* read surface material */
     face->material = read_short(f);
     nbytes -= 2;
-    
+
     /* skip over detail  polygons */
     if (face->material < 0) {
       int det_cnt;
@@ -297,7 +297,7 @@
 void lw_object_free(lwObject *lw_object)
 {
   g_return_if_fail(lw_object != NULL);
- 
+
   if (lw_object->face) {
     int i;
     for (i=0; i<lw_object->face_cnt; i++)

Modified: trunk/examples/shaders.c
==============================================================================
--- trunk/examples/shaders.c	(original)
+++ trunk/examples/shaders.c	Mon Sep 22 13:21:54 2008
@@ -63,7 +63,7 @@
 void create_texture_2D (void) {
 
   int x, y;
-  
+
   g_print("Creating 2D texture\n");
 
   for(y = 0; y < texture_height; y++) {
@@ -104,9 +104,9 @@
 
    int status;
    glGetShaderiv(shader_id, GL_COMPILE_STATUS, &status);
-   
+
    /* Display log compilation */
-   
+
    if( !status )
    {
      int infologLength, charsWritten;
@@ -177,27 +177,27 @@
 
   glShaderSource(ver, 1, &str_ver, NULL);
   glShaderSource(fgm, 1, &str_fgm, NULL);
-  
+
   /* Shader source compilation */
-  
+
   glCompileShader(ver);
   glCompileShader(fgm);
-  
+
   /* Create Program */
-  
+
   prog = glCreateProgram();
-  
+
   /* Add the shader to the program */
-  
+
   glAttachShader(prog, ver);
   glAttachShader(prog, fgm);
-  
+
   /* Link the shader */
-  
+
   glLinkProgram(prog);
-  
+
   /* Check the program */
-  
+
   glValidateProgram(prog);
 
   /* Check shaders */
@@ -225,7 +225,7 @@
 GtkWidget* create_glarea (void) {
 
   GtkWidget* glarea;
-  
+
   int attrlist[] = {
     GDK_GL_RGBA,
     GDK_GL_DOUBLEBUFFER,
@@ -247,13 +247,13 @@
 
   gtk_signal_connect (GTK_OBJECT(glarea), "expose_event",
                       GTK_SIGNAL_FUNC(glarea_draw), NULL);
-  
+
   gtk_signal_connect (GTK_OBJECT(glarea), "configure_event",
                       GTK_SIGNAL_FUNC(glarea_reshape), NULL);
-  
+
   gtk_signal_connect (GTK_OBJECT(glarea), "realize",
                       GTK_SIGNAL_FUNC(glarea_init), NULL);
-  
+
   gtk_signal_connect (GTK_OBJECT(glarea), "destroy",
                       GTK_SIGNAL_FUNC (glarea_destroy), NULL);
 
@@ -304,7 +304,7 @@
     glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     glarea_draw_scene();
     gtk_gl_area_swapbuffers (GTK_GL_AREA(widget));
-    
+
   }
 
   return (TRUE);
@@ -332,10 +332,10 @@
     glMatrixMode (GL_PROJECTION);
     glLoadIdentity ();
     gluOrtho2D (-(w>>1), (w>>1), -(h>>1), h>>1);
-    glMatrixMode (GL_MODELVIEW);  
+    glMatrixMode (GL_MODELVIEW);
 
   }
-  
+
   return (TRUE);
 
 }
@@ -365,7 +365,7 @@
       fprintf(stderr, "Warning: GL_ARB_vertex_shader extension not present\n");
     else
       create_shader();
-  
+
     /* Activate and parameterization texture context */
 
     glEnable(GL_TEXTURE_2D);

Modified: trunk/examples/simple.c
==============================================================================
--- trunk/examples/simple.c	(original)
+++ trunk/examples/simple.c	Mon Sep 22 13:21:54 2008
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 1998 Janne LÃf <jlof mail student oulu fi>
  *
  * This library is free software; you can redistribute it and/or
@@ -60,7 +60,7 @@
 
       /* Swap backbuffer to front */
       gtk_gl_area_swapbuffers(GTK_GL_AREA(widget));
-        
+
     }
 
   return TRUE;
@@ -149,7 +149,7 @@
 
   /* set minimum size */
   gtk_widget_set_usize(GTK_WIDGET(glarea), 100,100);
-		    
+
   /* put glarea into window and show it all */
   gtk_container_add(GTK_CONTAINER(window),GTK_WIDGET(glarea));
   gtk_widget_show(GTK_WIDGET(glarea));

Modified: trunk/examples/viewlw.c
==============================================================================
--- trunk/examples/viewlw.c	(original)
+++ trunk/examples/viewlw.c	Mon Sep 22 13:21:54 2008
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 1998 Janne LÃf <jlof mail student oulu fi>
  *
  * This library is free software; you can redistribute it and/or
@@ -73,7 +73,7 @@
   /* remove back faces */
   glDisable(GL_CULL_FACE);
   glEnable(GL_DEPTH_TEST);
-  
+
   /* speedups */
   glEnable(GL_DITHER);
   glShadeModel(GL_SMOOTH);
@@ -82,15 +82,15 @@
 
   /* light */
   glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);
-  glLightfv(GL_LIGHT0, GL_DIFFUSE,  light0_color);  
+  glLightfv(GL_LIGHT0, GL_DIFFUSE,  light0_color);
   glLightfv(GL_LIGHT1, GL_POSITION, light1_pos);
   glLightfv(GL_LIGHT1, GL_DIFFUSE,  light1_color);
   glEnable(GL_LIGHT0);
   glEnable(GL_LIGHT1);
   glEnable(GL_LIGHTING);
-    
+
   glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE);
-  glEnable(GL_COLOR_MATERIAL);  
+  glEnable(GL_COLOR_MATERIAL);
 }
 
 gint glarea_expose(GtkWidget *widget, GdkEventExpose *event)
@@ -186,7 +186,7 @@
     y = event->y;
     state = event->state;
   }
-  
+
   area.x = 0;
   area.y = 0;
   area.width  = widget->allocation.width;

Modified: trunk/gtkgl/gdkgl.c
==============================================================================
--- trunk/gtkgl/gdkgl.c	(original)
+++ trunk/gtkgl/gdkgl.c	Mon Sep 22 13:21:54 2008
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 1998 Janne LÃf <jlof mail student oulu fi>
  *           (c) 2008 Sam Hocevar <sam zoy org>
  *
@@ -157,11 +157,11 @@
   Display *dpy;
   XVisualInfo *vi;
   int value;
-  
+
   g_return_val_if_fail(visual != NULL, -1);
 
   dpy = GDK_DISPLAY();
- 
+
   vi = get_xvisualinfo(visual);
 
   if (glXGetConfig(dpy, vi, attrib, &value) == 0)
@@ -198,7 +198,7 @@
         0,              /* n_preallocs */
         (GInstanceInitFunc) NULL,
       };
-      
+
       object_type = g_type_register_static (G_TYPE_OBJECT,
                                             "GdkGLContext",
                                             &object_info, 0);
@@ -304,17 +304,17 @@
     glxcontext = glXCreateContext(dpy, vi, sharelist->glxcontext, direct ? True : False);
   else
     glxcontext = glXCreateContext(dpy, vi, 0, direct ? True : False);
-  
+
   XFree(vi);
   if (glxcontext == NULL) {
     g_object_unref(context);
     return NULL;
   }
-  
+
   context->xdisplay = dpy;
   context->glxcontext = glxcontext;
 #endif
-  
+
   return context;
 }
 
@@ -472,7 +472,7 @@
         0,              /* n_preallocs */
         (GInstanceInitFunc) NULL,
       };
-      
+
       object_type = g_type_register_static (G_TYPE_OBJECT,
                                             "GdkGLPixmap",
                                             &object_info, 0);

Modified: trunk/gtkgl/gdkgl.h
==============================================================================
--- trunk/gtkgl/gdkgl.h	(original)
+++ trunk/gtkgl/gdkgl.h	Mon Sep 22 13:21:54 2008
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 1998 Janne LÃf <jlof mail student oulu fi>
  *
  * This library is free software; you can redistribute it and/or
@@ -44,7 +44,7 @@
 	GDK_GL_BUFFER_SIZE	= 2,
 	GDK_GL_LEVEL		= 3,
 	GDK_GL_RGBA		= 4,
-	GDK_GL_DOUBLEBUFFER	= 5, 
+	GDK_GL_DOUBLEBUFFER	= 5,
 	GDK_GL_STEREO		= 6,
 	GDK_GL_AUX_BUFFERS	= 7,
 	GDK_GL_RED_SIZE		= 8,

Modified: trunk/gtkgl/gtkglarea.c
==============================================================================
--- trunk/gtkgl/gtkglarea.c	(original)
+++ trunk/gtkgl/gtkglarea.c	Mon Sep 22 13:21:54 2008
@@ -49,7 +49,7 @@
         0,              /* n_preallocs */
         (GInstanceInitFunc) gtk_gl_area_init,
       };
-      
+
       object_type = g_type_register_static (GTK_TYPE_DRAWING_AREA,
                                             "GtkGLArea",
                                             &object_info, 0);
@@ -64,7 +64,7 @@
 
   parent_class = g_type_class_peek_parent(klass);
   object_class = (GtkObjectClass*) klass;
-  
+
   object_class->destroy = gtk_gl_area_destroy;
 }
 
@@ -99,7 +99,7 @@
   while ( (attrlist[i] = va_arg(ap, int)) != GDK_GL_NONE) /* copy args to list */
     i++;
   va_end(ap);
-  
+
   glarea = gtk_gl_area_share_new(attrlist, share);
 
   g_free(attrlist);
@@ -136,7 +136,7 @@
   /* use colormap and visual suitable for OpenGL rendering */
   gtk_widget_push_colormap(gdk_colormap_new(visual,TRUE));
   gtk_widget_push_visual(visual);
-  
+
   gl_area = g_object_new(GTK_TYPE_GL_AREA, NULL);
   gl_area->glcontext = glcontext;
 
@@ -171,7 +171,7 @@
 
   g_return_if_fail (object != NULL);
   g_return_if_fail (GTK_IS_GL_AREA(object));
-  
+
   gl_area = GTK_GL_AREA(object);
 
   if (gl_area->glcontext)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]