Jump to content
  • Advertisement
Sign in to follow this  
flashinpan

what is this doing: frontBuffer / backBuffer

This topic is 4824 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

TEST For some reason it will not let me post my source code.
...
[Edited by - Tom Knowlton on June 4, 2005 6:23:55 PM]

Share this post


Link to post
Share on other sites
Advertisement
public void DrawPicture()
{
Graphics g = Graphics.FromImage(_frontBuffer);
g.DrawImage(_backBuffer,0,0);

GamePiece gp;

if (_gw != null)
{
if ((_isDragging) && (_draggingBitmapSet))
{
g.DrawImage(_dragBuffer,0,0);
}
else
{
//Draw pieces
for (int col = MIN_COL; col < _boardCellWidth; col++)
{
for (int row = MIN_ROW; row < _boardCellWidth; row++)
{
if ((_isDragging) &&
(_movingPiecePosition.X == col) &&
(_movingPiecePosition.Y == row))
{

continue;
}
//**********************************
// Start drag highlighting
//**********************************

if ((_isDragging)&&(_MoveCostPositions != null))
{
for (int i = 0; i < _MoveCostPositions.Length; i++)
{
if ((_MoveCostPositions != _gw.NoMove)&&
(_MoveCostPositions.X == col)&&
(_MoveCostPositions.Y == row))
{
if (_gw.CanMoveTo(_movingPiecePosition.X,_movingPiecePosition.Y,col,row))
{
ShadeCell(g,col,row);
break;
}
}
}
}

//**********************************
// End drag highlighting
//**********************************
gp = _gw.ReturnGamePieceAtCell(col,row);
if (gp != null)
{
DrawPieceAtCell(g,gp.ImageIndex,col,row);
}
}
}
}
if (_isDragging)
{
if (!_draggingBitmapSet)
{
Graphics gTmp = Graphics.FromImage(_dragBuffer);
gTmp.DrawImage(_frontBuffer,0,0);
gTmp.Dispose();
_draggingBitmapSet = true;
}
gp = _gw.ReturnGamePieceAtCell(_movingPiecePosition.X,_movingPiecePosition.Y);
if(gp != null)
{
g.DrawImage(_iList.Images[gp.ImageIndex],_lastMousePosition.X - _lastOffset.X,_lastMousePosition.Y - _lastOffset.Y);
}
}
}
g.Dispose();
_pBox.Image = _frontBuffer;
}

Share this post


Link to post
Share on other sites
you realise that names with a preceding underscore (like _isDragging) are reserved for the compiler under the c++ standard, right?

Share this post


Link to post
Share on other sites
Quote:
Original post by mrbastard
you realise that names with a preceding underscore (like _isDragging) are reserved for the compiler under the c++ standard, right?


I didn't. So I googled for it and found this:

Quote:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndeepc/html/deep04202000.asp
The rules differ slightly between the two languages. In C90 and C99, the implementation reserves

* any global-scope name beginning with _.
* any name beginning with _ followed by an upper-case letter.
* any name beginning with __.

In C++, the implementation reserves

* any global-scope name beginning with _.
* any name beginning with _ followed by an upper-case letter.
* any name containing __.

(The C++ rules are more restrictive, reserving any name that features double underscores anywhere, not just at the beginning.)


So the TS (and I :)) should be save.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think he is using Java cause he uses "null" and not "NULL".

Share this post


Link to post
Share on other sites
Quote:
Original post by Seraphim
So the TS (and I :)) should be save.


Thanks for correcting me - I didn't know it was that specific.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!