當前位置: 首頁>>代碼示例>>C++>>正文


C++ ClearBuffer函數代碼示例

本文整理匯總了C++中ClearBuffer函數的典型用法代碼示例。如果您正苦於以下問題:C++ ClearBuffer函數的具體用法?C++ ClearBuffer怎麽用?C++ ClearBuffer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ClearBuffer函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: ClearBuffer

void
StencilMapCanvas::Begin()
{
  if (!buffer_drawn) {
    ClearBuffer();
    buffer_drawn = true;
  }
}
開發者ID:Advi42,項目名稱:XCSoar,代碼行數:8,代碼來源:StencilMapCanvas.cpp

示例2: ClearBuffer

bool CFile::Truncate() {
	if (m_iFD != -1 && ftruncate(m_iFD, 0) == 0) {
		ClearBuffer();
		return true;
	}

	return false;
}
開發者ID:BGCX261,項目名稱:znc-msvc-svn-to-git,代碼行數:8,代碼來源:FileUtils.cpp

示例3: ClearBuffer

void
MapDrawHelper::BufferRenderStart()
{
    if (!buffer_drawn) {
        ClearBuffer();
        buffer_drawn = true;
    }
}
開發者ID:damianob,項目名稱:xcsoar,代碼行數:8,代碼來源:MapDrawHelper.cpp

示例4: glEnable

	void TGBufferCanvas::Enable()
	{
		glEnable(GL_DEPTH_TEST);
 		BindFrameBuffer(m_frameBuffer);
 		glPushAttrib(GL_VIEWPORT_BIT | GL_ENABLE_BIT);
 		ClearBuffer();
		GLenum buffers[] = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_COLOR_ATTACHMENT2_EXT ,GL_COLOR_ATTACHMENT3_EXT};
    	glDrawBuffers(4, buffers);
	}
開發者ID:dreamsxin,項目名稱:Donut,代碼行數:9,代碼來源:gbuffercanvas.cpp

示例5: ClearBuffer

SERIALISATION_INLINE void StreamWriter::Close()
{
    ClearBuffer();

    if (mFileStream.is_open())
    {
        mFileStream.close();
    }
}
開發者ID:Zefiros-Software,項目名稱:SerLib,代碼行數:9,代碼來源:streamWriter.cpp

示例6: StopTransfer

CloHttpCurl::~CloHttpCurl(void)
{
	StopTransfer();
	ClearBuffer();
	ClearParam();

	delete m_pAssoc;
	m_pAssoc = NULL;
}
開發者ID:skyui-cdel,項目名稱:MyFirstGit,代碼行數:9,代碼來源:loHttpCurl.cpp

示例7: m_bEnabled

 ////////////////////////////////////////////////
 //
 // CStatEvents::CStatEvents
 //
 //
 //
 ////////////////////////////////////////////////
 CStatEvents::CStatEvents ( void )
     : m_bEnabled ( false )
     , m_ItemBuffer ( 0 )
     , m_BufferPos ( 0 )
     , m_BufferPosMax ( 0 )
     , m_BufferPosMaxUsing ( 0 )
 {
     ClearBuffer ( true );
 }
開發者ID:EagleShen,項目名稱:MTA,代碼行數:16,代碼來源:SharedUtil.Profiling.hpp

示例8: BiquadFilterInit

/*******************************************************************************
 BiquadFilterInit */
BiquadFilter*
BiquadFilterInit(const float *bCoeff, const float *aCoeff)
{

    // Allocate Memory
    BiquadFilter* filter = (BiquadFilter*)malloc(sizeof(BiquadFilter));

    if (filter)
    {
        // Initialize Buffers
        CopyBuffer(filter->b, bCoeff, 3);
        CopyBuffer(filter->a, aCoeff, 2);

        ClearBuffer(filter->x, 2);
        ClearBuffer(filter->y, 2);
        ClearBuffer(filter->w, 2);
    }
    return filter;
}
開發者ID:liufeigit,項目名稱:FxDSP,代碼行數:21,代碼來源:BiquadFilter.c

示例9: ClearBuffer

void CBuffer::Copy(CBuffer& buffer)
{
	int nReSize = buffer.GetMemSize();   //2048               2048
	int nSize = buffer.GetBufferLen();   //1025               0     1025
	ClearBuffer();
	if (ReAllocateBuffer(nReSize) == -1)
		return;
	CopyMemory(m_pBase,buffer.GetBuffer(),buffer.GetBufferLen());
	m_pPtr = m_pBase + nSize;
}
開發者ID:26597925,項目名稱:Remote,代碼行數:10,代碼來源:Buffer.cpp

示例10: DEBUG

void CFile::Close() {
	if (m_iFD >= 0) {
		if (close(m_iFD) < 0) {
			DEBUG("CFile::Close(): close() failed with ["
					<< strerror(errno) << "]");
		}
	}
	m_iFD = -1;
	ClearBuffer();
}
開發者ID:BGCX261,項目名稱:znc-msvc-svn-to-git,代碼行數:10,代碼來源:FileUtils.cpp

示例11: ZeroMemory

