Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

AngelScript wrapped c++ object loses opengl texture

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 93i   Members   

117
Like
0Likes
Like

Posted 18 July 2012 - 01:41 AM

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?

#2 Andreas Jonsson   Moderators   

4627
Like
0Likes
Like

Posted 18 July 2012 - 06:27 AM

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.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.