what is this doing: frontBuffer / backBuffer

Started by
10 comments, last by deadimp 18 years, 10 months ago
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]
Advertisement
Anyone else see an empty post?

ace
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;
}
you realise that names with a preceding underscore (like _isDragging) are reserved for the compiler under the c++ standard, right?
[size="1"]
Are you using the source tags?
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.
I think he is using Java cause he uses "null" and not "NULL".
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.

[size="1"]

This topic is closed to new replies.

Advertisement