d3dconsolerenderingcontext.cpp

来自「java实现的简单的分形树。简单易学!是学习分形知识的很好的例子。其java语法」· C++ 代码 · 共 37 行

CPP
37
字号
// --------------------------------------------------------------------------
// Dingus project - a collection of subsystems for game/graphics applications
// --------------------------------------------------------------------------
#include "stdafx.h"

#include "../dxutils/D3DFont.h"

#include "D3DConsoleRenderingContext.h"
#include "../kernel/D3DDevice.h"

using namespace dingus;

//---------------------------------------------------------------------------
// CD3DTextBoxConsoleRenderingContext
//---------------------------------------------------------------------------

CD3DTextBoxConsoleRenderingContext::CD3DTextBoxConsoleRenderingContext( CD3DFont& font, int x, int y, D3DCOLOR color1, D3DCOLOR color2 )
:	mFont( font ),
	mX( x ),
	mY( y ),
	mColor1( color1 ), mColor2( color2 )
{
}

void CD3DTextBoxConsoleRenderingContext::write( const std::string& message )
{
	mBuffer += message;
}

void CD3DTextBoxConsoleRenderingContext::flush()
{
	mFont.drawText( (float)mX+1, (float)mY+1, mColor2, (char*)mBuffer.c_str() );
	mFont.drawText( (float)mX, (float)mY, mColor1, (char*)mBuffer.c_str() );
	mBuffer.erase();
	CD3DDevice::getInstance().resetCachedState();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?