Results 1 to 3 of 3

Thread: Drawing the playfield

  1. #1

    Drawing the playfield

    For a small game, I've a simple grid as playfield, so basically a matrix of 2D tiles. (think minesweeper here, though actually it is chainreaction)

    What is the easiest way of rendering this playfield in a portable way using the LCL (so no GL/D3D)

    I assume something with blitting/copying the tiles to a timage, and then refreshing the image?

    What is the portable function to copy an image onto another?

  2. #2

    Re: Drawing the playfield

    Quote Originally Posted by marcov
    For a small game, I've a simple grid as playfield, so basically a matrix of 2D tiles. (think minesweeper here, though actually it is chainreaction)

    What is the easiest way of rendering this playfield in a portable way using the LCL (so no GL/D3D)

    I assume something with blitting/copying the tiles to a timage, and then refreshing the image?

    What is the portable function to copy an image onto another?
    How does using the LCL stop you from using D3D or OpenGL? Anyways you can use the TPainbox inside of Lazarus just like you would in Delphi. Make sure that you set the component style to Opaque and that you double buffer the drawing stuff. Other then that its fairly simple, itterate your "Playing Field", draw it to the back buffer, and on the next refresh of the paintbox set the paintboxes canvas pointer to your backbuffer pointer (also remember to set the old pointer to the backbuffer).

    If you look at my website I have a sample for Delphi, their is also a version of FPC if I can find it some place

  3. #3

    Re: Drawing the playfield

    How does using the LCL stop you from using D3D or OpenGL?
    Not, but the fact that they are LCL demoes might :-)

    If you look at my website I have a sample for Delphi, their is also a version of FPC if I can find it some place
    Delphi is also good. While I'm not so into graphics, I still know my way in FPC/Delphi :-)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •