I have this struct:
#pragma once
#include "Defines.h"
#ifndef _COLOR_H_
#define _COLOR_H_
namespace BSGameFramework
{
namespace Graphics
{
ref struct Color
{
public:
Color(BYTE r, BYTE g, BYTE b);
Color(BYTE r, BYTE g, BYTE b, BYTE a);
Color(Color% color) {};
static property Color White
{
Color get()
{
Color white = gcnew Color(255, 255, 255);
return white; // Here the error
}
}
private:
BYTE r;
BYTE g;
BYTE b;
BYTE a;
};
}
}
#endif
and when I'm compiling the file I'm getting this error:
Error 1 error C2664: 'BSGameFramework::Graphics::Color::Color(const BSGameFramework::Graphics::Color %)' : cannot convert parameter 1 from 'BSGameFramework::Graphics::Color ^' to 'const BSGameFramework::Graphics::Color %' c:\users\nicola\desktop\directx prove\bsgameframework\bsgame\Color.h 24 1 BSGame
PS: BYTE
is defined in Defines.h as unsigned char
SOLVED:
I've changed the property as follow:
static property Color^ White
{
Color^ get()
{
Color ^white = gcnew Color(255, 255, 255);
return white;
}
}
Change the property to:
or