这篇教程C++ DX函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DX函数的典型用法代码示例。如果您正苦于以下问题:C++ DX函数的具体用法?C++ DX怎么用?C++ DX使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DX函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: updatePMLEFieldUtilExvoid updatePMLEFieldUtilEx(int xStart, int xEnd, int yStart, int yEnd, int zStart, int zEnd, int xBound, int yBound, int zBound, pmlConstStruct cx[], pmlConstStruct cy[], pmlConstStruct cz[], int n){ int i, j, k; // These are the indexes int x,y,z;// There are indexes for the pmlConstStruct indexs long p; int m; double dxStore; double eps; for (i=xStart;i<xEnd+1;i++){ x = abs(xBound - i)%PML_LAYERS; for (j=yStart;j<yEnd+1;j++){ y = abs(yBound - j)%PML_LAYERS; for (k=zStart;k<zEnd+1;k++){ z = abs(zBound - k)%PML_LAYERS; p = PMLINDEX(i,j,k); dxStore = DX(p); m = MATERIALINDEX(i,j,k); eps = EPSR(m)*EPSNOT; DX(p) = cy[y].c1*DX(p) + cy[y].c2*(HZ(i,j,k) - HZ(i,j-1,k) - HY(i,j,k) + HY(i,j,k-1) - JSX(m)); EX(i,j,k) = cz[z].c3*EX(i,j,k) + cz[z].c4*(cx[x].c5*DX(p)-cx[x].c6*dxStore)/eps; }}} // end for}// end updatePMLEFieldUtilEx
开发者ID:vbora,项目名称:FDTD,代码行数:26,
示例2: drawHCenteredvoid LevelWinDialog::paintContent(QPainter &p){ GamePanel::paintContent(p); p.setOpacity(1); p.setFont(gameStock->Font40); p.setPen(QPen(QColor(0x030055))); drawHCentered(p, 50, tr("Level %1 completed!").arg(level)); p.setFont(gameStock->Font20); const int y30 = DY(40); const int x1 = DX(300), x2 = DX(380), x3 = DX(600); const int y1 = DY(250), y2 = DY(350); p.drawPixmap(x1,y1, gameStock->Clock); p.drawText(x3,y1+y30, QString("%1:%2").arg(time/60, 2, 10, QChar('0')).arg(time%60, 2, 10, QChar('0'))); p.drawPixmap(x1,y2, gameStock->Score); p.drawText(x3,y2+y30, QString::number(score)); p.setPen(QPen(Qt::black)); p.drawText(x2,y1+y30, tr("Time left:")); p.drawText(x2,y2+y30, tr("Score:"));}
开发者ID:SanskritFritz,项目名称:bubble-chains,代码行数:27,
示例3: add_buttonbutton *add_button(Rectangle r, char *name, char *default_label, Pixel color, void *param) { button *b = (button *)malloc(sizeof(button)); utf8 *label[bstates]; assert(b); // allocating button memory b->type = Button; b->r = r; b->name = name; b->state = default_button_state; b->next = 0; b->param = param; b->category = default_category; last_button = b; if ( !(ptinrect(r.min, screen_rect) && r.max.x <= screen_rect.max.x && r.max.y <= screen_rect.max.y)) { fprintf(stderr, "*** button %s is off screen, ignored: %d,%d - %d,%d/n", name, r.min.x, r.min.y, r.max.x, r.max.y); return 0; } /* lookup configuration file alternates for our default label names. */ label[Off] = lookup(name, ".off", default_label); label[On] = lookup(name, ".on", default_label); label[Unavailable] = lookup(name, ".unavail", default_label);fprintf(stderr, "0 "); make_PixMap(&b->pm[Off], (Rectangle){{0,0},{DX(r),DY(r)}}, color);fprintf(stderr, "1 "); make_PixMap(&b->pm[On], (Rectangle){{0,0},{DX(r),DY(r)}}, color);fprintf(stderr, "1 "); make_PixMap(&b->pm[Unavailable],(Rectangle){{0,0},{DX(r),DY(r)}}, dim_color(color));fprintf(stderr, "2/n"); b_fill_rect(b->pm[Off], inset(b->pm[Off].r, BUTTON_RIM), dim_color(color)); b_fill_rect(b->pm[On], inset(b->pm[On].r, BUTTON_RIM), Black); string_on_pixmap(&(b->pm[Off]), label[Off], White, 1, 1); string_on_pixmap(&(b->pm[On]), label[On], White, 1, 1); string_on_pixmap(&(b->pm[Unavailable]), label[Unavailable], dim_color(White), 1, 1); /* Add button to the end of the linked list */fprintf(stderr, "2 "); if (buttons == 0) buttons = b; else { button *bp = buttons; while (bp->next) bp = bp->next; bp->next = b; } return b;}
开发者ID:wcheswick,项目名称:ex,代码行数:58,
示例4: mainintmain(int ac, char *av[]){ struct cfg_s c; struct timeval end; double ll; int i; char msg[40]; uint64_t cyc; struct sched_param schedparam; schedparam.sched_priority = 11; if (sched_setscheduler(0, SCHED_FIFO, &schedparam) == 0) printf("Set process to real-time priority %i/n", 11); else printf("Couldn't invoke real time scheduling priority %i" " (access denied?)/n", 11); bzero(&c, sizeof(c)); c.ac = ac; c.av = av; init(&c); gettimeofday(&c.time, NULL); cyc = mainloop(&c); gettimeofday(&end, NULL); end.tv_sec -= c.time.tv_sec; end.tv_usec -= c.time.tv_usec; if (end.tv_usec < 0) { end.tv_usec += 1000000; end.tv_sec--; } c.time = end; ll = end.tv_sec*1000000 + end.tv_usec; ll *= 1000; /* convert to nanoseconds */ ll /= c._enqueue; sprintf(msg, "1::%d", c.flows); D("%-8s n %d %d time %d.%06d %8.3f qlen %d %d flows %s drops %d", c.name, c._enqueue, c.loops, (int)c.time.tv_sec, (int)c.time.tv_usec, ll, c.th_min, c.th_max, c.fs_config ? c.fs_config : msg, c.drop); D("---Accurate Timing Information---"); D("Time for Cycle:/n/t Originally:%8.3f ns/n/tWith gticks:%8.3f ns/n", ll, (double) cyc2ns(cyc) / c._enqueue); D("Summary time:/n/t Originally: %d.%06d s/n/tWith gticks: %8.6f s/n", (int)c.time.tv_sec, (int)c.time.tv_usec, (double) cyc2ns(cyc)/1000000000.0); dump(&c); DX(1, "done ac %d av %p", ac, av); for (i=0; i < ac; i++) DX(1, "arg %d %s", i, av[i]); return 0;}
开发者ID:kronat,项目名称:libgticks,代码行数:54,
示例5: request_move_rightstatic void request_move_right(void) { if (y < NAMES_PER_COL(page) - 1 && PXY2N(page,0,y+1) < rl.cur_entries && (x == NAMES_PER_LINE(page) - 1 || PXY2N(page,x+1,y) > rl.cur_entries -1) ) { request_move_to_sol(); request_move_down(); } else if (y == NAMES_PER_COL(page) - 1 && x == NAMES_PER_LINE(page) - 1 && PXY2N(page+1,0,0) < rl.cur_entries) { normalize(PXY2N(page+1,0,0)); } else if (PXY2N(page,x,y) + DX(page) < rl.cur_entries ) { normalize(PXY2N(page,x,y) + DX(page)); }}
开发者ID:dmt4,项目名称:ne,代码行数:13,
示例6: createStaticPopupvoid IScene::addTime(int timeAdd){ time += timeAdd; createStaticPopup(QRect(DX(975), DY(75), DX(100), DY(30)), QString("+%1").arg(timeAdd), Qt::AlignLeft | Qt::AlignTop, gameStock->Font20, Qt::yellow, 1, 0, 20, 0, -1 );}
开发者ID:SanskritFritz,项目名称:bubble-chains,代码行数:14,
示例7: dump_assertion_type_valuestatic voiddump_assertion_type_value (gulong type){ switch (type) { #define DX(x) case x: g_printerr ("%s", #x); break; DX(CKT_X_DISTRUSTED_CERTIFICATE); DX(CKT_X_PINNED_CERTIFICATE); DX(CKT_X_ANCHORED_CERTIFICATE); #undef DX default: g_printerr ("%u", (unsigned int)type); break; }}
开发者ID:bhull2010,项目名称:mate-keyring,代码行数:15,
示例8: DYvoid Scene::drawTextHint(QPainter& painter) { painter.setOpacity(1); painter.setPen(QPen(Qt::white)); painter.setFont(gameStock->font12); QString hintText = "Hint"; painter.drawText(0, DY(690), DX(860), DY(30), Qt::AlignRight, hintText);}
开发者ID:dujodujo,项目名称:chimp,代码行数:7,
示例9: freeDOSvoid freeDOS (short sel){ AX(regs) = 0x0101; // DPMI free DOS memory DX(regs) = sel; int386( DPMI_INT, ®s, ®s);}
开发者ID:OpenSourcedGames,项目名称:Rise-of-the-Triad,代码行数:7,
示例10: segreadvoid far *allocDOS (unsigned nbytes, short *pseg, short *psel){ unsigned npara = (nbytes + 15) / 16; void far *pprot; pprot = NULL; *pseg = 0; // assume will fail *psel = 0; // DPMI call 100h allocates DOS memory segread (&sregs); AX (regs) = 0x0100; // DPMI: Allocate DOS Memory BX (regs) = npara; // number of paragraphs to alloc int386( DPMI_INT, ®s, ®s); if (regs.w.cflag == 0) { *pseg = AX (regs); // the real-mode segment *psel = DX (regs); // equivalent protected-mode selector // pprot is the protected mode address of the same allocated block. // The Rational extender maps the 1 MB physical DOS memory into // the bottom of our virtual address space. pprot = (void far *) ((unsigned)*pseg << 4); } return pprot;}
开发者ID:OpenSourcedGames,项目名称:Rise-of-the-Triad,代码行数:25,
示例11: show_histvoidshow_hist(void) { int i, y; int font_height = FONTHEIGHT(text_font); Point p = (Point){hist_r.min.x, hist_r.max.y}; struct button_info *bi = 0; clear_to_background(hist_r); for (i=0; i<nhist; i++) { button *bp = history[i]; bi = (struct button_info *)bp->param; p.y -= 2; p.y -= DY(bi->name.r); write_pixmap(p, bi->name.r, bi->name); }#ifdef explain clear_to_background(explain_r); if (nhist) { if (DX(bi->description.r)) write_pixmap(explain_r.min, bi->description.r, bi->description); else write_pixmap(explain_r.min, bi->name.r, bi->name); }#endif}
开发者ID:wcheswick,项目名称:ex,代码行数:28,
示例12: DX// update value in dialog void DTransformPosition::SetValue(const char *value){ CDataExchange DX(this,FALSE); m_value = value; DDX_Text(&DX, IDC_VALUE, m_value);}
开发者ID:deepmatrix,项目名称:blaxxun-cc3d,代码行数:9,
示例13: lengthtemplate<> Vec<3,Float> VecBase<Vec<3,Float>>::normalize(option<Real&> len) const{ if (len) { Real l = length(); if (l > RealT::zeroTol) { len = l; return *this / l; } len = 0; return VecS().fromZero(); } VecS ret; D3DXVec3Normalize(DX(ret), DX(*this)); return ret;};
开发者ID:Qarterd,项目名称:Honeycomb,代码行数:18,
示例14: request_move_leftstatic void request_move_left(void) { if ( x == 0 && y + page > 0 ) { request_move_up(); request_move_to_eol(); } else { normalize(PXY2N(page,x,y) - DX(page)); }}
开发者ID:dmt4,项目名称:ne,代码行数:9,
示例15: right/* * Return a button's rectangle the same size and shape as the given rectangle, * just to the right of it. */Rectangleright(Rectangle br) { Rectangle r; r.min.x = br.max.x + button_sep; r.max.x = r.min.x + DX(br); r.max.y = br.max.y; r.min.y = br.min.y; return r;}
开发者ID:wcheswick,项目名称:ex,代码行数:14,
示例16: DXvoid CErrorAnal_dlg::UpdateStatParams(){ CDataExchange DX(this,FALSE); DDX_Text(&DX, IDC_NUM_FEATR, m_num_featr); DDX_Text(&DX, IDC_RAW_ERR, m_raw_error); DDX_Text(&DX, IDC_RESID_ERR, m_resid_error); DDX_Text(&DX, IDC_BIAS, m_bias); if (m_separam && m_mahal>=0) DDX_Text(&DX, IDC_MAHAL, m_mahal); else GetDlgItem(IDC_MAHAL)->SetWindowText("");}
开发者ID:MarkPThomas,项目名称:winprom,代码行数:10,
示例17: calcEstatic inline void calcE(void){ for(int i=1; i<N_PX-1; i++) for(int j=1; j<N_PY-1; j++) Ex[ind(i,j)] = DX(i,j)/EPSEX(i,j); for(int i=1; i<N_PX-1; i++) for(int j=1; j<N_PY-1; j++) Ey[ind(i,j)] = DY(i,j)/EPSEY(i,j);}
开发者ID:rennone,项目名称:C,代码行数:10,
示例18: paint_button/* * Paint the button. If it is hidden, blacken the area. If they don't want us * to blacken the area, they shouldn't call us in the first place. */voidpaint_button(button *b) { assert(b->state >= 0 && b->state < bstates); if (b->state == Hidden) { fill_rect(b->r, Black); return; } write_pixmap(b->r.min, (Rectangle){{0,0}, {DX(b->pm[b->state].r),DY(b->pm[b->state].r)}}, b->pm[b->state]);}
开发者ID:wcheswick,项目名称:ex,代码行数:15,
示例19: updatePMLEFieldUtilAllvoid updatePMLEFieldUtilAll(int xStart, int xEnd, int yStart, int yEnd, int zStart, int zEnd, int xBound, int yBound, int zBound, pmlConstStruct cx[], pmlConstStruct cy[], pmlConstStruct cz[], int n){ int i, j, k; // These are the indexes int x,y,z;// There are indexes for the pmlConstStruct indexs long p; int m; double dxStore, dyStore, dzStore; double eps;// Either this, or make cOnes a bigger array with number of elements which are the max of xLen, yLen, zLen for (i=xStart;i<xEnd+1;i++){ x = abs(xBound - i)%PML_LAYERS; for (j=yStart;j<yEnd+1;j++){ y = abs(yBound - j)%PML_LAYERS; for (k=zStart;k<zEnd+1;k++){ z = abs(zBound - k)%PML_LAYERS; //printf("(i,j,k) (%d, %d, %d), (x,y,z) (%d,%d,%d)/n", i,j,k,x,y,z); p = PMLINDEX(i,j,k); dxStore = DX(p); dyStore = DY(p); dzStore = DZ(p); m = MATERIALINDEX(i,j,k); eps = EPSR(m)*EPSNOT; DX(p) = cy[y].c1*DX(p) + cy[y].c2*(HZ(i,j,k) - HZ(i,j-1,k) - HY(i,j,k) + HY(i,j,k-1) - JSX(m)); EX(i,j,k) = cz[z].c3*EX(i,j,k) + cz[z].c4*(cx[x].c5*DX(p)-cx[x].c6*dxStore)/eps; DY(p) = cz[z].c1*DY(p) + cz[z].c2*(HX(i,j,k) - HX(i,j,k-1) + HZ(i-1,j,k) - HZ(i,j,k) - JSY(m)); EY(i,j,k) = cx[x].c3*EY(i,j,k) + cx[x].c4*(cy[y].c5*DY(p)-cy[y].c6*dyStore)/eps; DZ(p) = cx[x].c1*DZ(p) + cx[x].c2*(HY(i,j,k) - HY(i-1,j,k) - HX(i,j,k) + HX(i,j-1,k) - JSZ(m)); EZ(i,j,k) = cy[y].c3*EZ(i,j,k) + cy[y].c4*(cz[z].c5*DZ(p)-cz[z].c6*dzStore)/eps; }}} // end for}// end updatePMLEFieldUtilAll
开发者ID:vbora,项目名称:FDTD,代码行数:37,
示例20: DX//-------------------------------------------------------------------//// OnSelchangeDatetimeCalendar() ////-------------------------------------------------------------------//// Update from calendar to selector.//// NOTE: This notification message is similar to MCN_SELECT, but // it is sent in response to any selection change. MCN_SELECT is // sent only for an explicit date selection. For example, the // control sends MCN_SELCHANGE when the user explicitly changes // his or her selection within the current month or when the // selection is implicitly changed in response to next/previous // month navigation.//-------------------------------------------------------------------//void DateTimeSelector::OnSelchangeDatetimeCalendar(NMHDR* pNMHDR, LRESULT* pResult) { LPNMSELCHANGE lpNMSelChange = (LPNMSELCHANGE)pNMHDR; // Update the date selector. m_SelectedDate = lpNMSelChange->stSelStart; // Redisplay JUST THE DATE SELECTOR or we have problems. // UpdateData( FALSE ); CDataExchange DX( this, // m_pDlgWnd FALSE // m_bValidateAndSave ); DDX_DateTimeCtrl( &DX, IDC_DATETIME_DATE_SELECTOR, m_SelectedDate); *pResult = 0;}
开发者ID:moodboom,项目名称:Reusable,代码行数:30,
示例21: Xvoid Viewpoint::update(){ //todo double dx = objToTrack->VX(); double dy = objToTrack->VY(); double dz = objToTrack->VZ(); double x = objToTrack->X()-10*dx; double y = objToTrack->Y()-20*dy; double z = objToTrack->Z()-10*dz; X(x); Y(y); Z(z); DX(-dx); DY(dy); DZ(dz);}
开发者ID:sylvanchil,项目名称:8700,代码行数:17,
示例22: calcJDstatic inline void calcJD(void){ for(int i=1; i<N_PX-1; i++){ for(int j=1; j<N_PY-1; j++){ double complex nowJx = JX(i,j); Jx[ind(i,j)] = CJX(i,j)*JX(i,j) + CJXHZ(i,j)*(HZ(i,j) - HZ(i,j-1)); Dx[ind(i,j)] = CDX(i,j)*DX(i,j) + CDXJX1(i,j)*JX(i,j) - CDXJX0(i,j)*nowJx; } } for(int i=1; i<N_PX-1; i++){ for(int j=1; j<N_PY-1; j++){ double complex nowJy = JY(i,j); Jy[ind(i,j)] = CJY(i,j)*JY(i,j) + CJYHZ(i,j)*(-HZ(i,j) + HZ(i-1,j)); Dy[ind(i,j)] = CDY(i,j)*DY(i,j) + CDYJY1(i,j)*JY(i,j) - CDYJY0(i,j)*nowJy; } }}
开发者ID:rennone,项目名称:C,代码行数:18,
注:本文中的DX函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DXCall函数代码示例 C++ DWC_WARN函数代码示例 |