void Init(){ glClearColor(0.5, 0.5, 0.5, 1); glClearDepth(1); glEnable(GL_DEPTH_TEST); for (size_t i = 0; i < 256; i++) { vecSpecialKeyPressed[i] = false; vecKeyPressed[i] = false; } initShaders(); initTextures(); initMouseMovements(); initVectors(); initCubeMap(); initTerrain(); initVegetation(); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); GLint MaxPatchVertices = 0; glGetIntegerv(GL_MAX_PATCH_VERTICES, &MaxPatchVertices); printf("Max supported patch vertices %d\n", MaxPatchVertices); }
const ZLColor W32ColorComboBox::color(int index) const { initVectors(); if (myUseCustomColor) { if (index == 0) { return myCustomColor; } --index; } return ourColors[index]; }
const ZLUnicodeUtil::Ucs2String &W32ColorComboBox::text(int index) const { initVectors(); if (myUseCustomColor) { if (index == 0) { static const ZLUnicodeUtil::Ucs2String EMPTY; return EMPTY; } --index; } return ourStrings[index]; }
int main(int argc, char* argv[]) { if (argc < 2) { fprintf(stderr, "Usage: %s <m> [<numTrials> <alpha> <epsilon>]\n", argv[0]); fprintf(stderr, " m is the problem size\n"); fprintf(stderr, " numTrials is the number of trials to run\n"); fprintf(stderr, " alpha is the scalar multiplier\n"); fprintf(stderr, " epsilon is the tolerance for verification\n"); exit(0); } m = atoi(argv[1]); if (argc >= 3) { numTrials = atoi(argv[2]); if (argc >= 4) { alpha = atof(argv[3]); if (argc >= 5) { epsilon = atof(argv[4]); } } } printConfiguration(); elemType* const __restrict A = (elemType*)malloc(m*sizeof(elemType)); elemType* const __restrict B = (elemType*)malloc(m*sizeof(elemType)); elemType* const __restrict C = (elemType*)malloc(m*sizeof(elemType)); initVectors(B, C); double execTime[numTrials]; int trial; for (trial=0; trial<numTrials; trial++) { double startTime = getCurrentTime(); int j; double* __restrict APtr = A; const double* __restrict BPtr = B; const double* __restrict CPtr = C; for (j=0; j<m; j++) { *(APtr++) = *(BPtr++) + alpha * *(CPtr++); } execTime[trial] = getCurrentTime() - startTime; } int validAnswer = verifyResults(A, B, C); printResults(validAnswer, execTime); return 0; }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this); createActions(); createMenus(); initVectors(); initListeners(); muteEvent=false; ClickedClear(); sqlite = new SQLite(); openSet(true); sqlite->startDriver(); }
void W32ColorComboBox::setSelectedColor(ZLColor color) { initVectors(); myIndex = -1; for (std::vector<ZLColor>::const_iterator it = ourColors.begin(); it != ourColors.end(); ++it) { if (*it == color) { myIndex = it - ourColors.begin(); break; } } bool customColorWasNotUsed = !myUseCustomColor; if (myIndex == -1) { myUseCustomColor = true; myCustomColor = color; } if (myUseCustomColor) { ++myIndex; if (customColorWasNotUsed && (myWindow != 0)) { SendMessageA(myWindow, CB_ADDSTRING, 0, (LPARAM)""); } } if (myWindow != 0) { SendMessage(myWindow, CB_SETCURSEL, myIndex, 0); } }