diff options
Diffstat (limited to 'src/base/UThemes.pas')
-rw-r--r-- | src/base/UThemes.pas | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/base/UThemes.pas b/src/base/UThemes.pas index fca75c24..2319107a 100644 --- a/src/base/UThemes.pas +++ b/src/base/UThemes.pas @@ -725,6 +725,11 @@ type RGB: TRGB; end; +procedure glColorRGB(Color: TRGB); overload; +procedure glColorRGB(Color: TRGB; Alpha: Real); overload; +procedure glColorRGB(Color: TRGBA); overload; +procedure glColorRGB(Color: TRGBA; Alpha: Real); overload; + function ColorExists(Name: string): integer; procedure LoadColor(var R, G, B: real; ColorName: string); function GetSystemColor(Color: integer): TRGB; @@ -741,7 +746,34 @@ uses UCommon, ULanguage, USkins, - UIni; + UIni, + gl, + glext, + math; + +//----------- +//Helper procs to use TRGB in Opengl ...maybe this should be somewhere else +//----------- +procedure glColorRGB(Color: TRGB); overload; +begin + glColor3f(Color.R, Color.G, Color.B); +end; + +procedure glColorRGB(Color: TRGB; Alpha: Real); overload; +begin + glColor4f(Color.R, Color.G, Color.B, Alpha); +end; + +procedure glColorRGB(Color: TRGBA); overload; +begin + glColor4f(Color.R, Color.G, Color.B, Color.A); +end; + +procedure glColorRGB(Color: TRGBA; Alpha: Real); overload; +begin + glColor4f(Color.R, Color.G, Color.B, Min(Color.A, Alpha)); +end; + constructor TTheme.Create(FileName: string); begin |