Getting currently in use device

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
joaorj
Posts: 2
Joined: Tue Nov 21, 2006 8:35 pm

Getting currently in use device

Post by joaorj »

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.
sgt_pinky
Posts: 149
Joined: Sat Oct 14, 2006 11:20 am
Location: Melbourne, Australia

Post by sgt_pinky »

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:

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
Locked