From: Darryl L. <py...@us...> - 2000-11-11 17:57:11
|
Update of /cvsroot/pythianproject/Prototypes/GLCanvas In directory slayer.i.sourceforge.net:/tmp/cvs-serv31621 Modified Files: StartUp.dfm MyDraw.pas glCanvas.pas Log Message: Color bug fixed - DL Index: StartUp.dfm =================================================================== RCS file: /cvsroot/pythianproject/Prototypes/GLCanvas/StartUp.dfm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 Binary files /tmp/cvsxf11i4 and /tmp/cvskIzhyY differ Index: MyDraw.pas =================================================================== RCS file: /cvsroot/pythianproject/Prototypes/GLCanvas/MyDraw.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** MyDraw.pas 2000/11/11 17:13:12 1.2 --- MyDraw.pas 2000/11/11 17:57:01 1.3 *************** *** 48,52 **** InspectorGadget := TGLBitmap.Create; InspectorGadget.LoadFromBitmap('gadgetcollage.bmp'); ! SampleText := TGLText.Create('Hello World','arial1.glf',GLCANVAS_TEXT_GLF); Sampletext.Lines.Add('Long live the Project'); SampleText.Lines.Add('These are lines of text drawn by GLF'); --- 48,53 ---- InspectorGadget := TGLBitmap.Create; InspectorGadget.LoadFromBitmap('gadgetcollage.bmp'); ! SampleText := TGLText.Create('Hello World', 'arial1.glf', GLCANVAS_TEXT_GLF); ! Sampletext.Lines.Add('Long live the Project'); SampleText.Lines.Add('These are lines of text drawn by GLF'); *************** *** 77,81 **** SampleText.Lines.Add('kfldqpptioreptQUITRJAKSjkdlsakjdbtathylayklt=-29'); ! SampleText.Color := clYellow; SampleText.Size := 10.0; end; --- 78,82 ---- SampleText.Lines.Add('kfldqpptioreptQUITRJAKSjkdlsakjdbtathylayklt=-29'); ! SampleText.SetColor(clYellow); SampleText.Size := 10.0; end; *************** *** 108,112 **** // this draws the text object ! GLC.DrawText(10,150,SampleText); end; --- 109,113 ---- // this draws the text object ! GLC.DrawText(1,1,SampleText); end; Index: glCanvas.pas =================================================================== RCS file: /cvsroot/pythianproject/Prototypes/GLCanvas/glCanvas.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** glCanvas.pas 2000/11/11 17:13:12 1.2 --- glCanvas.pas 2000/11/11 17:57:01 1.3 *************** *** 31,34 **** --- 31,35 ---- Contributors - Michael Hearn (mh...@su...) + Darryl Long (d_...@sy...) To do- *************** *** 39,42 **** --- 40,46 ---- Support textured fonts? (mike's code) Add shapes code + + Fixed: + Color bug all better } *************** *** 76,80 **** FLines :TStringList; FFontName :string; ! FRed, FGreen, FBlue :byte; FSize :real; --- 80,84 ---- FLines :TStringList; FFontName :string; ! FRed, FGreen, FBlue: Single; FSize :real; *************** *** 86,93 **** procedure LoadFont; virtual ; ! procedure SetBlue(const Value: byte); ! procedure SetGreen(const Value: byte); ! procedure SetRed(const Value: byte); ! procedure SetColor(const Value: TColor); procedure SetSize(const Value: Real); procedure SetPrecache(const Value: boolean); --- 90,96 ---- procedure LoadFont; virtual ; ! procedure SetBlue(const Value: Single); ! procedure SetGreen(const Value: Single); ! procedure SetRed(const Value: Single); procedure SetSize(const Value: Real); procedure SetPrecache(const Value: boolean); *************** *** 106,114 **** property Text:string read GetText write SetText; ! property Red :byte read FRed write SetRed; ! property Green :byte read FGreen write SetGreen; ! property Blue :byte read FBlue write SetBlue; - property Color :TColor write SetColor; property Size :Real read FSize write SetSize; --- 109,116 ---- property Text:string read GetText write SetText; ! property Red: Single read FRed write SetRed; ! property Green: Single read FGreen write SetGreen; ! property Blue: Single read FBlue write SetBlue; property Size :Real read FSize write SetSize; *************** *** 120,123 **** --- 122,126 ---- destructor Destroy; override ; procedure Draw; virtual ; + procedure SetColor(const Value: TColor); end; *************** *** 324,329 **** if TextType = GLCANVAS_TEXT_GLF then begin ! // @TODO - fix this ! //glColor3b(Red,Green,Blue); glPushMatrix; glScalef(Size,Size,1); --- 327,331 ---- if TextType = GLCANVAS_TEXT_GLF then begin ! glColor3f(FRed, FGreen, FBlue); glPushMatrix; glScalef(Size,Size,1); *************** *** 358,362 **** end; ! procedure TGLText.SetBlue(const Value: byte); begin FBlue := Value; --- 360,364 ---- end; ! procedure TGLText.SetBlue(const Value: Single); begin FBlue := Value; *************** *** 365,374 **** procedure TGLText.SetColor(const Value: TColor); - type - TColorQuad = array[0..3] of byte; begin ! FRed := TColorQuad(Value)[0]; ! FGreen := TColorQuad(Value)[1]; ! FBlue := TColorQuad(Value)[2]; UpdateDisplayList; end; --- 367,374 ---- procedure TGLText.SetColor(const Value: TColor); begin ! FRed := (Value and $0000FF); ! FGreen := (Value and $00FF00) SHR 8; ! FBlue := (Value and $FF0000) SHR 16; UpdateDisplayList; end; *************** *** 381,385 **** end; ! procedure TGLText.SetGreen(const Value: byte); begin FGreen := Value; --- 381,385 ---- end; ! procedure TGLText.SetGreen(const Value: Single); begin FGreen := Value; *************** *** 393,397 **** end; ! procedure TGLText.SetRed(const Value: byte); begin FRed := Value; --- 393,397 ---- end; ! procedure TGLText.SetRed(const Value: Single); begin FRed := Value; |