"*count: 200 \n" \
"*cycles: 1000 \n" \
"*ncolors: 32 \n" \
- "*titleFont: -*-helvetica-bold-r-normal-*-180-*\n" \
+ "*titleFont: -*-helvetica-bold-r-normal-*-*-180-*-*-*-*-*-*\n" \
"*showFPS: False \n" \
"*wireframe: False \n" \
#include "tube.h"
#include "rotator.h"
#include "gltrackball.h"
-#include "glxfonts.h"
+#include "texfont.h"
#include <ctype.h>
#ifdef USE_GL /* whole file */
ObjType objtypes;
Object *objects;
struct patternindex patternindex;
-
- XFontStruct *mode_font;
- GLuint font_dlist;
+ texture_font_data *font_data;
} jugglestruct;
static jugglestruct *juggles = (jugglestruct *) NULL;
free(sp->pattern);
sp->pattern = NULL;
}
- if (sp->mode_font!=None) {
- XFreeFontInfo(NULL,sp->mode_font,1);
- sp->mode_font = None;
- }
}
static Bool
GLfloat gcolor1[4] = { 0, 0, 0, 1 };
GLfloat gcolor2[4] = { 1, 1, 1, 1 };
int slices = 16;
- int divs = s->divisions;
- divs = 4;
+ int divs = 4;
/* 6 6
+-+
sp = &juggles[MI_SCREEN(mi)];
- sp->glx_context = init_GL(mi);
+ if (!sp->glx_context) /* re-initting breaks print_texture_label */
+ sp->glx_context = init_GL(mi);
- load_font (mi->dpy, "titleFont", &sp->mode_font, &sp->font_dlist);
+ sp->font_data = load_texture_font (mi->dpy, "titleFont");
reshape_juggle (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
clear_gl_error(); /* WTF? sometimes "invalid op" from glViewport! */
double spin_accel = 0.05;
sp->rot = make_rotator (0, spin_speed, 0,
spin_accel, wander_speed, False);
- sp->trackball = gltrackball_init ();
+ sp->trackball = gltrackball_init (False);
}
if (only && *only && strcmp(only, " ")) {
{
jugglestruct *sp = &juggles[MI_SCREEN(mi)];
- if (event->xany.type == ButtonPress &&
- event->xbutton.button == Button1)
- {
- sp->button_down_p = True;
- gltrackball_start (sp->trackball,
- event->xbutton.x, event->xbutton.y,
- MI_WIDTH (mi), MI_HEIGHT (mi));
- return True;
- }
- else if (event->xany.type == ButtonRelease &&
- event->xbutton.button == Button1)
+ if (gltrackball_event_handler (event, sp->trackball,
+ MI_WIDTH (mi), MI_HEIGHT (mi),
+ &sp->button_down_p))
+ return True;
+ else if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
{
- sp->button_down_p = False;
+ change_juggle (mi);
return True;
}
- else if (event->xany.type == ButtonPress &&
- (event->xbutton.button == Button4 ||
- event->xbutton.button == Button5 ||
- event->xbutton.button == Button6 ||
- event->xbutton.button == Button7))
- {
- gltrackball_mousewheel (sp->trackball, event->xbutton.button, 10,
- !!event->xbutton.state);
- return True;
- }
- else if (event->xany.type == MotionNotify &&
- sp->button_down_p)
- {
- gltrackball_track (sp->trackball,
- event->xmotion.x, event->xmotion.y,
- MI_WIDTH (mi), MI_HEIGHT (mi));
- return True;
- }
- else if (event->xany.type == KeyPress)
- {
- KeySym keysym;
- char c = 0;
- XLookupString (&event->xkey, &c, 1, &keysym, 0);
- if (c == ' ' || c == '\n' || c == '\r' || c == '\t')
- {
- change_juggle (mi);
- return True;
- }
- }
-
return False;
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix ();
+ glRotatef(current_device_rotation(), 0, 0, 1);
glTranslatef(0,-3,0);
}
}
- if(sp->mode_font != None) {
- print_gl_string (mi->dpy, sp->mode_font, sp->font_dlist,
- mi->xgwa.width, mi->xgwa.height,
- 10, mi->xgwa.height - 10,
- sp->pattern, False);
- }
+ glColor3f (1, 1, 0);
+ print_texture_label (mi->dpy, sp->font_data,
+ mi->xgwa.width, mi->xgwa.height,
+ 1, sp->pattern);
#ifdef MEMTEST
if((int)(sp->time/10) % 1000 == 0)