• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ InitializeBuffers函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中InitializeBuffers函数的典型用法代码示例。如果您正苦于以下问题:C++ InitializeBuffers函数的具体用法?C++ InitializeBuffers怎么用?C++ InitializeBuffers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了InitializeBuffers函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: InitializeBuffers

bool Rectangle2DClass::Initialize(ID3D11Device * device, ID3D11DeviceContext* context, int screenWidth, int screenHeight, int bitmapWidth, int bitmapHeight)
{
	HRESULT hr = S_OK;
	m_screenWidth = screenWidth;
	m_screenHeight = screenHeight;
	m_bitmapWidth = bitmapWidth;
	m_bitmapHeight = bitmapHeight;
	m_previousPosX = -1;
	m_previousPosY = -1;
	m_previousWidth = bitmapWidth;
	m_previousHeight = bitmapHeight;

	hr = InitializeBuffers(device);
	if (FAILED(hr))
		return hr;

	scaling[0] = 1.0f;
	scaling[1] = 1.0f;
	scaling[2] = 1.0f;

	D3D11_BUFFER_DESC bd;
	hr = InitializeBuffers(device);
	if (FAILED(hr))
		return hr;
	ZeroMemory(&bd, sizeof(bd));
	bd.ByteWidth = sizeof(Propertys);
	bd.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
	bd.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
	bd.Usage = D3D11_USAGE_DYNAMIC;
	hr = device->CreateBuffer(&bd, NULL, &m_BlockProperty);
	if (FAILED(hr))
	{
		MessageBox(NULL, L"ErrorCreate Translation Buffer", L"Error_BlockClass", MB_OK);
		return false;
	}
	ZeroMemory(&bd, sizeof(bd));
	bd.ByteWidth = sizeof(Factors);
	bd.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
	bd.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
	bd.Usage = D3D11_USAGE_DYNAMIC;
	hr = device->CreateBuffer(&bd, NULL, &m_RenderFactors);
	if (FAILED(hr))
	{
		MessageBox(NULL, L"ErrorCreate RenderFactors Buffer", L"Error_BlockClass", MB_OK);
		return false;
	}
	rotation[0] = 0.0f;
	rotation[1] = 0.0f;
	rotation[2] = 0.0f;
	D3DXMatrixIdentity(&propertys.RotationMatrix);
	return true;
}
开发者ID:zzxchavo,项目名称:Minecraft_Direct11,代码行数:52,代码来源:Rectangle2DClass.cpp


示例2: InitializeBuffers

bool CloudClass::Initialize(ID3D11Device* device, int width, int height, float SCREEN_DEPTH, float SCREEN_NEAR){
	bool result;
	// Create the up sample render to texture object.
	front_texture_ = new RenderTextureClass;
	if(!front_texture_){
		return false;
	}
	// Initialize the up sample render to texture object.
	result = front_texture_->Initialize(device, width, height, SCREEN_DEPTH, SCREEN_NEAR);
	if(!result){
		return false;
	}
	back_texture_ = new RenderTextureClass;
	if(!back_texture_){
		return false;
	}
	// Initialize the up sample render to texture object.
	result = back_texture_->Initialize(device, width, height, SCREEN_DEPTH, SCREEN_NEAR);
	if(!result){
		return false;
	}
	// Initialize the vertex and index buffer that hold the geometry for the terrain.
	result = InitializeBuffers(device);
	if(!result){
		return false;
	}
	return true;
}
开发者ID:jcrm,项目名称:Honours,代码行数:28,代码来源:cloud_box.cpp


示例3: LoadModel

bool ModelClass::Initialize(ID3D10Device* device, char* modelFilename, WCHAR* textureFilename)
{
	bool result;


	// Load in the model data.
	result = LoadModel(modelFilename);
	if(!result)
	{
		return false;
	}

	// Initialize the vertex and index buffer that hold the geometry for the model.
	result = InitializeBuffers(device);
	if(!result)
	{
		return false;
	}

	// Load the texture for this model.
	result = LoadTexture(device, textureFilename);
	if(!result)
	{
		return false;
	}

	return true;
}
开发者ID:JonathanSimonJones,项目名称:Year3Sem2,代码行数:28,代码来源:modelclass.cpp


示例4: LoadModel

bool BumpModelClass::Initialize(ID3D10Device* device, char* modelFilename, WCHAR* textureFilename1, WCHAR* textureFilename2)
{
    bool result;


    // Load in the model data.
    result = LoadModel(modelFilename);
    if(!result)
    {
        return false;
    }

    // Calculate the normal, tangent, and binormal vectors for the model.
    CalculateModelVectors();

    // Initialize the vertex and index buffer that hold the geometry for the model.
    result = InitializeBuffers(device);
    if(!result)
    {
        return false;
    }

    // Load the textures for this model.
    result = LoadTextures(device, textureFilename1, textureFilename2);
    if(!result)
    {
        return false;
    }

    return true;
}
开发者ID:jiangguang5201314,项目名称:ZNginx,代码行数:31,代码来源:bumpmodelclass.cpp


示例5: LoadTexture

// |----------------------------------------------------------------------------|
// |						      Initialize									|
// |----------------------------------------------------------------------------|
bool ParticleSystemClass::Initialize(ID3D11Device* device, WCHAR* textureFilename)
{
	bool result;


	// Load the texture that is used for the particles.
	result = LoadTexture(device, textureFilename);
	if(!result)
	{
		return false;
	}

	// Initialize the particle system.
	result = InitializeParticleSystem();
	if(!result)
	{
		return false;
	}

	// Create the buffers that will be used to render the particles with.
	result = InitializeBuffers(device);
	if(!result)
	{
		return false;
	}

	return true;
}
开发者ID:Jiyambi,项目名称:DirectX-Coursework,代码行数:31,代码来源:ParticleSystemClass.cpp


示例6: DecompressFile

static BROTLI_BOOL DecompressFile(Context* context, BrotliDecoderState* s) {
  BrotliDecoderResult result = BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT;
  InitializeBuffers(context);
  for (;;) {
    if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT) {
      if (!HasMoreInput(context)) {
        fprintf(stderr, "corrupt input [%s]\n",
                PrintablePath(context->current_input_path));
        return BROTLI_FALSE;
      }
      if (!ProvideInput(context)) return BROTLI_FALSE;
    } else if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) {
      if (!ProvideOutput(context)) return BROTLI_FALSE;
    } else if (result == BROTLI_DECODER_RESULT_SUCCESS) {
      if (!FlushOutput(context)) return BROTLI_FALSE;
      if (context->available_in != 0 || HasMoreInput(context)) {
        fprintf(stderr, "corrupt input [%s]\n",
                PrintablePath(context->current_input_path));
        return BROTLI_FALSE;
      }
      return BROTLI_TRUE;
    } else {
      fprintf(stderr, "corrupt input [%s]\n",
              PrintablePath(context->current_input_path));
      return BROTLI_FALSE;
    }

    result = BrotliDecoderDecompressStream(s, &context->available_in,
        &context->next_in, &context->available_out, &context->next_out, 0);
  }
}
开发者ID:chipsec,项目名称:chipsec,代码行数:31,代码来源:brotli.c


示例7: LoadSkyBoxModel

bool SkyBox::Init(ID3D11Device* device)
{
	bool result;


	// Load in sky box model.
	result = LoadSkyBoxModel("../SkyBox.txt");
	if(!result)
	{
		return false;
	}

	// Load sky box into a vertex and index buffer for rendering.
	result = InitializeBuffers(device);
	if(!result)
	{
		return false;
	}

	// Set color at top of sky box.
	_apexColor = D3DXVECTOR4(0.0f, 0.15f, 0.66f, 1.0f);
	_apexColor = D3DXVECTOR4(0.0f, 0.145f, 0.667f, 1.0f);

	// Set color at center of sky box.
	_centerColor =  D3DXVECTOR4(0.81f, 0.38f, 0.66f, 1.0f);
	_centerColor =  D3DXVECTOR4(0.02f, 0.365f, 0.886f, 1.0f);

	return true;
}
开发者ID:makehimanoffer,项目名称:3rdYearProjectStorage,代码行数:29,代码来源:SkyBox.cpp


示例8: LoadHeightMap

