Hello Sajjadul,
Sajjadul Islam wrote:
Hello,
Some notes about RefPtr as specified in the Tutorial:
Recommended Usage:
1. All the pointers that are kept and used outside the function .
2. All global variables.
So In one of my application i used them as follows in the global scope :
//create a node to hold the point light core
RefPtr<NodePtr> pLightNode,dLightNode,sLightNode;
/*
global chunk pointers
that will be used to read
different shader and send
parameters to the shaders
*/
RefPtr<SHLChunkPtr> phongChunk,toonChunk,brickChunk;
Now inside the corresponding functions how do i initialize each of them?
for NodePtr if i use pLightNode = Node::create(), i get the following error
error: conversion from 'osg::NodePtr' to non-scalar type
'osg::RefPtr<osg::NodePtr>' requested
What should be there instead *pLightNode = Node::create()
this is strange, the attached mini program works fine for me and should
do the same as what you describe above. I suspect that there is
something else - i.e. not directly related to the assignment operator of
RefPtr - going on.
Can you try the attached program and see if that compiles for you ?
Carsten
PS: Would it be possible for you to send plain-text messages to this
mailing list? Especially for pasted code I find html messages harder to
read, thank you.
#include <OSGConfig.h>
#include <OSGNode.h>
#include <iostream>
OSG::RefPtr<OSG::NodePtr> pNode0, pNode1;
int main(int argc, char* argv[])
{
OSG::osgInit(argc, argv);
pNode0 = OSG::Node::create();
pNode1 = OSG::Node::create();
OSG::osgExit();
return 0;
}
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users