Please Login First
×
Create a new article
Write your page title here:
We currently have 315 articles on Inside. Type your article name above or click on one of the titles below and start writing!



    Inside

    GSDP:GAM100/CProcessing/CP main

    CP_main

    Description

    A special version of main() used by CProcessing. You will write it like you would any main function. From CP_Main you will set your first game state and call Run() to start the CProcessing engine.

    Example Usage

    void init(void)
    {
      /* Set the size of the window */
      size(500, 500);
    }
    
    void update(void)
    {
      /* Set the background color to black every frame */
      background(color(0, 0, 0, 255));
    
      /* Draw a rectangle at the mouse position */
      rect(mouseX, mouseY, 50, 50);
    }
    
    CP_main
    {
      // Set the initial game state
      SetNextGameState(init, update, NULL);
    
      // Run the program
      Run();    
    }
    

    See Also