Hi.
I've got a litle problem.. Hope someone can help me.
I have my code all splited in classes. The main class that intialize the IrrlichtDevice but i can't make it shared nor access it by any other means in the other classes.
I'm using vb.net but if u tell me how to do it in c# i can understand.
Thank you.
Getting currently in use device
Yeah, you need to declare it with the Shared keyword.
So the whole point of a Shared object is so that you can reference it, without having to create an instance of the class. You can make any method (Sub or Function, in VB.NET), Property, whatever, Shared. It's the same as 'Static' in C#/C++/Java.
eg, in VB.NET:
So the whole point of a Shared object is so that you can reference it, without having to create an instance of the class. You can make any method (Sub or Function, in VB.NET), Property, whatever, Shared. It's the same as 'Static' in C#/C++/Java.
eg, in VB.NET:
Code: Select all
Public Class Engine
Public Shared Device As Irrlicht.Device 'or whatever it is
Public Sub MyMethod1()
'some stuff
End Sub
End Class
Intellectuals solve problems - geniuses prevent them. -- Einstein
#irrlicht on irc.freenode.net
#irrlicht on irc.freenode.net