本文整理汇总了C++中MI_WINDOW函数的典型用法代码示例。如果您正苦于以下问题:C++ MI_WINDOW函数的具体用法?C++ MI_WINDOW怎么用?C++ MI_WINDOW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MI_WINDOW函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: change_projectiveplane
ENTRYPOINT void change_projectiveplane(ModeInfo *mi)
{
projectiveplanestruct *pp = &projectiveplane[MI_SCREEN(mi)];
if (!pp->glx_context)
return;
glXMakeCurrent(MI_DISPLAY(mi),MI_WINDOW(mi),*(pp->glx_context));
init(mi);
}
开发者ID:Ro6afF,项目名称:XScreenSaver,代码行数:10,代码来源:projectiveplane.c
示例2: change_antinspect
ENTRYPOINT void change_antinspect(ModeInfo * mi)
{
antinspectstruct *mp = &antinspect[MI_SCREEN(mi)];
if (!mp->glx_context)
return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(mp->glx_context));
pinit();
}
开发者ID:sev-,项目名称:xscreensaver,代码行数:10,代码来源:antinspect.c
示例3: draw_blocktube
ENTRYPOINT void
draw_blocktube (ModeInfo *mi)
{
blocktube_configuration *lp = &lps[MI_SCREEN(mi)];
Display *dpy = MI_DISPLAY(mi);
Window window = MI_WINDOW(mi);
entity *cEnt = NULL;
int loop = 0;
if (!lp->glx_context)
return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(lp->glx_context));
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if (do_texture) {
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glBindTexture(GL_TEXTURE_2D, lp->envTexture);
}
for (loop = 0; loop < MAX_ENTITIES; loop++) {
cEnt = &lp->entities[loop];
glLoadIdentity();
glTranslatef(0.0f, 0.0f, lp->zoom);
glRotatef(lp->tilt, 1.0f, 0.0f, 0.0f);
glRotatef(cEnt->angle, 0.0f, 0.0f, 1.0f);
glTranslatef(cEnt->position[0], cEnt->position[1], cEnt->position[2]);
glColor4ub((int)(lp->currentR * cEnt->tVal),
(int)(lp->currentG * cEnt->tVal),
(int)(lp->currentB * cEnt->tVal), 255);
draw_block(mi, cEnt);
entityTick(lp, cEnt);
}
tick(lp);
if (mi->fps_p) do_fps (mi);
glFinish();
glXSwapBuffers(dpy, window);
}
开发者ID:RazZziel,项目名称:pongclock,代码行数:42,代码来源:blocktube.c
示例4: sponge_handle_event
ENTRYPOINT Bool
sponge_handle_event (ModeInfo *mi, XEvent *event)
{
sponge_configuration *sp = &sps[MI_SCREEN(mi)];
if (gltrackball_event_handler (event, sp->trackball,
MI_WIDTH (mi), MI_HEIGHT (mi),
&sp->button_down_p))
return True;
else if (event->xany.type == KeyPress)
{
KeySym keysym;
char c = 0;
XLookupString (&event->xkey, &c, 1, &keysym, 0);
if (c == '+' || c == '=' ||
keysym == XK_Up || keysym == XK_Right || keysym == XK_Next)
{
sp->draw_tick = speed;
sp->current_depth += (sp->current_depth > 0 ? 1 : -1);
sp->current_depth--;
return True;
}
else if (c == '-' || c == '_' ||
keysym == XK_Down || keysym == XK_Left || keysym == XK_Prior)
{
sp->draw_tick = speed;
sp->current_depth -= (sp->current_depth > 0 ? 1 : -1);
sp->current_depth--;
return True;
}
else if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
goto DEF;
}
else if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
{
DEF:
sp->draw_tick = speed;
return True;
}
return False;
}
开发者ID:mmarseglia,项目名称:xscreensaver,代码行数:42,代码来源:menger.c
示例5: init_screenflip
ENTRYPOINT void init_screenflip(ModeInfo *mi)
{
int screen = MI_SCREEN(mi);
Screenflip *c;
if (screenflip == NULL) {
if ((screenflip = (Screenflip *) calloc(MI_NUM_SCREENS(mi),
sizeof(Screenflip))) == NULL)
return;
}
c = &screenflip[screen];
c->window = MI_WINDOW(mi);
c->trackball = gltrackball_init ();
if ((c->glx_context = init_GL(mi)) != NULL) {
reshape_screenflip(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
} else {
MI_CLEARWINDOW(mi);
}
c->winh = MI_WIN_HEIGHT(mi);
c->winw = MI_WIN_WIDTH(mi);
c->qw = QW;
c->qh = QH;
c->qx = -6;
c->qy = 6;
c->rx = c->ry = 1;
c->odrot = 1;
c->show_colors[0] = c->show_colors[1] =
c->show_colors[2] = c->show_colors[3] = 1;
if (! MI_IS_WIREFRAME(mi))
{
glShadeModel(GL_SMOOTH);
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glDisable(GL_LIGHTING);
}
if (strstr ((char *) glGetString(GL_EXTENSIONS),
"GL_EXT_texture_filter_anisotropic"))
glGetFloatv (GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &c->anisotropic);
else
c->anisotropic = 0.0;
glGenTextures(1, &c->texid);
c->first_image_p = True;
getSnapshot(mi);
}
开发者ID:davehorner,项目名称:XScreenSaverWin,代码行数:54,代码来源:flipscreen3d.c
示例6: draw_fadeplot
ENTRYPOINT void
draw_fadeplot (ModeInfo * mi)
{
Display *display = MI_DISPLAY(mi);
Window window = MI_WINDOW(mi);
GC gc = MI_GC(mi);
int i, j, temp;
fadeplotstruct *fp;
if (fadeplots == NULL)
return;
fp = &fadeplots[MI_SCREEN(mi)];
if (fp->stab == NULL)
return;
MI_IS_DRAWN(mi) = True;
XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
XDrawPoints(display, window, gc, fp->pts, fp->maxpts, CoordModeOrigin);
if (MI_NPIXELS(mi) > 2) {
XSetForeground(display, gc, MI_PIXEL(mi, fp->pix));
if (++fp->pix >= MI_NPIXELS(mi))
fp->pix = 0;
} else
XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
temp = 0;
for (j = 0; j < fp->nbstep; j++) {
for (i = 0; i < fp->maxpts / fp->nbstep; i++) {
fp->pts[temp].x =
fp->stab[(fp->st.x + fp->speed.x * j + i * fp->step.x) % fp->angles] *
fp->factor.x + fp->width / 2 - fp->min;
fp->pts[temp].y =
fp->stab[(fp->st.y + fp->speed.y * j + i * fp->step.y) % fp->angles] *
fp->factor.y + fp->height / 2 - fp->min;
temp++;
}
}
XDrawPoints(display, window, gc, fp->pts, temp, CoordModeOrigin);
fp->st.x = (fp->st.x + fp->speed.x) % fp->angles;
fp->st.y = (fp->st.y + fp->speed.y) % fp->angles;
fp->temps++;
if ((fp->temps % (fp->angles / 2)) == 0) {
fp->temps = fp->temps % fp->angles * 5;
if ((fp->temps % (fp->angles)) == 0)
fp->speed.y = (fp->speed.y + 1) % 30 + 1;
if ((fp->temps % (fp->angles * 2)) == 0)
fp->speed.x = (fp->speed.x) % 20;
if ((fp->temps % (fp->angles * 3)) == 0)
fp->step.y = (fp->step.y + 1) % 2 + 1;
MI_CLEARWINDOW(mi);
}
}
开发者ID:sev-,项目名称:xscreensaver,代码行数:54,代码来源:fadeplot.c
示例7: free_unicrud
ENTRYPOINT void
free_unicrud (ModeInfo *mi)
{
unicrud_configuration *bp = &bps[MI_SCREEN(mi)];
if (!bp->glx_context) return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *bp->glx_context);
if (bp->trackball) gltrackball_free (bp->trackball);
if (bp->rot) free_rotator (bp->rot);
if (bp->title_font) free_texture_font (bp->title_font);
if (bp->char_font) free_texture_font (bp->char_font);
}
开发者ID:Zygo,项目名称:xscreensaver,代码行数:11,代码来源:unicrud.c
示例8: init_atlantis
ENTRYPOINT void
init_atlantis(ModeInfo * mi)
{
int screen = MI_SCREEN(mi);
atlantisstruct *ap;
Display *display = MI_DISPLAY(mi);
Window window = MI_WINDOW(mi);
if (atlantis == NULL) {
if ((atlantis = (atlantisstruct *) calloc(MI_NUM_SCREENS(mi),
sizeof (atlantisstruct))) == NULL)
return;
}
ap = &atlantis[screen];
ap->num_sharks = MI_COUNT(mi);
if (ap->sharks == NULL) {
if ((ap->sharks = (fishRec *) calloc(ap->num_sharks,
sizeof (fishRec))) == NULL) {
/* free everything up to now */
(void) free((void *) atlantis);
atlantis = NULL;
return;
}
}
ap->sharkspeed = MI_CYCLES(mi); /* has influence on the "width"
of the movement */
ap->sharksize = MI_SIZE(mi); /* has influence on the "distance"
of the sharks */
ap->whalespeed = whalespeed;
ap->wire = MI_IS_WIREFRAME(mi);
if (MI_IS_DEBUG(mi)) {
(void) fprintf(stderr,
"%s:\n\tnum_sharks=%d\n\tsharkspeed=%.1f\n\tsharksize=%d\n\twhalespeed=%.1f\n\twireframe=%s\n",
MI_NAME(mi),
ap->num_sharks,
ap->sharkspeed,
ap->sharksize,
ap->whalespeed,
ap->wire ? "yes" : "no"
);
}
if ((ap->glx_context = init_GL(mi)) != NULL) {
reshape_atlantis(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
glDrawBuffer(GL_BACK);
Init(mi);
AllDisplay(ap);
glXSwapBuffers(display, window);
} else {
MI_CLEARWINDOW(mi);
}
}
开发者ID:mmarseglia,项目名称:xscreensaver,代码行数:54,代码来源:atlantis.c
示例9: change_atlantis
ENTRYPOINT void
change_atlantis(ModeInfo * mi)
{
atlantisstruct *ap = &atlantis[MI_SCREEN(mi)];
if (!ap->glx_context)
return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(ap->glx_context));
Init(mi);
}
开发者ID:mmarseglia,项目名称:xscreensaver,代码行数:11,代码来源:atlantis.c
示例10: change_moebius
ENTRYPOINT void
change_moebius (ModeInfo * mi)
{
moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
if (!mp->glx_context)
return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(mp->glx_context));
pinit(mi);
}
开发者ID:davehorner,项目名称:XScreenSaverWin,代码行数:11,代码来源:moebius.c
示例11: draw_stonerview
ENTRYPOINT void
draw_stonerview (ModeInfo *mi)
{
stonerview_configuration *bp = &bps[MI_SCREEN(mi)];
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(bp->glx_context));
glPushMatrix ();
gltrackball_rotate (bp->trackball);
win_draw(bp->st);
if (! bp->button_down_p)
move_increment(bp->st);
glPopMatrix ();
mi->polygon_count = NUM_ELS;
if (mi->fps_p) do_fps (mi);
glFinish();
glXSwapBuffers(MI_DISPLAY (mi), MI_WINDOW(mi));
}
开发者ID:RazZziel,项目名称:pongclock,代码行数:20,代码来源:stonerview.c
示例12: change_pipes
ENTRYPOINT void
change_pipes (ModeInfo * mi)
{
pipesstruct *pp = &pipes[MI_SCREEN(mi)];
if (!pp->glx_context)
return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(pp->glx_context));
pinit(mi, 1);
}
开发者ID:davehorner,项目名称:XScreenSaverWin,代码行数:11,代码来源:pipes.c
示例13: change_stairs
ENTRYPOINT void
change_stairs (ModeInfo * mi)
{
stairsstruct *sp = &stairs[MI_SCREEN(mi)];
if (!sp->glx_context)
return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(sp->glx_context));
pinit();
}
开发者ID:mmarseglia,项目名称:xscreensaver,代码行数:11,代码来源:stairs.c
示例14: hop_handle_event
ENTRYPOINT Bool
hop_handle_event (ModeInfo *mi, XEvent *event)
{
if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
{
MI_CLEARWINDOW(mi);
init_hop (mi);
return True;
}
return False;
}
开发者ID:sev-,项目名称:xscreensaver,代码行数:11,代码来源:hopalong.c
示例15: draw_blot
void
draw_blot(ModeInfo * mi)
{
blotstruct *bp;
XPoint *xp;
int x, y, k;
if (blots == NULL)
return;
bp = &blots[MI_SCREEN(mi)];
xp = bp->pointBuffer;
if (xp == NULL)
init_blot(mi);
MI_IS_DRAWN(mi) = True;
if (MI_NPIXELS(mi) > 2) {
XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_PIXEL(mi, bp->pix));
if (++bp->pix >= MI_NPIXELS(mi))
bp->pix = 0;
}
x = bp->xmid;
y = bp->ymid;
k = bp->size;
while (k >= 4) {
x += (NRAND(1 + (bp->offset << 1)) - bp->offset);
y += (NRAND(1 + (bp->offset << 1)) - bp->offset);
k--;
xp->x = x;
xp->y = y;
xp++;
if (bp->xsym) {
k--;
xp->x = bp->width - x;
xp->y = y;
xp++;
}
if (bp->ysym) {
k--;
xp->x = x;
xp->y = bp->height - y;
xp++;
}
if (bp->xsym && bp->ysym) {
k--;
xp->x = bp->width - x;
xp->y = bp->height - y;
xp++;
}
}
XDrawPoints(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
bp->pointBuffer, (bp->size - k), CoordModeOrigin);
if (++bp->count > MI_CYCLES(mi))
init_blot(mi);
}
开发者ID:Bluerise,项目名称:bitrig-xenocara,代码行数:54,代码来源:blot.c
示例16: change_cage
ENTRYPOINT void
change_cage (ModeInfo * mi)
{
cagestruct *cp = &cage[MI_SCREEN(mi)];
if (!cp->glx_context)
return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(cp->glx_context));
pinit(mi);
}
开发者ID:RazZziel,项目名称:pongclock,代码行数:11,代码来源:cage.c
示例17: DrawEllipse
static void DrawEllipse(ModeInfo * mi, dropstruct *drop, unsigned long color)
{
Display *display = MI_DISPLAY(mi);
Window window = MI_WINDOW(mi);
GC gc = MI_GC(mi);
int w = 2 * drop->radius;
int h = (drop->radius * 2) / 3;
XSetForeground(display, gc, color);
XDrawArc(display, window, gc,
drop->drop.x - w, drop->drop.y - h, 2 * w + 1, 2 * h + 1, 0, 360 * 64);
}
开发者ID:Gelma,项目名称:xlockmore-for-13.04,代码行数:12,代码来源:rain.c
示例18: draw_line
static void
draw_line(ModeInfo * mi, XPoint * points, int number, GC to_use, int offset)
{
int i;
for (i = 0; i < number - 1; i++) {
if (points[i].y <= points[i + 1].y)
XDrawLine(MI_DISPLAY(mi), MI_WINDOW(mi), to_use, points[i].x + offset,
points[i].y, points[i + 1].x + offset, points[i + 1].y);
else {
if (points[i].x < points[i + 1].x)
XDrawLine(MI_DISPLAY(mi), MI_WINDOW(mi), to_use, points[i].x +
offset, points[i].y + offset, points[i + 1].x + offset,
points[i + 1].y + offset);
else
XDrawLine(MI_DISPLAY(mi), MI_WINDOW(mi), to_use, points[i].x -
offset, points[i].y + offset, points[i + 1].x - offset,
points[i + 1].y + offset);
}
}
}
开发者ID:RazZziel,项目名称:pongclock,代码行数:21,代码来源:lightning.c
示例19: startup_blurb
static void
startup_blurb (ModeInfo *mi)
{
molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
const char *s = "Constructing molecules...";
print_gl_string (mi->dpy, mc->xfont3, mc->font3_dlist,
mi->xgwa.width, mi->xgwa.height,
10, mi->xgwa.height - 10,
s, False);
glFinish();
glXSwapBuffers(MI_DISPLAY(mi), MI_WINDOW(mi));
}
开发者ID:david-sackmary,项目名称:distro-mods,代码行数:12,代码来源:molecule.c
示例20: draw_noof
ENTRYPOINT void
draw_noof (ModeInfo *mi)
{
int i;
noof_configuration *bp = &bps[MI_SCREEN(mi)];
if (!bp->glx_context)
return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(bp->glx_context));
mi->polygon_count = 0;
/**
if((random() & 0xff) == 0x34){
glClear(GL_COLOR_BUFFER_BIT);
}
if((tko & 0x1f) == 0x1f){
glEnable(GL_BLEND);
glColor4f(0.0, 0.0, 0.0, 0.09);
glRectf(0.0, 0.0, wd, ht);
glDisable(GL_BLEND);
#ifdef __sgi
sginap(0);
#endif
}
*/
gravity(bp, -2.0);
for (i = 0; i < N_SHAPES; i++) {
motionUpdate(bp, i);
colorUpdate(bp, i);
mi->polygon_count += drawleaf(bp, i);
}
if (mi->fps_p) do_fps (mi);
glFinish();
if (dbuf_p)
glXSwapBuffers(MI_DISPLAY(mi), MI_WINDOW(mi));
}
开发者ID:rivy,项目名称:XScreenSaverWin,代码行数:40,代码来源:noof.c
注:本文中的MI_WINDOW函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论