Guest User

Untitled

a guest
Jul 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. int main(int argc, char** argv) {
  2.  
  3.  
  4. srand(OSTimeGet());
  5.  
  6. if (!video_init()) return ref; // something went wrong while initializing video..shut the program down!
  7.  
  8. control_init(); // initialize controls (Button IO)
  9. sound_init(22050, 16, 2, 20); // Initialize sound, parameters are : frequency, bits, channels, volume
  10. gameFont = loadtex(hifFont);
  11. gameLogo = loadtex(logo);
  12. gameBg = loadtex(bg);
  13.  
  14. playogg(oggMusic, oggMusicSize);
  15. //to pause use pauseogg(true); (use false if you want to unpause it)
  16.  
  17. int bg_x=0;
  18. while (1)
  19. {
  20.  
  21.  
  22. gfx_tex_draw(bg_x,0,gameBg);
  23. gfx_tex_draw(bg_x-320,0,gameBg);
  24. bg_x=(bg_x + 1) % 320;
  25. gfx_tex_draw_trans(0,0,gameLogo);
  26. gfx_font_print_center_ex(190, 200, 0, gameFont, "See? Text!!");
  27.  
  28.  
  29.  
  30.  
  31. if (control_check(CONTROL_BUTTON_START).pressed) {break;} // press start to quit
  32. if (!updategoo()) {break;} // if something is wrong, QUIT!
  33. }
  34.  
  35. unloadGame(); // function to unload all textures loaded, and delete all memory allocations
  36. killgoo(); //this has to be done, kills sound if it was initialized, video and controls
  37.  
  38. return ref;
  39. }
Add Comment
Please, Sign In to add comment