HRESULT CMpcAudioRenderer::CreateDSBuffer()
{
	if (! m_pWaveFileFormat) return E_POINTER;

	HRESULT					hr				= S_OK;
	LPDIRECTSOUNDBUFFER		pDSBPrimary		= NULL;
	DSBUFFERDESC			dsbd;
	DSBUFFERDESC			cDSBufferDesc;
	DSBCAPS					bufferCaps;
	DWORD					dwDSBufSize		= m_pWaveFileFormat->nAvgBytesPerSec * 4;

	ZeroMemory(&bufferCaps, sizeof(bufferCaps));
	ZeroMemory(&dsbd, sizeof(DSBUFFERDESC));

	dsbd.dwSize        = sizeof(DSBUFFERDESC);
	dsbd.dwFlags       = DSBCAPS_PRIMARYBUFFER;
	dsbd.dwBufferBytes = 0;
	dsbd.lpwfxFormat   = NULL;
	if (SUCCEEDED (hr = m_pDS->CreateSoundBuffer( &dsbd, &pDSBPrimary, NULL )))
	{
		hr = pDSBPrimary->SetFormat(m_pWaveFileFormat);
		ATLASSERT(SUCCEEDED(hr));
		SAFE_RELEASE (pDSBPrimary);
	}


	SAFE_RELEASE (m_pDSBuffer);
	cDSBufferDesc.dwSize			= sizeof (DSBUFFERDESC);
	cDSBufferDesc.dwFlags			= DSBCAPS_GLOBALFOCUS			| 
									  DSBCAPS_GETCURRENTPOSITION2	| 
									  DSBCAPS_CTRLVOLUME 			|
									  DSBCAPS_CTRLPAN				|
									  DSBCAPS_CTRLFREQUENCY; 
	cDSBufferDesc.dwBufferBytes		= dwDSBufSize; 
	cDSBufferDesc.dwReserved		= 0; 
	cDSBufferDesc.lpwfxFormat		= m_pWaveFileFormat; 
   	cDSBufferDesc.guid3DAlgorithm	= GUID_NULL; 

	hr = m_pDS->CreateSoundBuffer (&cDSBufferDesc,  &m_pDSBuffer, NULL);

	m_nDSBufSize = 0;
	if (SUCCEEDED(hr))
	{
		bufferCaps.dwSize = sizeof(bufferCaps);
		hr = m_pDSBuffer->GetCaps(&bufferCaps);
	}
	if (SUCCEEDED (hr))
	{
		m_nDSBufSize = bufferCaps.dwBufferBytes;
		hr = ClearBuffer();
		m_pDSBuffer->SetFrequency ((long)(m_pWaveFileFormat->nSamplesPerSec * m_dRate));
	}

	return hr;
}
開發者ID:Fluffiest,項目名稱:splayer,代碼行數:55,代碼來源:MpcAudioRenderer.cpp

示例12: ReadTagName

 void ReadTagName(char c)
 {
     if (IsWhitespace(c))
     {
         if (buffer == "a")
             state = State::ReadTag;
         else if (buffer == "!--")
             state = State::SkipComment;
         else
             state = State::SkipTag;
         ClearBuffer();
     }
     else if (c == '>')
     {
         state = State::Default;
         ClearBuffer();
     }
     else
         StoreToLower(c);
 }
開發者ID:hansmaad,項目名稱:Chase,代碼行數:20,代碼來源:HtmlSearch.cpp

示例13: NO_DEBUG

void NoFile::Close()
{
    if (m_fd >= 0) {
        if (close(m_fd) < 0) {
            m_hadError = true;
            NO_DEBUG("NoFile::Close(): close() failed with [" << strerror(errno) << "]");
        }
    }
    m_fd = -1;
    ClearBuffer();
}
開發者ID:Kriechi,項目名稱:nobnc,代碼行數:11,代碼來源:nofile.cpp

示例14: SaveReleaseDevice

bool Mouse::SetCoopLevel(HWND hWnd)
{
	HRESULT result = _dDevice->SetCooperativeLevel(hWnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND);
	if (FAILED(result))
	{
		SaveReleaseDevice();
		return false;
	}
	ClearBuffer();
	return true;
}
開發者ID:dbrekelmans,項目名稱:game-engine,代碼行數:11,代碼來源:Mouse.cpp

示例15: ClearBuffer

////////////////////////////////////////////////////////////////////////////////
// 
// FUNCTION:	Copy
// 
// DESCRIPTION:	Copy from one buffer object to another...
// 
// RETURNS:	
// 
// NOTES:	
// 
// MODIFICATIONS:
// 
// Name				Date		Version		Comments
// N T ALMOND       270400		1.0			Origin
// 
////////////////////////////////////////////////////////////////////////////////
void CBuffer::Copy(CBuffer& buffer)
{
	int nReSize = buffer.GetMemSize();
	int nSize = buffer.GetBufferLen();
	ClearBuffer();
	ReAllocateBuffer(nReSize);

	m_pPtr = m_pBase + nSize;

	CopyMemory(m_pBase,buffer.GetBuffer(),buffer.GetBufferLen());
}
開發者ID:asdlei00,項目名稱:icmp_shell,代碼行數:27,代碼來源:Buffer.cpp


注:本文中的ClearBuffer函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。