Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char** argv) {
- srand(OSTimeGet());
- if (!video_init()) return ref; // something went wrong while initializing video..shut the program down!
- control_init(); // initialize controls (Button IO)
- sound_init(22050, 16, 2, 20); // Initialize sound, parameters are : frequency, bits, channels, volume
- gameFont = loadtex(hifFont);
- gameLogo = loadtex(logo);
- gameBg = loadtex(bg);
- playogg(oggMusic, oggMusicSize);
- //to pause use pauseogg(true); (use false if you want to unpause it)
- int bg_x=0;
- while (1)
- {
- gfx_tex_draw(bg_x,0,gameBg);
- gfx_tex_draw(bg_x-320,0,gameBg);
- bg_x=(bg_x + 1) % 320;
- gfx_tex_draw_trans(0,0,gameLogo);
- gfx_font_print_center_ex(190, 200, 0, gameFont, "See? Text!!");
- if (control_check(CONTROL_BUTTON_START).pressed) {break;} // press start to quit
- if (!updategoo()) {break;} // if something is wrong, QUIT!
- }
- unloadGame(); // function to unload all textures loaded, and delete all memory allocations
- killgoo(); //this has to be done, kills sound if it was initialized, video and controls
- return ref;
- }
Add Comment
Please, Sign In to add comment