本文整理汇总了C++中scoped_ptr::createProceduralShader方法的典型用法代码示例。如果您正苦于以下问题:C++ scoped_ptr::createProceduralShader方法的具体用法?C++ scoped_ptr::createProceduralShader怎么用?C++ scoped_ptr::createProceduralShader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scoped_ptr
的用法示例。
在下文中一共展示了scoped_ptr::createProceduralShader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
/*
\param target_ render target
\param offsetTarget_ offset render target
\param targetWidth_ render target width
\param targetHeight_ render target height
*/
void init(boost::shared_ptr<glTexWrapper> target_, boost::shared_ptr<glTexWrapper> offsetTarget_)
{
if (fbo != NULL) {
delete fbo;
}
fbo = new Framebuffer();
target = target_;
offsetTarget = offsetTarget_;
if(!target)
return;
vshader.reset(new frozenbyte::storm::VertexShader());
vshader->createProceduralShader();
pshader.reset(new frozenbyte::storm::PixelShader());
pshader->createProceduralShader();
if(offsetTarget)
{
poffsetShader.reset(new frozenbyte::storm::PixelShader());
poffsetShader->createProceduralOffsetShader();
}
{
vbuffer.reset(new frozenbyte::storm::VertexBuffer());
vbuffer->create(4, 8 * sizeof(float), false);
float *ptr = reinterpret_cast<float *> (vbuffer->lock());
if(ptr)
{
float width = 1.f;
float height = 1.f;
float buffer[] =
{
-width, height, 1.f, 1.f, 0.f, 1.f, 0.f, 1.f,
-width, -height, 1.f, 1.f, 0.f, 0.f, 0.f, 0.f,
width, height, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f,
width, -height, 1.f, 1.f, 1.f, 0.f, 1.f, 0.f
};
memcpy(ptr, buffer, 8 * 4 * sizeof(float));
vbuffer->unlock();
}
}
{
ibuffer.reset(new frozenbyte::storm::IndexBuffer());
ibuffer->create(2, false);
unsigned short *ptr = ibuffer->lock();
if(ptr)
{
*ptr++ = 0;
*ptr++ = 2;
*ptr++ = 1;
*ptr++ = 1;
*ptr++ = 2;
*ptr++ = 3;
ibuffer->unlock();
}
}
}