GSDP:GAM100/CProcessing/CP Image Load()

From Inside
Jump to: navigation, search

CP_Image_Load()

Description

Load a CP_Image by inputting the file path of the image file as a string (const char*).

Parameters

CP_Image_Load(const char* filepath)

  • filepath - (const char*) The path to the image file that you want to load.

Example

CP_Image justinFace = NULL;

void init()
{
  justinFace = CP_Image_Load("./Assets/Justins_face.png");
}

void update()
{
  CP_Settings_Background(CP_Color_Create(255, 255, 255, 255));

  int width = CP_System_GetWindowWidth();
  int height = CP_System_GetWindowHeight();

  CP_Image_Draw(justinFace, width / 2, height / 2, width / 2, width / 2, 255);
}

void shutdown()
{
  CP_Image_Free(justinFace);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>