Jump to content
  • Advertisement
Sign in to follow this  
Metabo

How to define functions that return script object types?

This topic is 1566 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

 

I'm trying to expose my application interface to angelscript using class wrappers. I'm doing so to allow further inheritance in script sources. Basically what I'm doing is this:

 

First, I'm registering a C++ class, say 'MyObject', as 'NativeMyObject'.

 

Then, I add a script section to my global module:

class MyObject : NativeMyObject
{
... // wrap all the methods and stuff of the 'real' MyObject.
}

Right after that I build the module.

 

What I want to do next is registering a global function that returns a MyObject (not NativeMyObject!). This however seems to be impossible due to MyObject no being know to the global namespace.

 

Is there any way to get around this issue? I guess the idea of having derivable script classes from native C++ classes may be very common and I'm just doing something wrong here.

 

Any help ist greatly appreciated!

 

 

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!