osg学习(六十三)osg直接调用opengl例子

Posted hankern

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了osg学习(六十三)osg直接调用opengl例子相关的知识,希望对你有一定的参考价值。

1、定义回调类

class MyDrawCallback : public osg::Drawable::DrawCallback

public:
    void drawImplementation(osg::RenderInfo &, const osg::Drawable *) const
        GLenum errorNo;
        errorNo = glGetError();
    
;

2、设置回调类

osg::ref_ptr<osg::Node> cowModel = osgDB::readRefNodeFile("cow111.osg");
osg::Group* ttt=cowModel->asGroup();
osg::Geometry* geom = ttt->getChild(0)->asGeode()->getChild(0)->asGeometry();
geom->setDrawCallback(new MyDrawCallback());

以上是关于osg学习(六十三)osg直接调用opengl例子的主要内容,如果未能解决你的问题,请参考以下文章

osg学习(六十六)Unsupported wrapper class osg::Object

osg学习(六十)setTextureMode setTextureAttributeAndModes

osg学习(六十八)序列化插件加载过程

osg学习(六十九)平移旋转缩放实现过程

osg学习(六十五)图片到纹理

osg学习(五十三)绘制纹理贴图Texture示例