コード例 #1
0
int Game_Shutdown(void *parms,  int num_parms)
{
// this function is where you shutdown your game and
// release all resources that you allocated

// kill the bug blaster
Destroy_BOB(&blaster);

// kill the mushroom maker
for (int index=0; index<4; index++)
    Destroy_Bitmap(&mushrooms[index]);

// kill the playfield bitmap
Destroy_Bitmap(&playfield);

// release joystick
lpdijoy->Unacquire();
lpdijoy->Release();
lpdi->Release();

// shutdonw directdraw
DDraw_Shutdown();

// return success
return(1);
} // end Game_Shutdown
コード例 #2
0
int Game_Shutdown(void *parms,  int num_parms)
{
// this function is where you shutdown your game and
// release all resources that you allocated

// first unacquire the mouse
lpdimouse->Unacquire();

// now release the mouse
lpdimouse->Release();

// release directinput
lpdi->Release();

// unload the bitmap file
Unload_Bitmap_File(&bitmap8bit);

// delete all bobs and bitmaps
Destroy_BOB(&buttons);
Destroy_BOB(&pointer);
Destroy_Bitmap(&cpanel);
Destroy_Bitmap(&canvas);

// shutdonw directdraw
DDraw_Shutdown();

// return success
return(1);
} // end Game_Shutdown
int Game_Shutdown(void *parms)
{
// this function is where you shutdown your game and
// release all resources that you allocated

// shut everything down

// release all your resources created for the game here....

// kill the reactor
Destroy_Bitmap(&reactor);

// kill skelaton
Destroy_BOB(&skelaton);

// now directsound
DSound_Stop_All_Sounds();
DSound_Delete_All_Sounds();
DSound_Shutdown();

// directmusic
DMusic_Delete_All_MIDI();
DMusic_Shutdown();

// shut down directinput
DInput_Shutdown();

// shutdown directdraw last
DDraw_Shutdown();

// return success
return(1);
} // end Game_Shutdown
int Game_Shutdown(void *parms)
{
// this function is where you shutdown your game and
// release all resources that you allocated

// shut everything down

// release all your resources created for the game here....
// kill the bug blaster
Destroy_BOB(&blaster);

// kill the mushroom maker
for (int index=0; index<4; index++)
    Destroy_Bitmap(&mushrooms[index]);

// kill the playfield bitmap
Destroy_Bitmap(&playfield);

// now directsound
DSound_Stop_All_Sounds();
DSound_Delete_All_Sounds();
DSound_Shutdown();

// directmusic
DMusic_Delete_All_MIDI();
DMusic_Shutdown();

// shut down directinput
DInput_Release_Keyboard();
DInput_Release_Joystick();

DInput_Shutdown();

// shutdown directdraw last
DDraw_Shutdown();

// return success
return(1);
} // end Game_Shutdown
コード例 #5
0
int Game_Shutdown(void *parms,  int num_parms)
{
// this function is where you shutdown your game and
// release all resources that you allocated

// kill the reactor
Destroy_Bitmap(&reactor);

// kill skelaton
Destroy_BOB(&skelaton);

// release keyboard
lpdikey->Unacquire();
lpdikey->Release();
lpdi->Release();

// shutdonw directdraw
DDraw_Shutdown();

// return success
return(1);
} // end Game_Shutdown
コード例 #6
0
ファイル: pauls.c プロジェクト: Haixing-Hu/qwViz
/*
 Write the current view to an image file
 Do the right thing for stereo, ie: two images
 The format corresponds to the Write_Bitmap() formats.
 Use a negative format to get the image flipped vertically
 Honour the name if supplied, else do automatic naming
 Don't overwrite existing files if automatic naming is in effect.

 */
int WindowDump(char *name,int width,int height,int stereo,int format)
{
    FILE *fptr;
    static int counter = 0;
    char fname[32],ext[8];
    BITMAP4 *image = NULL;

    /* Allocate our buffer for the image */
    if ((image = Create_Bitmap(width,height)) == NULL) {
        fprintf(stderr,"WindowDump - Failed to allocate memory for image\n");
        return(FALSE);
    }

    glFinish();
    glPixelStorei(GL_PACK_ALIGNMENT,1);

    /* Open the file */
    switch (ABS(format)) {
    case 1:
        strcpy(ext,"tga");
        break;
    case 11:
        strcpy(ext,"tga");
        break;
    case 12:
        strcpy(ext,"tga");
        break;
    case 13:
        strcpy(ext,"tga");
        break;
    case 2:
        strcpy(ext,"ppm");
        break;
    case 3:
        strcpy(ext,"rgb");
        break;
    case 4:
        strcpy(ext,"raw");
        break;
    case 5:
        strcpy(ext,"tif");
        break;
    case 6:
        strcpy(ext,"eps");
        break;
    case 7:
        strcpy(ext,"eps");
        break;
    case 8:
        strcpy(ext,"raw");
        break;
    case 9:
        strcpy(ext,"bmp");
        break;
    }
    if (strlen(name) <= 0) {
        if (stereo)
            sprintf(fname,"L_%04d.%s",counter,ext);
        else
            sprintf(fname,"%04d.%s",counter,ext);
    } else {
        if (stereo)
            sprintf(fname,"L_%s.%s",name,ext);
        else
            sprintf(fname,"%s.%s",name,ext);
    }
    while (strlen(name) <= 0 && (fptr = fopen(fname,"rb")) != NULL) {
        counter++;
        fclose(fptr);
        if (stereo)
            sprintf(fname,"L_%04d.%s",counter,ext);
        else
            sprintf(fname,"%04d.%s",counter,ext);
    }
    if ((fptr = fopen(fname,"wb")) == NULL) {
        fprintf(stderr,"WindowDump - Failed to open file for window dump\n");
        return(FALSE);
    }

    /* Copy the image into our buffer */
    glReadBuffer(GL_BACK_LEFT);
    glReadPixels(0,0,width,height,GL_RGBA,GL_UNSIGNED_BYTE,image);

    /* Write the file */
    Write_Bitmap(fptr,image,width,height,format);
    fclose(fptr);

    if (stereo) {

        /* Open the file */
        if (strlen(name) <= 0) {
            sprintf(fname,"R_%04d.%s",counter,ext);
        } else {
            sprintf(fname,"R_%s.%s",name,ext);
        }
        while (strlen(name) <= 0 && (fptr = fopen(fname,"rb")) != NULL) {
            counter++;
            fclose(fptr);
            sprintf(fname,"R_%04d.%s",counter,ext);
        }
        if ((fptr = fopen(fname,"wb")) == NULL) {
            fprintf(stderr,"WindowDump - Failed to open file for window dump\n");
            return(FALSE);
        }

        /* Copy the image into our buffer */
        glReadBuffer(GL_BACK_RIGHT);
        glReadPixels(0,0,width,height,GL_RGBA,GL_UNSIGNED_BYTE,image);

        /* Write the file */
        Write_Bitmap(fptr,image,width,height,format);
        fclose(fptr);
    }

    Destroy_Bitmap(image);
    counter++;
    return(TRUE);
}