INT main( ) { int cnt = 0; graphic_init( ); //printf( "drawing start\n" ); // graphic_plot_line( 0, 0, 0, 640, 480, 5, 0x01 ); // graphic_plot_line( 0, 0, 480, 640, 0, 5, 0x01 ); graphic_plot_line( 1, 3, 3, 60, 18, 3, 0x01 ); graphic_plot_line( 1, 3, 3, 18, 18, 3, 0x01 ); graphic_plot_line( 1, 18, 18, 3, 33, 3, 0x01 ); graphic_plot_line( 1, 3, 33, 60, 18, 3, 0x01 ); graphic_move_direct( 1, 290, 380 ); graphic_update_screen( ); //printf( "drawing end\n" ); while( TRUE ) { graphic_update_screen( ); } return 0; }
int brain_run_x(t_brain *brain) { t_graphic *graphic; int winner_no; if (brain == NULL) return (RET_ERROR); if ((graphic = graphic_new()) == NULL || graphic_init(graphic, brain->programs) == RET_FAILURE) return (RET_ERROR); brain->ram->hook_set = &graphic_handler_ram_set; brain->game->hook_winner = &graphic_handler_winner; brain->game->hook_cycles = &graphic_handler_cycles; brain->cpu->hook_process = &graphic_handler_process; brain->game->hook_cycles_to_die = &graphic_handler_cycles_to_die; graphic_init_handlers(graphic); graphic_handler_process(NULL, brain->game->players_nbr); graphic_handler_cycles_to_die(NULL, brain->game->cycles_to_die); if ((brain_put_programs(brain)) == RET_FAILURE) return (RET_ERROR); if ((winner_no = brain_run_x_loop(brain)) == RET_ERROR) return (RET_ERROR); graphic_free(graphic); return (winner_no); }
void game_setup(void) { pspDebugScreenInit(); setupCallbacks(); graphic_init(); sound_thid = sceKernelCreateThread("mp3_decoderThread", mp3_decoderThread, 31, STACK_SIZE, 0, 0); if (sound_thid >= 0) { sceKernelStartThread(sound_thid, 0, NULL); printf("Started mp3_decoderThread\n"); } else { printf("Failed to create mp3_decoderThread\n"); } initializeAudio(); }
int main(void) { if (!graphic_init()) return (-1); do { glClearColor(0.0f, 0.0f, 0.4f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); glfwSwapBuffers(window); glfwPollEvents(); // entity->increaseRotation(.1, .005, 0); // entity->increasePosition(.005, .001, -.01); // check_opengl_error(); } // Check if the ESC key was pressed or the window was closed while( glfwGetKey(window, GLFW_KEY_ESCAPE ) != GLFW_PRESS && glfwWindowShouldClose(window) == 0 ); return (0); }