vivendi
October 8th, 2009, 02:56 AM
Hey, i get the following error when i try to compile my project:
Cannot access a non-static member of outer type 'Project.Shader' via nested type 'Project.Shader.RenderSurfaceSet'.
What i'm doing is the following.
I have a class called worldView.cs, in that class i create the Shader class like so:
[Inside worldView.cs]
Shader shader = new Shader(this);
As you can see a pass an instance of the worldView class to the shader class. The shader class uses some variabled declared in the worldView class without a problem.
But here comes the issue:
In the Shader.cs class i also have a struct defined inside the class, like so:
public class Shader
{
public View.WorldView world;
RenderSurfaceSet[] downscaledSets;
public Shader(View.WorldView world)
{
this.world = world;
Initialize();
}
//some functions inside the class
//the struct
struct RenderSurfaceSet
{
//some variables here
public RenderSurfaceSet(int downscalingFactor, int sourceTexture)
{
//code in constrcutor
}
//and some other functions inside this struct
}
}
Now what i'm trying to do is also use the worldView instance inside this struct. The worldView object seems to be accessible from within that struct, but when i try to compile it it generates that error.
Anyone any idea how to solve that??
Cannot access a non-static member of outer type 'Project.Shader' via nested type 'Project.Shader.RenderSurfaceSet'.
What i'm doing is the following.
I have a class called worldView.cs, in that class i create the Shader class like so:
[Inside worldView.cs]
Shader shader = new Shader(this);
As you can see a pass an instance of the worldView class to the shader class. The shader class uses some variabled declared in the worldView class without a problem.
But here comes the issue:
In the Shader.cs class i also have a struct defined inside the class, like so:
public class Shader
{
public View.WorldView world;
RenderSurfaceSet[] downscaledSets;
public Shader(View.WorldView world)
{
this.world = world;
Initialize();
}
//some functions inside the class
//the struct
struct RenderSurfaceSet
{
//some variables here
public RenderSurfaceSet(int downscalingFactor, int sourceTexture)
{
//code in constrcutor
}
//and some other functions inside this struct
}
}
Now what i'm trying to do is also use the worldView instance inside this struct. The worldView object seems to be accessible from within that struct, but when i try to compile it it generates that error.
Anyone any idea how to solve that??