Jump to content
  • Advertisement
Sign in to follow this  
93i

AngelScript wrapped c++ object loses opengl texture

This topic is 2254 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

I have a C++ class for a image. In constructor, it creates a opengl texture and provides a draw function where it binds the texture and draws a quad with the texture on it.

I have a angelscript wrapper that looks like this:



class Image {
Image(string name, float x, float y) {
@inner = MyCImage(name, x, y);
}
void draw(float t) {
inner.draw(t);
}
MyCImage @inner;
}


When i create a c++ object in my application and draw, everything is fine, but when i create a angel script object and draw via angelscript, drawing in general works, the quad shows up and if i give every vertex a color, it shows the vertex colors, but the quad is untextured.

Any idea what this could be?

Share this post


Link to post
Share on other sites
Advertisement
I don't see anything wrong with the script you showed.

Have you debugged the draw routine? Are the inner object's members set correctly? If not try setting a memory breakpoint on the mebers to see where they are overwritten.

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!