changing texture at runtime

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
sivagiri
Posts: 22
Joined: Sat Jun 10, 2006 4:31 pm

changing texture at runtime

Post by sivagiri »

Hi all,

I use irrforge-s code: "draw text in texture" to write on the wall/blackboard. And when my user clicks on the right answer I would like to change the texture at runtime.


How can I do this???

sivagiri
juliusctw
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am
Contact:

try this

Post by juliusctw »

i assume that this texture is a SceneNode

You could go:
Node ->getMaterial(6).Texture1=WhatEver;
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

One way to do it would be to use render-to-texture. Have a look at the tutorial.

You would to render the 'text' to a render target, and then set that render target as the texture for the wall/blackboard.

Another way would be to just draw text using a IGUIStaticText.

Travis
Post Reply