projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://slackware.bholcomb.com/slackware/slackware-11.0/source/xap/xscreensaver/xscree...
[xscreensaver]
/
hacks
/
glx
/
sproingiewrap.c
diff --git
a/hacks/glx/sproingiewrap.c
b/hacks/glx/sproingiewrap.c
index 8ca7c9f8a2af210d3e7b054825abc6e7efcb7f46..f247c97e9f7a2d91e46c9131b5b26cf033e41ad9 100644
(file)
--- a/
hacks/glx/sproingiewrap.c
+++ b/
hacks/glx/sproingiewrap.c
@@
-1,9
+1,8
@@
/* -*- Mode: C; tab-width: 4 -*- */
/* sproingiewrap.c - sproingies wrapper */
/* -*- Mode: C; tab-width: 4 -*- */
/* sproingiewrap.c - sproingies wrapper */
-#if
!defined( lint ) && !defined( SABER )
+#if
0
static const char sccsid[] = "@(#)sproingiewrap.c 4.07 97/11/24 xlockmore";
static const char sccsid[] = "@(#)sproingiewrap.c 4.07 97/11/24 xlockmore";
-
#endif
/*-
#endif
/*-
@@
-22,10
+21,15
@@
static const char sccsid[] = "@(#)sproingiewrap.c 4.07 97/11/24 xlockmore";
* other special, indirect and consequential damages.
*
* Programming: Ed Mackey, http://www.netaxs.com/~emackey/
* other special, indirect and consequential damages.
*
* Programming: Ed Mackey, http://www.netaxs.com/~emackey/
+ * Gordon Wrigley, gdw33@student.canterbury.ac.nz
* Sproingie 3D objects modeled by: Al Mackey, al@iam.com
* (using MetaNURBS in NewTek's Lightwave 3D v5).
*
* Revision History:
* Sproingie 3D objects modeled by: Al Mackey, al@iam.com
* (using MetaNURBS in NewTek's Lightwave 3D v5).
*
* Revision History:
+ * 13-Dec-02: Changed triangle normals into vertex normals to give a smooth
+ apperance and moved the sproingies from Display Lists to
+ Vertex Arrays, still need to do this for the TopsSides.
+ (gordon)
* 26-Apr-97: Added glPointSize() calls around explosions, plus other fixes.
* 28-Mar-97: Added size support.
* 22-Mar-97: Updated to use glX interface instead of xmesa one.
* 26-Apr-97: Added glPointSize() calls around explosions, plus other fixes.
* 28-Mar-97: Added size support.
* 22-Mar-97: Updated to use glX interface instead of xmesa one.
@@
-54,15
+58,15
@@
static const char sccsid[] = "@(#)sproingiewrap.c 4.07 97/11/24 xlockmore";
*/
#ifdef STANDALONE
*/
#ifdef STANDALONE
-# define PROGCLASS "Sproingies"
-# define HACK_INIT init_sproingies
-# define HACK_DRAW draw_sproingies
-# define sproingies_opts xlockmore_opts
-# define DEFAULTS "*delay: 0 \n" \
+# define DEFAULTS "*delay: 25000 \n" \
"*count: 5 \n" \
"*cycles: 0 \n" \
"*size: 0 \n" \
"*count: 5 \n" \
"*cycles: 0 \n" \
"*size: 0 \n" \
+ "*showFPS: False \n" \
+ "*fpsTop: True \n" \
"*wireframe: False \n"
"*wireframe: False \n"
+# define refresh_sproingies 0
+# define sproingies_handle_event 0
# include "xlockmore.h" /* from the xscreensaver distribution */
#else /* !STANDALONE */
# include "xlock.h" /* from the xlockmore distribution */
# include "xlockmore.h" /* from the xscreensaver distribution */
#else /* !STANDALONE */
# include "xlock.h" /* from the xlockmore distribution */
@@
-70,7
+74,9
@@
static const char sccsid[] = "@(#)sproingiewrap.c 4.07 97/11/24 xlockmore";
#ifdef USE_GL
#ifdef USE_GL
-ModeSpecOpt sproingies_opts =
+#include "sproingies.h"
+
+ENTRYPOINT ModeSpecOpt sproingies_opts =
{0, NULL, 0, NULL, NULL};
#ifdef USE_MODULES
{0, NULL, 0, NULL, NULL};
#ifdef USE_MODULES
@@
-84,17
+90,12
@@
ModStruct sproingies_description =
#define MINSIZE 32
#define MINSIZE 32
-#include <GL/glu.h>
#include <time.h>
void NextSproingie(int screen);
void NextSproingieDisplay(int screen,int pause);
void DisplaySproingies(int screen,int pause);
#include <time.h>
void NextSproingie(int screen);
void NextSproingieDisplay(int screen,int pause);
void DisplaySproingies(int screen,int pause);
-
-#if 0
void ReshapeSproingies(int w, int h);
void ReshapeSproingies(int w, int h);
-
-#endif
void CleanupSproingies(int screen);
void InitSproingies(int wfmode, int grnd, int mspr, int screen, int numscreens, int mono);
void CleanupSproingies(int screen);
void InitSproingies(int wfmode, int grnd, int mspr, int screen, int numscreens, int mono);
@@
-111,21
+112,9
@@
typedef struct {
static sproingiesstruct *sproingies = NULL;
static sproingiesstruct *sproingies = NULL;
-static Display *swap_display;
-static Window swap_window;
-
-void
-SproingieSwap(void)
-{
- glFinish();
- glXSwapBuffers(swap_display, swap_window);
-}
-
-
-void
-init_sproingies(ModeInfo * mi)
+ENTRYPOINT void
+init_sproingies (ModeInfo * mi)
{
{
- Display *display = MI_DISPLAY(mi);
Window window = MI_WINDOW(mi);
int screen = MI_SCREEN(mi);
Window window = MI_WINDOW(mi);
int screen = MI_SCREEN(mi);
@@
-179,17
+168,16
@@
init_sproingies(ModeInfo * mi)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- swap_display = display;
- swap_window = window;
DisplaySproingies(MI_SCREEN(mi),mi->pause);
DisplaySproingies(MI_SCREEN(mi),mi->pause);
+
} else {
MI_CLEARWINDOW(mi);
}
}
/* ARGSUSED */
} else {
MI_CLEARWINDOW(mi);
}
}
/* ARGSUSED */
-void
-draw_sproingies(ModeInfo * mi)
+
ENTRYPOINT
void
+draw_sproingies
(ModeInfo * mi)
{
sproingiesstruct *sp = &sproingies[MI_SCREEN(mi)];
Display *display = MI_DISPLAY(mi);
{
sproingiesstruct *sp = &sproingies[MI_SCREEN(mi)];
Display *display = MI_DISPLAY(mi);
@@
-201,13
+189,15
@@
draw_sproingies(ModeInfo * mi)
glDrawBuffer(GL_BACK);
glXMakeCurrent(display, window, *(sp->glx_context));
glDrawBuffer(GL_BACK);
glXMakeCurrent(display, window, *(sp->glx_context));
- swap_display = display;
- swap_window = window;
-
NextSproingieDisplay(MI_SCREEN(mi),mi->pause); /* It will swap. */
NextSproingieDisplay(MI_SCREEN(mi),mi->pause); /* It will swap. */
+
+ if (mi->fps_p) do_fps (mi);
+ glFinish();
+ glXSwapBuffers(MI_DISPLAY(mi), MI_WINDOW(mi));
}
}
-void
+#ifndef STANDALONE
+ENTRYPOINT void
refresh_sproingies(ModeInfo * mi)
{
/* No need to do anything here... The whole screen is updated
refresh_sproingies(ModeInfo * mi)
{
/* No need to do anything here... The whole screen is updated
@@
-216,9
+206,17
@@
refresh_sproingies(ModeInfo * mi)
* with DisplaySproingies(...).
*/
}
* with DisplaySproingies(...).
*/
}
+#endif /* !STANDALONE */
-void
-release_sproingies(ModeInfo * mi)
+ENTRYPOINT void
+reshape_sproingies (ModeInfo *mi, int w, int h)
+{
+ ReshapeSproingies(w, h);
+}
+
+
+ENTRYPOINT void
+release_sproingies (ModeInfo * mi)
{
if (sproingies != NULL) {
int screen;
{
if (sproingies != NULL) {
int screen;
@@
-239,6
+237,8
@@
release_sproingies(ModeInfo * mi)
FreeAllGL(mi);
}
FreeAllGL(mi);
}
+XSCREENSAVER_MODULE ("Sproingies", sproingies)
+
#endif
/* End of sproingiewrap.c */
#endif
/* End of sproingiewrap.c */