About Store Forum Documentation Contact
Donations:
178$/mo



Post Reply 
States
Author Message
Dynad Offline
Member

Post: #1
States
Hey,

I have a problem with the state manager inside EE. The functions init etc are static which means when i want to access a pointer from another class it wont compile.. cause you will get a error with "You cant access a non static member."

Is there a workaround this? So that i can use the non static functions inside the same class?

The only option i currently have is placing the function outside the class but thats not what i want..


Thnx,
~Dynad

There is always evil somewhere, you just have to look for it properly.
11-17-2010 01:40 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: States
struct
{
static void
or
friend void
}

but you cant use methods, you can call method of course from the function;

like struct
{
}obj;
void func()
{
obj.method();
}
11-17-2010 07:48 AM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #3
RE: States
Ah ok... but is it also possible to create a custom class with e.g a Draw() function which is created with the "new" c++ function and still uses the EE Draw functions? I don't wanna have something like that the Main.cpp is drawing everything or an custom state.

I don't like statics at all they are just annoying and i want to create classes for everything i wanna handle which is easier to maintain and its alot cleaner in my opinion.

e.g like this without using the struct extern.
class myCustomClass
{
myCustomClass();
~myCustomClass();
Bool Init();
Bool Update();
void Draw()
void Shutdown();
}

Or which class/struct i can inheritance using those draw functions?
Well i use the extra struct to make use of more functions.. at least in my case. But it works fine this way.

Thnx about the suggestion tho smile

There is always evil somewhere, you just have to look for it properly.
(This post was last modified: 11-17-2010 12:05 PM by Dynad.)
11-17-2010 11:16 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: States
you can only do this:

class myCustomClass
{
myCustomClass();
~myCustomClass();
Bool Init();
Bool Update();
void Draw()
void Shutdown();
}obj;

Bool Init() {return obj.Init();}
11-17-2010 12:33 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #5
RE: States
Yes i know.. i do it this way now atm smile

There is always evil somewhere, you just have to look for it properly.
11-17-2010 12:47 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply