当前位置: 首页>>代码示例>>C++>>正文


C++ NzString::GetConstBuffer方法代码示例

本文整理汇总了C++中NzString::GetConstBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ NzString::GetConstBuffer方法的具体用法?C++ NzString::GetConstBuffer怎么用?C++ NzString::GetConstBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NzString的用法示例。


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

示例1: SetSource

void NzShaderStage::SetSource(const NzString& source)
{
	#if NAZARA_RENDERER_SAFE
	if (!m_id)
	{
		NazaraError("Shader stage is not initialized");
		return;
	}
	#endif

	const char* tmp = source.GetConstBuffer();
	GLint length = source.GetSize();
	glShaderSource(m_id, 1, &tmp, &length);
}
开发者ID:BigFax,项目名称:NazaraEngine,代码行数:14,代码来源:ShaderStage.cpp

示例2: Execute

bool NzLuaInstance::Execute(const NzString& code)
{
	if (code.IsEmpty())
		return true;

	if (luaL_loadstring(m_state, code.GetConstBuffer()) != 0)
	{
		m_lastError = lua_tostring(m_state, -1);
		lua_pop(m_state, 1);

		return false;
	}

	return Run(0, 0);
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:15,代码来源:LuaInstance.cpp

示例3: Create

bool NzShader::Create()
{
	NzContext::EnsureContext();

	m_program = glCreateProgram();
	if (!m_program)
	{
		NazaraError("Failed to create program");
		return false;
	}

	m_linked = false;

	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_InstanceData0], "InstanceData0");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_InstanceData1], "InstanceData1");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_InstanceData2], "InstanceData2");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_InstanceData3], "InstanceData3");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_InstanceData4], "InstanceData4");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_InstanceData5], "InstanceData5");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Color],         "VertexColor");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Normal],        "VertexNormal");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Position],      "VertexPosition");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Tangent],       "VertexTangent");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_TexCoord],      "VertexTexCoord");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Userdata0],     "VertexUserdata0");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Userdata1],     "VertexUserdata1");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Userdata2],     "VertexUserdata2");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Userdata3],     "VertexUserdata3");
	glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Userdata4],     "VertexUserdata4");

	if (NzRenderer::HasCapability(nzRendererCap_MultipleRenderTargets))
	{
		NzString uniform;
		uniform = "RenderTarget";

		unsigned int maxRenderTargets = NzRenderer::GetMaxRenderTargets();
		for (unsigned int i = 0; i < maxRenderTargets; ++i)
		{
			NzString uniformName = uniform + NzString::Number(i);
			glBindFragDataLocation(m_program, i, uniformName.GetConstBuffer());
		}
	}

	if (NzOpenGL::IsSupported(nzOpenGLExtension_GetProgramBinary))
		glProgramParameteri(m_program, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE);

	return true;
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:48,代码来源:Shader.cpp

示例4: SetMetatable

void NzLuaInstance::SetMetatable(const NzString& tname)
{
	luaL_setmetatable(m_state, tname.GetConstBuffer());
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:4,代码来源:LuaInstance.cpp

示例5: GetMetatable

nzLuaType NzLuaInstance::GetMetatable(const NzString& tname) const
{
	return FromLuaType(luaL_getmetatable(m_state, tname.GetConstBuffer()));
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:4,代码来源:LuaInstance.cpp

示例6: SetField

void NzLuaInstance::SetField(const NzString& name, int index)
{
	lua_setfield(m_state, index, name.GetConstBuffer());
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:4,代码来源:LuaInstance.cpp

示例7: SetGlobal

void NzLuaInstance::SetGlobal(const NzString& name)
{
	lua_setglobal(m_state, name.GetConstBuffer());
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:4,代码来源:LuaInstance.cpp

示例8: PushMetatable

void NzLuaInstance::PushMetatable(const NzString& str)
{
	luaL_getmetatable(m_state, str.GetConstBuffer());
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:4,代码来源:LuaInstance.cpp

示例9: PushString

void NzLuaInstance::PushString(const NzString& str)
{
	lua_pushlstring(m_state, str.GetConstBuffer(), str.GetSize());
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:4,代码来源:LuaInstance.cpp

示例10: IsOfType

bool NzLuaInstance::IsOfType(int index, const NzString& tname) const
{
	return IsOfType(index, tname.GetConstBuffer());
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:4,代码来源:LuaInstance.cpp

示例11: NewMetatable

bool NzLuaInstance::NewMetatable(const NzString& str)
{
	return luaL_newmetatable(m_state, str.GetConstBuffer()) != 0;
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:4,代码来源:LuaInstance.cpp

示例12: GetGlobal

nzLuaType NzLuaInstance::GetGlobal(const NzString& name) const
{
	return FromLuaType(lua_getglobal(m_state, name.GetConstBuffer()));
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:4,代码来源:LuaInstance.cpp

示例13: GetUniformLocation

int NzShader::GetUniformLocation(const NzString& name) const
{
	NzContext::EnsureContext();

	return glGetUniformLocation(m_program, name.GetConstBuffer());
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:6,代码来源:Shader.cpp

示例14: GetField

nzLuaType NzLuaInstance::GetField(const NzString& fieldName, int index) const
{
	return FromLuaType(lua_getfield(m_state, index, fieldName.GetConstBuffer()));
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:4,代码来源:LuaInstance.cpp

示例15: ArgCheck

void NzLuaInstance::ArgCheck(bool condition, unsigned int argNum, const NzString& error)
{
	luaL_argcheck(m_state, condition, argNum, error.GetConstBuffer());
}
开发者ID:MrFraggy,项目名称:NazaraEngine,代码行数:4,代码来源:LuaInstance.cpp


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