bool TerrainClass::Initialize(ID3D11Device* device, char* heightMapFilename)
{
	bool result;


	// Load in the height map for the terrain.
	result = LoadHeightMap(heightMapFilename);
	if(!result)
	{
		return false;
	}

	// Normalize the height of the height map.
	NormalizeHeightMap();

	// Calculate the normals for the terrain data.
	result = CalculateNormals();
	if(!result)
	{
		return false;
	}

	// Initialize the vertex and index buffer that hold the geometry for the terrain.
	result = InitializeBuffers(device);
	if(!result)
	{
		return false;
	}

	return true;
}
开发者ID:jcrm,项目名称:Engine,代码行数:31,代码来源:terrainclass.cpp


示例9: LoadModel

bool ModelClass::Initialize(ID3D11Device* device, char* model_filename, WCHAR* texture_filename)
{
	bool result;

	result = LoadModel(model_filename);
	if(!result)
	{
		return false;
	}

	result = InitializeBuffers(device);
	if(!result)
	{
		return false;
	}

	

	//initialize texture
	result = LoadTexture(device, texture_filename);
	if(!result)
	{
		return false;
	}
	return true;
}
开发者ID:kvlar,项目名称:Haeigan,代码行数:26,代码来源:ModelClass.cpp


示例10: InitializeShaders

bool BitmapFontClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceContext, char* textureFilename, const char* basisShaderFileName)
{
	bool initResult = InitializeShaders(device, basisShaderFileName);
	if (!initResult)
	{
		return false;
	}

	initResult = InitializeTextureView(device, deviceContext, textureFilename);
	if (!initResult)
	{
		return false;
	}

	initResult = InitializeBuffers(device);
	if (!initResult)
	{
		return false;
	}

	initResult = InitializeBlending(device, deviceContext);
	if (!initResult)
	{
		return false;
	}

	return true;
}
开发者ID:rgpieters,项目名称:Game-Engine,代码行数:28,代码来源:BitmapFontClass.cpp


示例11: InitializeBuffers

bool CBitmap::Initialize(ID3D11Device* device, int width, int height, std::string filename, int bmpWidth, int bmpHeight)
{
	bool result;
	screenWidth = width;
	screenHeight = height;

	bitmapHeight = bmpHeight;
	bitmapWidth = bmpWidth;

	previousPosX = -1;
	previousPosY = -1;

	result = InitializeBuffers(device);
	if (!result)
	{
		CLog::Write("CBitmap::Initialize : Could not initialize the buffers");
		return false;
	}

	result = LoadTexture(device, filename);
	if (!result)
	{
		CLog::Write("CBitmap::Initialize : could not load the texture " + filename);
		return false;
	}

	return true;
}
开发者ID:pikzen,项目名称:Crescent,代码行数:28,代码来源:CBitmap.cpp


示例12: result

void PreviewObject::Initialize()
{
	bool result(true);

	//m_pInstancedObject = ContentManager::Load<ModelComponent>(_T("./Resources/Lemmings3D/models/LemmingsCube.ovm"));
	//m_pInstancedObject->Initialize();

	// Load the texture for this model.
	result = LoadTexture(GraphicsDevice::GetInstance()->GetDevice(), m_TextureFile);
	ASSERT(result, _T("Couldn't Load the Texture of the instancedObject!"));
	if(!result)
	{
		Release();
		return;
	}

	// Initialize the vertex and instance buffer that hold the geometry for the triangles.
	result = InitializeBuffers(GraphicsDevice::GetInstance()->GetDevice());
	ASSERT(result, _T("Couldn't initialize buffers of the instancedObject!"));
	if(!result)
	{
		ReleaseBuffers();
		return;
	}
}
开发者ID:GlenDC,项目名称:Lemmings3D,代码行数:25,代码来源:PreviewObject.cpp


示例13: InitializeBuffers

