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,0,0,0,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0 }; int t[9][22]={ 0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0, 0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0, 1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1, 1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1, 0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0, 0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0, 0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0, 0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0, 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0 }; typedef int (*ArrType)[MCOL]; fprintf(stdout, "\n\n"); show2(f, 9, 36, stdout); fprintf(stdout, "\n\n"); show2(s, 9, 21, stdout); fprintf(stdout, "\n\n"); show2(t, 9, 22, stdout); fprintf(stdout, "\n\n"); }
void main(){ // variable initialization char str[] = "Worldcup Winner ?"; int offset = 0; /* pstr에 str을 전달, pstr을 출력 printf(pstr )-> Winner ? */ char *pstr = str + 9; printf("%s\n", pstr); int i = 0; while (true){ if (pstr[i]=='\0'){ break; } printf("%c", pstr[i]); i++; } printf("\n"); // 함수화 하기 show(pstr, offset); show2(pstr, offset); }
void showNumber(uint8_t number) { if(number == 0) { show0(); } else if(number == 1) { show1(); } else if(number == 2) { show2(); } else if(number == 3) { show3(); } else if(number == 4) { show4(); } else if(number == 5) { show5(); } else if(number == 6) { show6(); } else if(number == 7) { show7(); } else if(number == 8) { show8(); } else if(number == 9) { show9(); } }
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { camera.updateCameraVectors(); camera.ProcessMouseScroll(yoffset * 3); show2(xoffset); show2(yoffset); //camera. show2(camera.Zoom); //show2(camera.GetViewMatrix()[0]); //show2(camera.GetViewMatrix()[1]); //show2(camera.GetViewMatrix()[2]); //show2(camera.GetViewMatrix()[3]); //show2(camera.Pitch); //show2(camera.Right); }
int MessageDialog::show(const Common::String &message, const Common::String &btn1Message, const Common::String &btn2Message) { // Ensure that the cursor is the arrow g_globals->_events.setCursor(CURSOR_ARROW); int result = show2(message, btn1Message, btn2Message); g_globals->_events.setCursorFromFlag(); return result; }
void Segment::display(int number) { this->offAll(); switch(number) { case 0: show0(); // delay(500); break; case 1: show1(); // delay(500); break; case 2: show2(); // delay(500); break; case 3: show3(); // delay(500); break; case 4: show4(); // delay(500); break; case 5: show5(); // delay(500); break; case 6: show6(); // delay(500); break; case 7: show7(); // delay(500); break; case 8: show8(); // delay(500); break; case 9: show9(); // delay(500); break; default: showE(); // delay(500); break; } }
static void test1() { show1(""); show2(""); }
void show(uint8_t i) { show1(digit % 10); show2(digit / 10 % 10); }
int main() { printf("Example of calling fftw++ convolutions from C:\n"); unsigned int nthreads=2; unsigned int M=2; /* dimension of dot product */ double overM=1.0/(double) M; double complex *pf[M]; double complex *pg[M]; int returnflag=0; set_fftwpp_maxthreads(nthreads); { printf("Complex, non-centered 1D example:\n"); unsigned int nx = 8; /* ImplicitConvolution *cconv=fftwpp_create_conv1d(m); */ ImplicitConvolution *cconv = fftwpp_create_conv1d(nx); double complex *f = create_complexAlign(nx); double complex *g = create_complexAlign(nx); init(f, g, nx); /* set the input data */ printf("Input f:\n"); show(f, nx); printf("Input g:\n"); show(g, nx); fftwpp_conv1d_convolve(cconv, f, g); //fftwpp_conv1d_correlate(cconv, f, g); printf("Output f:\n"); show(f, nx); delete_complexAlign(g); delete_complexAlign(f); fftwpp_conv1d_delete(cconv); printf("\n"); } { printf("Complex, Hermitian-symmetric, centered 1D example:\n"); unsigned int nx = 8; ImplicitHConvolution *hconv = fftwpp_create_hconv1d(nx); double complex *f = create_complexAlign(nx); double complex *g = create_complexAlign(nx); init(f, g, nx); /* set the input data */ printf("Input f:\n"); show(f, nx); printf("Input g:\n"); show(g, nx); fftwpp_hconv1d_convolve(hconv, f, g); printf("Output f:\n"); show(f, nx); delete_complexAlign(g); delete_complexAlign(f); fftwpp_hconv1d_delete(hconv); printf("\n"); } { printf("Complex, non-centered 2D example:\n"); unsigned int nx = 4; unsigned int ny = 4; ImplicitConvolution2 *cconv2 = fftwpp_create_conv2d(nx, ny ); double complex *f = create_complexAlign(nx * ny); double complex *g = create_complexAlign(nx * ny); init2(f, g, nx, ny); /* set the input data */ printf("Input f:\n"); show2(f, nx, ny); printf("Input g:\n"); show2(g, nx, ny); fftwpp_conv2d_convolve(cconv2, f, g); printf("Output f:\n"); show2(f, nx, ny); delete_complexAlign(g); delete_complexAlign(f); fftwpp_conv2d_delete(cconv2); printf("\n"); } { printf("Complex, Hermitian-symmertic, centered 2D example:\n"); unsigned int nx = 4; unsigned int ny = 4; ImplicitHConvolution2 *hconv2 = fftwpp_create_hconv2d(nx, ny ); unsigned int nxp = 2 * nx - 1; double complex *f = create_complexAlign(nxp * ny); double complex *g = create_complexAlign(nxp * ny); init2(f, g, nxp, ny); /* set the input data */ printf("Input f:\n"); show2(f, nxp, ny); printf("Input g:\n"); show2(g, nxp, ny); fftwpp_hconv2d_convolve(hconv2, f, g); printf("Output f:\n"); show2(f, nxp, ny); delete_complexAlign(g); delete_complexAlign(f); fftwpp_hconv2d_delete(hconv2); printf("\n"); } { printf("Complex, non-centered 3D example:\n"); unsigned int nx = 4; unsigned int ny = 4; unsigned int nz = 4; ImplicitConvolution3 *cconv3 = fftwpp_create_conv3d(nx, ny, nz); double complex *f = create_complexAlign(nx * ny * nz); double complex *g = create_complexAlign(nx * ny * nz); init3(f, g, nx, ny, nz); /* set the input data */ printf("Input f:\n"); show3(f, nx, ny, nz); printf("Input g:\n"); show3(g, nx, ny, nz); fftwpp_conv3d_convolve(cconv3, f, g); printf("Output f:\n"); show3(f, nx, ny, nz); delete_complexAlign(g); delete_complexAlign(f); fftwpp_conv3d_delete(cconv3); printf("\n"); } { printf("Complex, non-centered 3D example:\n"); unsigned int nx = 4; unsigned int ny = 4; unsigned int nz = 4; ImplicitConvolution3 *cconv3 = fftwpp_create_conv3d(nx, ny, nz); double complex *f = create_complexAlign(nx * ny * nz); double complex *g = create_complexAlign(nx * ny * nz); init3(f, g, nx, ny, nz); /* set the input data */ printf("Input f:\n"); show3(f, nx, ny, nz); printf("Input g:\n"); show3(g, nx, ny, nz); fftwpp_conv3d_convolve(cconv3, f, g); printf("Output f:\n"); show3(f, nx, ny, nz); delete_complexAlign(g); delete_complexAlign(f); fftwpp_conv3d_delete(cconv3); printf("\n"); } { printf("Complex, Hermitian-symmetric, centered 3D example:\n"); unsigned int nx = 4; unsigned int ny = 4; unsigned int nz = 4; ImplicitHConvolution3 *hconv3 = fftwpp_create_hconv3d(nx, ny, nz); unsigned int nxp = 2 * nx - 1; unsigned int nyp = 2 * ny - 1; double complex *f = create_complexAlign(nxp * nyp * nz); double complex *g = create_complexAlign(nxp * nyp * nz); init3(f, g, nxp, nyp, nz); /* set the input data */ printf("Input f:\n"); show3(f, nxp, nyp, nz); printf("Input g:\n"); show3(g, nxp, nyp, nz); fftwpp_hconv3d_convolve(hconv3, f, g); printf("Output f:\n"); show3(f, nxp, nyp, nz); delete_complexAlign(g); delete_complexAlign(f); fftwpp_hconv3d_delete(hconv3); printf("\n"); } }
/** * Show the game field */ void mostrac(listP mao1,listP pl11,listP pl12,listP pl13,listP pl14,listP mao2,listP pl21,listP pl22,listP pl23,listP pl24,int* pc1,int* pc2,int* pc3,int* stock1,int* stock2,int turno) { int n=0; mvprintw(0,0,"+--------------------------------------------------------+"); mvprintw(0,3,"|Turno: %d|",turno); mvprintw(1,0,"|Jogador 1"); mvprintw(1,57,"|"); mvprintw(2,0,"|(1-5)Mao: ["); if(turno==1) { show2(mao1); } else { mvprintw(2,12,"~ ~ ~ ~ ~"); }; mvprintw(2,57,"|"); mvprintw(2,28,"]"); mvprintw(3,0,"|(10) Stock["); while ((stock1[n]==0) && (n<stk)) { n++; }; if (stock1[n] == 0) { mvprintw(3,12,"X]"); } else { if(stock1[n] == 11) mvprintw(3,12,"V]"); if(stock1[n] == 12) mvprintw(3,12,"D]"); if(stock1[n] == 13) mvprintw(3,12,"R]"); if(stock1[n] <11) mvprintw(3,12,"%d]",stock1[n]); }; mvprintw(3,57,"|"); mvprintw(4,0,"| (6)P.l.1 [");show2(pl11);mvprintw(4,57,"|"); mvprintw(5,0,"| (7)P.l.2 [");show2(pl12);mvprintw(5,57,"|"); mvprintw(6,0,"| (8)P.l.3 [");show2(pl13);mvprintw(6,57,"|"); mvprintw(7,0,"| (9)P.l.4 [");show2(pl14);mvprintw(7,57,"|"); mvprintw(8,0,"+--------------------------------------------------------+"); mvprintw(9,3,"(d1)P.c.1 [");showA(13,pc1); mvprintw(10,3,"(d2)P.c.2 [");showA(13,pc2); mvprintw(11,3,"(d3)P.c.3 [");showA(13,pc3); mvprintw(12,0,"+--------------------------------------------------------+"); mvprintw(13,0,"| (9)P.l.4 [");show2(pl24);mvprintw(13,57,"|"); mvprintw(14,0,"| (8)P.l.3 [");show2(pl23);mvprintw(14,57,"|"); mvprintw(15,0,"| (7)P.l.2 [");show2(pl22);mvprintw(15,57,"|"); mvprintw(16,0,"| (6)P.l.1 [");show2(pl21);mvprintw(16,57,"|"); n=0; mvprintw(17,0,"|(10) Stock["); while ((stock2[n]==0) && (n<stk)) { n++; }; if (stock2[n] == 0) { mvprintw(17,12,"X]"); } else { if(stock2[n] == 11) mvprintw(17,12,"V]"); if(stock2[n] == 12) mvprintw(17,12,"D]"); if(stock2[n] == 13) mvprintw(17,12,"R]"); if((stock2[n] != 11) &&(stock2[n] != 12)&&(stock2[n] != 13)) mvprintw(17,12,"%d]",stock2[n]); }; mvprintw(17,57,"|"); mvprintw(18,0,"|(1-5)Mao: ["); if(turno==2) { show2(mao2); } else { mvprintw(18,12,"~ ~ ~ ~ ~"); }; mvprintw(18,57,"|"); mvprintw(18,28,"]"); mvprintw(19,0,"|Jogador 2");mvprintw(19,57,"|"); mvprintw(20,0,"+--------------------------------------------------------+"); }
int main() { inits(); Shader text_shader("text.vs", "text.frag"); Shader ourShader("coordinate_systems.vs", "coordinate_systems.frag"); Shader bar_shader("bar.vs", "bar.frag"); inittext(text_shader); initbar(bar_shader); // Set up our vertex data (and buffer(s)) and attribute pointers msg(sizeof(vertices_indexed)); msg(sizeof(indices)); msg(sizeof(vertices)); #ifdef use_indexed makeglgeom_indexed(VBO_indexed, VAO_indexed, EBO_indexed, vertices_indexed, indices, sizeof(vertices_indexed), sizeof(indices)); #else makeglgeom(VBO, VAO, vertices, sizeof(vertices)); #endif // Load and create a texture makegltext(texture1, "resources/textures/container.jpg"); makegltext(texture2, "resources/textures/awesomeface.png"); GLint modelLoc = glGetUniformLocation(ourShader.Program, "model"); GLint viewLoc = glGetUniformLocation(ourShader.Program, "view"); GLint projLoc = glGetUniformLocation(ourShader.Program, "projection"); // Game loop while (!glfwWindowShouldClose(window)) { // Set frame time GLfloat currentFrame = glfwGetTime(); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; #ifdef RAWMOUSE acc += updatemouse(); #endif //vec2 diff = mouse - acc; //log //mousepos += acc; lag = lag_coeff*acc; //lag = lag_coeff*vec2(log(abs(acc.x)), log(abs(acc.y))); //if (acc.x < 0)lag.x *= -1.0f; //if (acc.y < 0)lag.y *= -1.0f; if (abs(lag.x) < 1e-4) lag.x = 0; if (abs(lag.y) < 1e-4) lag.y = 0; acc -= lag; camera.ProcessMouseMovement(lag.x, lag.y); show2(mouse); show2(lag); show2(acc); //show2(string(int(0.1f*length(acc)), '=')); //show2(string(int(10.f*length(lag)), '=')); // Check and call events ####################################### glfwPollEvents(); Do_Movement(); // Clear the colorbuffer glClearColor(0.2f, 0.2f, 0.2f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // texts ####################### int line = 0; for (auto&a : texts) { RenderText(text_shader, a.first + " " + a.second, 25.0f, (line + 1)*25.0f, 0.3f, glm::vec3(1, 1, 1)); ++line; } //RenderText(text_shader, "(C) LearnOpenGL.com", 540.0f, 570.0f, 0.5f, glm::vec3(0.3, 0.7f, 0.9f)); drawbar(bar_shader); // Draw our first triangle ####################### ourShader.Use(); // Bind Textures using texture units ####################### glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture1); glUniform1i(glGetUniformLocation(ourShader.Program, "ourTexture1"), 0); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, texture2); glUniform1i(glGetUniformLocation(ourShader.Program, "ourTexture2"), 1); // Create camera transformation ####################### glm::mat4 view; view = camera.GetViewMatrix(); glm::mat4 projection; projection = glm::perspective(glm::radians(camera.Zoom), (float)screenWidth / (float)screenHeight, 0.1f, 1000.0f); // Get the uniform locations // Pass the matrices to the shader glUniformMatrix4fv(viewLoc, 1, GL_FALSE, glm::value_ptr(view)); glUniformMatrix4fv(projLoc, 1, GL_FALSE, glm::value_ptr(projection)); #ifdef use_indexed glBindVertexArray(VAO_indexed); #else glBindVertexArray(VAO); #endif for (GLuint i = 0; i < 10; i++) { // Calculate the model matrix for each object and pass it to shader before drawing glm::mat4 model; model = glm::translate(model, cubePositions[i]); GLfloat angle = 20.0f * i; model = glm::rotate(model, angle, glm::vec3(1.0f, 0.3f, 0.5f)); glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model)); #ifdef use_indexed glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_INT, 0); #else glDrawArrays(GL_TRIANGLES, 0, 36); #endif } glBindVertexArray(0); // Swap the buffers glfwSwapBuffers(window); } // Properly de-allocate all resources once they've outlived their purpose glDeleteVertexArrays(1, &VAO); glDeleteBuffers(1, &VBO); glfwTerminate(); ManyMouse_Quit(); return 0; }