Welcome, Guest. Please login or register.

Author Topic: Pixel isn't drawn  (Read 2020 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show all replies
Re: Pixel isn't drawn
« on: October 25, 2010, 04:09:41 PM »
Your problem is as Thomas describes. You are setting your pen and drawing your pixel after your main event loop has finished. Assuming your window closes after the main loop function returns, you probably don't even get a chance to see it rendered.

Move this:

    /* set the pen color to blue */
    SetAPen(GameWindow->RPort, blue);
 
    /* Draw the ball */
    WritePixel(GameWindow->RPort, 100, 100);

before the IDCMP event handling loop (more specifically, before the Wait() call on the IDCMO port).
« Last Edit: October 25, 2010, 04:14:28 PM by Karlos »
int p; // A