Changeset 442 for GraphicTest/UMainForm.pas
- Timestamp:
- Nov 22, 2012, 9:37:20 AM (12 years ago)
- Location:
- GraphicTest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest
- Property svn:ignore
-
old new 7 7 GraphicTest.rc 8 8 GraphicTest.lps 9 GraphicTest.dbg
-
- Property svn:ignore
-
GraphicTest/UMainForm.pas
r338 r442 1 1 unit UMainForm; 2 2 3 {$mode Delphi}{$H+}3 {$mode delphi}{$H+} 4 4 5 5 interface … … 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 9 ExtCtrls, StdCtrls, DateUtils, UPlatform, LCLType, IntfGraphics, fpImage, 10 Math, GraphType, Contnrs, LclIntf, Spin, UFastBitmap, UDrawMethod , GL,11 OpenGLContext;10 Math, GraphType, Contnrs, LclIntf, Spin, UFastBitmap, UDrawMethod 11 {$IFDEF opengl}, GL, OpenGLContext{$ENDIF}; 12 12 13 13 const … … 46 46 procedure Timer1Timer(Sender: TObject); 47 47 private 48 {$IFDEF opengl} 48 49 OpenGLControl1: TOpenGLControl; 49 50 TextureId: GLuint; 50 51 TextureData: Pointer; 52 {$ENDIF} 51 53 MethodIndex: Integer; 52 54 SingleTestActive: Boolean; 53 55 AllTestActive: Boolean; 54 56 procedure OpenGLControl1Resize(Sender: TObject); 57 {$IFDEF opengl} 55 58 procedure InitGL; 59 {$ENDIF} 56 60 procedure UpdateMethodList; 57 61 procedure UpdateInterface; … … 93 97 Bitmap.SetSize(TFastBitmap(Scenes[0]).Size.X, TFastBitmap(Scenes[0]).Size.Y); 94 98 99 {$IFDEF opengl} 95 100 OpenGLControl1 := TOpenGLControl.Create(Self); 96 101 with OpenGLControl1 do begin … … 103 108 end; 104 109 GetMem(TextureData, OpenGLControl1.Width * OpenGLControl1.Height * SizeOf(Integer)); 110 {$ENDIF} 105 111 106 112 DrawMethods := TObjectList.Create; … … 109 115 NewDrawMethod.Bitmap := Image1.Picture.Bitmap; 110 116 NewDrawMethod.PaintBox := PaintBox1; 117 {$IFDEF opengl} 111 118 NewDrawMethod.OpenGLBitmap := TextureData; 112 119 NewDrawMethod.OpenGLControl := OpenGLControl1; 120 {$ENDIF} 113 121 NewDrawMethod.Init; 114 122 DrawMethods.Add(NewDrawMethod); … … 191 199 begin 192 200 ListViewMethods.Clear; 193 FreeMem(TextureData, OpenGLControl1.Width * OpenGLControl1.Height);194 DrawMethods.Free;195 Scenes.Free;196 Bitmap.Free;201 {$IFDEF opengl}FreeMem(TextureData, OpenGLControl1.Width * OpenGLControl1.Height);{$ENDIF} 202 FreeAndNil(DrawMethods); 203 FreeAndNil(Scenes); 204 FreeAndNil(Bitmap); 197 205 end; 198 206 … … 232 240 procedure TMainForm.OpenGLControl1Resize(Sender: TObject); 233 241 begin 242 {$IFDEF opengl} 234 243 glViewport(0, 0, OpenGLControl1.Width, OpenGLControl1.Height); 235 end; 236 244 {$ENDIF} 245 end; 246 247 {$IFDEF opengl} 237 248 procedure TMainForm.InitGL; 238 249 begin … … 254 265 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 255 266 end; 267 {$ENDIF} 256 268 257 269 procedure TMainForm.UpdateMethodList;
Note:
See TracChangeset
for help on using the changeset viewer.