本文整理汇总了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);
}
示例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);
}
示例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;
}
示例4: SetMetatable
void NzLuaInstance::SetMetatable(const NzString& tname)
{
luaL_setmetatable(m_state, tname.GetConstBuffer());
}
示例5: GetMetatable
nzLuaType NzLuaInstance::GetMetatable(const NzString& tname) const
{
return FromLuaType(luaL_getmetatable(m_state, tname.GetConstBuffer()));
}
示例6: SetField
void NzLuaInstance::SetField(const NzString& name, int index)
{
lua_setfield(m_state, index, name.GetConstBuffer());
}
示例7: SetGlobal
void NzLuaInstance::SetGlobal(const NzString& name)
{
lua_setglobal(m_state, name.GetConstBuffer());
}
示例8: PushMetatable
void NzLuaInstance::PushMetatable(const NzString& str)
{
luaL_getmetatable(m_state, str.GetConstBuffer());
}
示例9: PushString
void NzLuaInstance::PushString(const NzString& str)
{
lua_pushlstring(m_state, str.GetConstBuffer(), str.GetSize());
}
示例10: IsOfType
bool NzLuaInstance::IsOfType(int index, const NzString& tname) const
{
return IsOfType(index, tname.GetConstBuffer());
}
示例11: NewMetatable
bool NzLuaInstance::NewMetatable(const NzString& str)
{
return luaL_newmetatable(m_state, str.GetConstBuffer()) != 0;
}
示例12: GetGlobal
nzLuaType NzLuaInstance::GetGlobal(const NzString& name) const
{
return FromLuaType(lua_getglobal(m_state, name.GetConstBuffer()));
}
示例13: GetUniformLocation
int NzShader::GetUniformLocation(const NzString& name) const
{
NzContext::EnsureContext();
return glGetUniformLocation(m_program, name.GetConstBuffer());
}
示例14: GetField
nzLuaType NzLuaInstance::GetField(const NzString& fieldName, int index) const
{
return FromLuaType(lua_getfield(m_state, index, fieldName.GetConstBuffer()));
}
示例15: ArgCheck
void NzLuaInstance::ArgCheck(bool condition, unsigned int argNum, const NzString& error)
{
luaL_argcheck(m_state, condition, argNum, error.GetConstBuffer());
}