Sprite draw code

smilytics

Sprite draw code

sample


Code

#include <EntryPoint.h>

static void UpdateFunc(void);

wzTexture g_gazou1;    //image

int Initialize()
{   //!App initialize Process
    wzInitCreateWizapply("wizapply",320,480,0);
    wzSetClearColor(0.1f,0.1f,0.1f);
    wzSetSpriteScSize(320, 480);

    //file path to correspond to the various platforms that give shDCP.
    //For Windows "./contents" folder into the image.
    if(wzCreateTextureFromPNG(&g_gazou1, wzDCP("gazou1.png"))) {
        printf("Failed to load the image.\n");
        return 1;
    }

    wzSetUpdateThread(60,UpdateFunc);

    return 0;
}

int Terminate()
{   //!App exit process
    wzDeleteTexture(&g_gazou1);
    wzExitWizapply();
    return 0;
}

void DrawLoop(void)
{   //!Draw
    wzClear();

    wzSetSpritePosition(320.0f,240.0f,0.1f);
    wzSetSpriteTexCoord(0.0f,0.0f,1.0f,1.0f);
    wzSetSpriteSize(256.0f,256.0f);
    wzSetSpriteTexture(&g_gazou1);
    wzSpriteDraw();
}

void UpdateFunc(void)
{   //!Update

}

MongoDB Logo MongoDB