bool BitmapClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceContext, HWND hwnd, int screenWidth, int screenHeight, char* textureFilename, int bitmapWidth, int bitmapHeight){
	bool result;

	m_screenWidth = screenWidth;
	m_screenHeight = screenHeight;

	m_previousPosX = -1;
	m_previousPosY = -1;
	m_previousAngle = -1000.0f;

	result = InitializeBuffers(device);
	if (!result){
		return false;
	}
	result = LoadTexture(device, deviceContext, textureFilename, hwnd);
	if (!result){
		return false;
	}

	if (bitmapHeight == 0){
		m_bitmapHeight = m_Texture->GetHeight();
	}
	else{
		m_bitmapHeight = bitmapHeight;
	}

	if (bitmapWidth == 0){
		m_bitmapWidth = m_Texture->GetWidth();
	}
	else{
		m_bitmapWidth = bitmapWidth;
	}

	return true;
}
开发者ID:UnlikeSuika,项目名称:General_Direct3D,代码行数:35,代码来源:BitmapClass.cpp


示例14: InitializeBuffers

////////////////////////////////////////
//		PUBLIC UTILITY FUNCTIONS
////////////////////////////////////////
bool DiffuseContext::Initialize(HWND hWnd)
{
	bool result;

	result = InitializeBuffers();
	if(!result)
	{
		MessageBox(hWnd, L"Could not initialize a sprite context.", L"Error", MB_OK);
		return false;
	}

	// Create the color shader object.
	m_diffuseShade = new DiffuseShader("diffuse","diffuse");
	if(!m_diffuseShade)
	{
		return false;
	}

	// Initialize the color shader object.
	result = m_diffuseShade->Initialize(GraphicsGlobals::g_Device, hWnd);
	if(!result)
	{
		MessageBox(hWnd, L"Could not initialize the diffuse shader object.", L"Error", MB_OK);
		return false;
	}

	return true;
}
开发者ID:CSPshala,项目名称:dangerzone,代码行数:31,代码来源:DiffuseContext.cpp


示例15: InitializeBuffers

////////////////////////////////////////
//		PUBLIC UTILITY FUNCTIONS
////////////////////////////////////////
bool ParticleContext::Initialize()
{
	bool result;

	result = InitializeBuffers();

	if(!result)
	{
		MessageBox(WindowGlobals::g_hWnd, L"Could not initialize the particle context.", L"Error", MB_OK);
		return false;
	}

	// Create the color shader object.
	m_particleShader = new ParticleShader(L"billboard",L"colors",L"billboard");
	if(!m_particleShader)
	{
		return false;
	}

	// Initialize the color shader object.
	result = m_particleShader->Initialize(ApplicationSettings::g_Device, WindowGlobals::g_hWnd);
	if(!result)
	{
		MessageBox(WindowGlobals::g_hWnd, L"Could not initialize the particle shader object.", L"Error", MB_OK);
		return false;
	}

	return true;
}
开发者ID:CSPshala,项目名称:3Ddangerzone,代码行数:32,代码来源:ParticleContext.cpp


示例16: InitializeBuffers

bool ModelClass::UpdateBuffers(ID3D11Device* pDevice, void* cBuf)
{
	bool result;




	//Shutdown();

	// Initialize the vertex and index buffers.
	result = InitializeBuffers(pDevice, cBuf);
	if (!result)
	{
		return false;
	}

	return true;

	// no longer loading textures from model
	//	//Load the texture for this model.
	//	result = LoadTexture(pDevice, textureFilename);
	//	if (!result)
	//	{
	//		return false;
	//	}

	return true;


}
开发者ID:konglobemeralt,项目名称:Real-Time-Viewer,代码行数:30,代码来源:modelClass.cpp


示例17: InitializeBuffers

bool DynamicBitmapClass::Initialize(ID3D10Device* device, int screenWidth, int screenHeight, int bitmapWidth, int bitmapHeight)
{
    bool result;


    // Store the screen size.
    m_screenWidth = screenWidth;
    m_screenHeight = screenHeight;

    // Store the size in pixels that this bitmap should be rendered at.
    m_bitmapWidth = bitmapWidth;
    m_bitmapHeight = bitmapHeight;

    // Initialize the previous rendering position to negative one.
    m_previousPosX = -1;
    m_previousPosY = -1;
    m_previousScale = 1.0f;

    // Initialize the vertex and index buffer that hold the geometry for the triangle.
    result = InitializeBuffers(device);
    if(!result)
    {
        return false;
    }

    //Create dynamic Textures to forward kinect image data for rendering
    D3D10_TEXTURE2D_DESC desc;
    desc.Width = bitmapWidth;
    desc.Height = bitmapHeight;
    desc.MipLevels = desc.ArraySize = 1;
    desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
    desc.SampleDesc.Count = 1;
    desc.Usage = D3D10_USAGE_DYNAMIC;
    desc.BindFlags = D3D10_BIND_SHADER_RESOURCE;
    desc.CPUAccessFlags = D3D10_CPU_ACCESS_WRITE;
    desc.MiscFlags = 0;


    result = device->CreateTexture2D( &desc, 0, &m_Texture );
    if(FAILED(result))
    {
        return false;
    }

    // Setup the description of the shader resource view.
    D3D10_SHADER_RESOURCE_VIEW_DESC shaderResourceViewDesc;
    shaderResourceViewDesc.Format = desc.Format;
    shaderResourceViewDesc.ViewDimension = D3D10_SRV_DIMENSION_TEXTURE2D;
    shaderResourceViewDesc.Texture2D.MostDetailedMip = 0;
    shaderResourceViewDesc.Texture2D.MipLevels = 1;

    // Create the shader resource view.
    result = device->CreateShaderResourceView(m_Texture, &shaderResourceViewDesc, &m_shaderResourceView);
    if(FAILED(result))
    {
        return false;
    }

    return true;
}
开发者ID:xtr3m3nerd,项目名称:DirectXKinectFramework,代码行数:60,代码来源:dynamicbitmap.cpp


示例18: LoadModel

bool ModelClass::Initialize(ID3D11Device* device, char* modelFilename, WCHAR* colorTextureFilename, WCHAR* normalTextureFilename)
{
	bool result;


	// Load in the model data,
	result = LoadModel(modelFilename);
	if(!result)
	{
		return false;
	}

	// Initialize the vertex and index buffers.
	result = InitializeBuffers(device);
	if(!result)
	{
		return false;
	}

	// Load the textures for this model.
	result = LoadTextures(device, colorTextureFilename, normalTextureFilename);
	if(!result)
	{
		return false;
	}

	return true;
}
开发者ID:Scillman,项目名称:rastertek-dx11-tutorials,代码行数:28,代码来源:modelclass.cpp


示例19: CompressFile

static BROTLI_BOOL CompressFile(Context* context, BrotliEncoderState* s) {
  BROTLI_BOOL is_eof = BROTLI_FALSE;
  InitializeBuffers(context);
  for (;;) {
    if (context->available_in == 0 && !is_eof) {
      if (!ProvideInput(context)) return BROTLI_FALSE;
      is_eof = !HasMoreInput(context);
    }

    if (!BrotliEncoderCompressStream(s,
        is_eof ? BROTLI_OPERATION_FINISH : BROTLI_OPERATION_PROCESS,
        &context->available_in, &context->next_in,
        &context->available_out, &context->next_out, NULL)) {
      /* Should detect OOM? */
      fprintf(stderr, "failed to compress data [%s]\n",
              PrintablePath(context->current_input_path));
      return BROTLI_FALSE;
    }

    if (context->available_out == 0) {
      if (!ProvideOutput(context)) return BROTLI_FALSE;
    }

    if (BrotliEncoderIsFinished(s)) {
      return FlushOutput(context);
    }
  }
}
开发者ID:chipsec,项目名称:chipsec,代码行数:28,代码来源:brotli.c


示例20: LoadModel

bool Model::Initialize(ID3D10Device* device,char* modelFile,WCHAR* textureFile)
{
	bool result;



	result = LoadModel(modelFile);
	if(!result)
	{
		return false;
	}

	
	result = InitializeBuffers(device);
	if(!result)
	{
		
		return false;
	}

	// Load the texture for this model.
	result = LoadTexture(device, textureFile);
	if(!result)
	{
		return false;
	}

	return true;
}
开发者ID:jrsme13,项目名称:Assignment2,代码行数:29,代码来源:Model.cpp



注:本文中的InitializeBuffers函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ InitializeComponents函数代码示例发布时间:2022-05-30
下一篇:
C++ Initialize函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap