I have this struct definition:
public struct Icon {
public Bitmap bitmap;
public Bitmap g_bitmap;
public int bitmap_ID;
public int g_bitmap_ID;
}
Icon current = new Icon();
then I tried to load a bitmap from file:
current.bitmap = new Bitmap(path);
//Create the texture
current.bitmap_ID = TexUtil.CreateTextureFromBitmap(current.bitmap);
current.g_bitmap = new Bitmap(current.bitmap)
and the same for the other variables, but bitmap/g_bitmap continue to have null value, bitmap_ID/g_bitmap_ID are at 0.
Not so sure to have understood how a struct work (my previous experience was in C). Tried to read the MSDN documentation but nothing helps.
Sorry everybody,
I’m really a stupid. Forget to pass the reference to my method…
forgotten to add a
refto the first parameter. In this way it works just locally on a copy oficon. This works:Pardon!