Changeset 212 for GraphicTest


Ignore:
Timestamp:
Mar 20, 2011, 7:18:27 PM (13 years ago)
Author:
george
Message:
  • Added: OpenGL PBO method.
Location:
GraphicTest
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/GraphicTest.lpi

    r211 r212  
    4242      </Item3>
    4343    </RequiredPackages>
    44     <Units Count="47">
     44    <Units Count="51">
    4545      <Unit0>
    4646        <Filename Value="GraphicTest.lpr"/>
    4747        <IsPartOfProject Value="True"/>
    4848        <UnitName Value="GraphicTest"/>
    49         <EditorIndex Value="4"/>
    5049        <WindowIndex Value="0"/>
    5150        <TopLine Value="1"/>
    52         <CursorPos X="30" Y="8"/>
    53         <UsageCount Value="43"/>
    54         <Loaded Value="True"/>
     51        <CursorPos X="51" Y="15"/>
     52        <UsageCount Value="56"/>
    5553      </Unit0>
    5654      <Unit1>
     
    6058        <ResourceBaseClass Value="Form"/>
    6159        <UnitName Value="UMainForm"/>
     60        <IsVisibleTab Value="True"/>
    6261        <EditorIndex Value="0"/>
    6362        <WindowIndex Value="0"/>
    64         <TopLine Value="67"/>
    65         <CursorPos X="29" Y="71"/>
    66         <UsageCount Value="43"/>
     63        <TopLine Value="186"/>
     64        <CursorPos X="3" Y="188"/>
     65        <UsageCount Value="56"/>
    6766        <Loaded Value="True"/>
    6867        <LoadedDesigner Value="True"/>
     
    7473        <TopLine Value="1"/>
    7574        <CursorPos X="42" Y="22"/>
    76         <UsageCount Value="16"/>
     75        <UsageCount Value="15"/>
    7776      </Unit2>
    7877      <Unit3>
     
    8079        <IsPartOfProject Value="True"/>
    8180        <UnitName Value="UPlatform"/>
    82         <EditorIndex Value="13"/>
    83         <WindowIndex Value="0"/>
    84         <TopLine Value="43"/>
     81        <WindowIndex Value="0"/>
     82        <TopLine Value="1"/>
    8583        <CursorPos X="1" Y="1"/>
    86         <UsageCount Value="43"/>
    87         <Loaded Value="True"/>
     84        <UsageCount Value="56"/>
    8885      </Unit3>
    8986      <Unit4>
     
    9390        <TopLine Value="244"/>
    9491        <CursorPos X="49" Y="262"/>
    95         <UsageCount Value="10"/>
     92        <UsageCount Value="9"/>
    9693      </Unit4>
    9794      <Unit5>
     
    10198        <TopLine Value="121"/>
    10299        <CursorPos X="57" Y="142"/>
    103         <UsageCount Value="10"/>
     100        <UsageCount Value="9"/>
    104101      </Unit5>
    105102      <Unit6>
     
    108105        <TopLine Value="85"/>
    109106        <CursorPos X="10" Y="102"/>
    110         <UsageCount Value="10"/>
     107        <UsageCount Value="9"/>
    111108      </Unit6>
    112109      <Unit7>
     
    115112        <TopLine Value="153"/>
    116113        <CursorPos X="1" Y="160"/>
    117         <UsageCount Value="10"/>
     114        <UsageCount Value="9"/>
    118115      </Unit7>
    119116      <Unit8>
     
    123120        <TopLine Value="1282"/>
    124121        <CursorPos X="15" Y="1299"/>
    125         <UsageCount Value="10"/>
     122        <UsageCount Value="9"/>
    126123      </Unit8>
    127124      <Unit9>
     
    130127        <TopLine Value="546"/>
    131128        <CursorPos X="11" Y="553"/>
    132         <UsageCount Value="10"/>
     129        <UsageCount Value="9"/>
    133130      </Unit9>
    134131      <Unit10>
     
    137134        <TopLine Value="389"/>
    138135        <CursorPos X="1" Y="411"/>
    139         <UsageCount Value="7"/>
     136        <UsageCount Value="6"/>
    140137      </Unit10>
    141138      <Unit11>
     
    144141        <TopLine Value="444"/>
    145142        <CursorPos X="1" Y="461"/>
    146         <UsageCount Value="10"/>
     143        <UsageCount Value="9"/>
    147144      </Unit11>
    148145      <Unit12>
     
    151148        <TopLine Value="14"/>
    152149        <CursorPos X="24" Y="21"/>
    153         <UsageCount Value="10"/>
     150        <UsageCount Value="9"/>
    154151      </Unit12>
    155152      <Unit13>
     
    158155        <TopLine Value="313"/>
    159156        <CursorPos X="24" Y="316"/>
    160         <UsageCount Value="10"/>
     157        <UsageCount Value="9"/>
    161158      </Unit13>
    162159      <Unit14>
     
    165162        <TopLine Value="149"/>
    166163        <CursorPos X="3" Y="151"/>
    167         <UsageCount Value="10"/>
     164        <UsageCount Value="9"/>
    168165      </Unit14>
    169166      <Unit15>
     
    173170        <TopLine Value="171"/>
    174171        <CursorPos X="3" Y="188"/>
    175         <UsageCount Value="9"/>
     172        <UsageCount Value="8"/>
    176173      </Unit15>
    177174      <Unit16>
    178175        <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/inc/systemh.inc"/>
    179176        <WindowIndex Value="0"/>
    180         <TopLine Value="243"/>
    181         <CursorPos X="3" Y="260"/>
    182         <UsageCount Value="10"/>
     177        <TopLine Value="496"/>
     178        <CursorPos X="11" Y="519"/>
     179        <UsageCount Value="13"/>
    183180      </Unit16>
    184181      <Unit17>
     
    186183        <IsPartOfProject Value="True"/>
    187184        <UnitName Value="UDrawMethod"/>
    188         <IsVisibleTab Value="True"/>
    189         <EditorIndex Value="3"/>
    190         <WindowIndex Value="0"/>
    191         <TopLine Value="157"/>
    192         <CursorPos X="22" Y="168"/>
    193         <UsageCount Value="37"/>
     185        <EditorIndex Value="2"/>
     186        <WindowIndex Value="0"/>
     187        <TopLine Value="237"/>
     188        <CursorPos X="29" Y="244"/>
     189        <UsageCount Value="50"/>
    194190        <Loaded Value="True"/>
    195191      </Unit17>
     
    198194        <IsPartOfProject Value="True"/>
    199195        <UnitName Value="UFastBitmap"/>
    200         <EditorIndex Value="2"/>
    201         <WindowIndex Value="0"/>
    202         <TopLine Value="33"/>
    203         <CursorPos X="37" Y="66"/>
    204         <UsageCount Value="37"/>
     196        <EditorIndex Value="1"/>
     197        <WindowIndex Value="0"/>
     198        <TopLine Value="101"/>
     199        <CursorPos X="19" Y="110"/>
     200        <UsageCount Value="50"/>
    205201        <Loaded Value="True"/>
    206202      </Unit18>
     
    210206        <TopLine Value="292"/>
    211207        <CursorPos X="1" Y="308"/>
    212         <UsageCount Value="13"/>
     208        <UsageCount Value="12"/>
    213209      </Unit19>
    214210      <Unit20>
     
    218214        <TopLine Value="279"/>
    219215        <CursorPos X="57" Y="292"/>
    220         <UsageCount Value="11"/>
     216        <UsageCount Value="10"/>
    221217      </Unit20>
    222218      <Unit21>
     
    226222        <TopLine Value="133"/>
    227223        <CursorPos X="1" Y="146"/>
    228         <UsageCount Value="11"/>
     224        <UsageCount Value="10"/>
    229225      </Unit21>
    230226      <Unit22>
     
    234230        <TopLine Value="584"/>
    235231        <CursorPos X="3" Y="597"/>
    236         <UsageCount Value="10"/>
     232        <UsageCount Value="9"/>
    237233      </Unit22>
    238234      <Unit23>
     
    241237        <TopLine Value="32"/>
    242238        <CursorPos X="10" Y="45"/>
    243         <UsageCount Value="12"/>
     239        <UsageCount Value="11"/>
    244240      </Unit23>
    245241      <Unit24>
     
    248244        <TopLine Value="51"/>
    249245        <CursorPos X="3" Y="53"/>
    250         <UsageCount Value="12"/>
     246        <UsageCount Value="11"/>
    251247      </Unit24>
    252248      <Unit25>
     
    256252        <TopLine Value="1314"/>
    257253        <CursorPos X="31" Y="1327"/>
    258         <UsageCount Value="12"/>
     254        <UsageCount Value="11"/>
    259255      </Unit25>
    260256      <Unit26>
     
    263259        <TopLine Value="1883"/>
    264260        <CursorPos X="10" Y="1896"/>
    265         <UsageCount Value="12"/>
     261        <UsageCount Value="11"/>
    266262      </Unit26>
    267263      <Unit27>
     
    270266        <TopLine Value="75"/>
    271267        <CursorPos X="31" Y="88"/>
    272         <UsageCount Value="10"/>
     268        <UsageCount Value="9"/>
    273269      </Unit27>
    274270      <Unit28>
     
    277273        <TopLine Value="309"/>
    278274        <CursorPos X="3" Y="311"/>
    279         <UsageCount Value="9"/>
     275        <UsageCount Value="8"/>
    280276      </Unit28>
    281277      <Unit29>
     
    285281        <TopLine Value="24"/>
    286282        <CursorPos X="3" Y="37"/>
    287         <UsageCount Value="11"/>
     283        <UsageCount Value="10"/>
    288284      </Unit29>
    289285      <Unit30>
     
    293289        <TopLine Value="271"/>
    294290        <CursorPos X="23" Y="292"/>
    295         <UsageCount Value="10"/>
     291        <UsageCount Value="9"/>
    296292      </Unit30>
    297293      <Unit31>
     
    301297        <TopLine Value="1"/>
    302298        <CursorPos X="41" Y="62"/>
    303         <UsageCount Value="19"/>
     299        <UsageCount Value="18"/>
    304300      </Unit31>
    305301      <Unit32>
     
    309305        <TopLine Value="23"/>
    310306        <CursorPos X="4" Y="35"/>
    311         <UsageCount Value="9"/>
     307        <UsageCount Value="8"/>
    312308      </Unit32>
    313309      <Unit33>
     
    316312        <TopLine Value="1456"/>
    317313        <CursorPos X="1" Y="1471"/>
    318         <UsageCount Value="9"/>
     314        <UsageCount Value="8"/>
    319315      </Unit33>
    320316      <Unit34>
     
    323319        <TopLine Value="780"/>
    324320        <CursorPos X="10" Y="793"/>
    325         <UsageCount Value="9"/>
     321        <UsageCount Value="8"/>
    326322      </Unit34>
    327323      <Unit35>
     
    331327        <TopLine Value="217"/>
    332328        <CursorPos X="3" Y="219"/>
    333         <UsageCount Value="9"/>
     329        <UsageCount Value="8"/>
    334330      </Unit35>
    335331      <Unit36>
    336332        <Filename Value="BGRABitmap/bgrabitmap.pas"/>
    337333        <UnitName Value="BGRABitmap"/>
    338         <EditorIndex Value="9"/>
    339334        <WindowIndex Value="0"/>
    340335        <TopLine Value="52"/>
    341336        <CursorPos X="23" Y="72"/>
    342         <UsageCount Value="13"/>
    343         <Loaded Value="True"/>
     337        <UsageCount Value="18"/>
    344338      </Unit36>
    345339      <Unit37>
    346340        <Filename Value="BGRABitmap/bgragtkbitmap.pas"/>
    347341        <UnitName Value="BGRAGtkBitmap"/>
    348         <EditorIndex Value="10"/>
    349342        <WindowIndex Value="0"/>
    350343        <TopLine Value="29"/>
    351344        <CursorPos X="36" Y="36"/>
    352         <UsageCount Value="13"/>
    353         <Loaded Value="True"/>
     345        <UsageCount Value="18"/>
    354346      </Unit37>
    355347      <Unit38>
    356348        <Filename Value="BGRABitmap/bgradefaultbitmap.pas"/>
    357349        <UnitName Value="BGRADefaultBitmap"/>
    358         <EditorIndex Value="11"/>
    359350        <WindowIndex Value="0"/>
    360351        <TopLine Value="3503"/>
    361352        <CursorPos X="31" Y="3506"/>
    362         <UsageCount Value="13"/>
    363         <Loaded Value="True"/>
     353        <UsageCount Value="18"/>
    364354      </Unit38>
    365355      <Unit39>
    366356        <Filename Value="BGRABitmap/bgraresample.pas"/>
    367357        <UnitName Value="bgraresample"/>
    368         <EditorIndex Value="12"/>
    369358        <WindowIndex Value="0"/>
    370359        <TopLine Value="629"/>
    371360        <CursorPos X="30" Y="638"/>
    372         <UsageCount Value="13"/>
    373         <Loaded Value="True"/>
     361        <UsageCount Value="18"/>
    374362      </Unit39>
    375363      <Unit40>
    376364        <Filename Value="../../../lazarus/components/opengl/glqtcontext.pas"/>
    377365        <UnitName Value="GLQTContext"/>
    378         <EditorIndex Value="6"/>
    379366        <WindowIndex Value="0"/>
    380367        <TopLine Value="1"/>
    381368        <CursorPos X="1" Y="1"/>
    382         <UsageCount Value="13"/>
    383         <Loaded Value="True"/>
     369        <UsageCount Value="18"/>
    384370      </Unit40>
    385371      <Unit41>
    386372        <Filename Value="../../../lazarus/components/opengl/openglcontext.pas"/>
    387373        <UnitName Value="OpenGLContext"/>
    388         <EditorIndex Value="7"/>
    389         <WindowIndex Value="0"/>
    390         <TopLine Value="387"/>
    391         <CursorPos X="19" Y="389"/>
    392         <UsageCount Value="13"/>
    393         <Loaded Value="True"/>
     374        <WindowIndex Value="0"/>
     375        <TopLine Value="135"/>
     376        <CursorPos X="34" Y="152"/>
     377        <UsageCount Value="18"/>
    394378      </Unit41>
    395379      <Unit42>
    396380        <Filename Value="../../../lazarus/components/opengl/glgtkglxcontext.pas"/>
    397381        <UnitName Value="GLGtkGlxContext"/>
    398         <EditorIndex Value="8"/>
    399         <WindowIndex Value="0"/>
    400         <TopLine Value="694"/>
    401         <CursorPos X="3" Y="696"/>
    402         <UsageCount Value="13"/>
    403         <Loaded Value="True"/>
     382        <WindowIndex Value="0"/>
     383        <TopLine Value="699"/>
     384        <CursorPos X="3" Y="704"/>
     385        <UsageCount Value="18"/>
    404386      </Unit42>
    405387      <Unit43>
    406388        <Filename Value="/usr/share/fpcsrc/2.4.0/packages/opengl/src/gl.pp"/>
    407389        <UnitName Value="GL"/>
    408         <EditorIndex Value="1"/>
    409         <WindowIndex Value="0"/>
    410         <TopLine Value="821"/>
    411         <CursorPos X="3" Y="838"/>
    412         <UsageCount Value="12"/>
     390        <EditorIndex Value="3"/>
     391        <WindowIndex Value="0"/>
     392        <TopLine Value="1502"/>
     393        <CursorPos X="3" Y="1499"/>
     394        <UsageCount Value="18"/>
    413395        <Loaded Value="True"/>
    414396      </Unit43>
    415397      <Unit44>
    416398        <Filename Value="../../../lazarus/lcl/include/customform.inc"/>
    417         <EditorIndex Value="5"/>
    418399        <WindowIndex Value="0"/>
    419400        <TopLine Value="898"/>
    420401        <CursorPos X="38" Y="928"/>
    421         <UsageCount Value="12"/>
    422         <Loaded Value="True"/>
     402        <UsageCount Value="17"/>
    423403      </Unit44>
    424404      <Unit45>
     
    427407        <TopLine Value="63"/>
    428408        <CursorPos X="43" Y="80"/>
    429         <UsageCount Value="10"/>
     409        <UsageCount Value="9"/>
    430410      </Unit45>
    431411      <Unit46>
     
    434414        <TopLine Value="21"/>
    435415        <CursorPos X="1" Y="38"/>
    436         <UsageCount Value="10"/>
     416        <UsageCount Value="9"/>
    437417      </Unit46>
     418      <Unit47>
     419        <Filename Value="/usr/share/fpcsrc/2.4.0/packages/opengl/src/glext.pp"/>
     420        <UnitName Value="GLext"/>
     421        <WindowIndex Value="0"/>
     422        <TopLine Value="2783"/>
     423        <CursorPos X="15" Y="2800"/>
     424        <UsageCount Value="15"/>
     425      </Unit47>
     426      <Unit48>
     427        <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/i386/i386.inc"/>
     428        <WindowIndex Value="0"/>
     429        <TopLine Value="185"/>
     430        <CursorPos X="11" Y="202"/>
     431        <UsageCount Value="13"/>
     432      </Unit48>
     433      <Unit49>
     434        <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/inc/generic.inc"/>
     435        <WindowIndex Value="0"/>
     436        <TopLine Value="245"/>
     437        <CursorPos X="3" Y="250"/>
     438        <UsageCount Value="13"/>
     439      </Unit49>
     440      <Unit50>
     441        <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/inc/system.inc"/>
     442        <WindowIndex Value="0"/>
     443        <TopLine Value="188"/>
     444        <CursorPos X="3" Y="190"/>
     445        <UsageCount Value="13"/>
     446      </Unit50>
    438447    </Units>
    439     <JumpHistory Count="29" HistoryIndex="28">
     448    <JumpHistory Count="30" HistoryIndex="29">
    440449      <Position1>
    441450        <Filename Value="UDrawMethod.pas"/>
    442         <Caret Line="135" Column="3" TopLine="118"/>
     451        <Caret Line="248" Column="1" TopLine="224"/>
    443452      </Position1>
    444453      <Position2>
    445         <Filename Value="UMainForm.pas"/>
    446         <Caret Line="48" Column="5" TopLine="31"/>
     454        <Filename Value="UDrawMethod.pas"/>
     455        <Caret Line="250" Column="1" TopLine="224"/>
    447456      </Position2>
    448457      <Position3>
    449         <Filename Value="UMainForm.pas"/>
    450         <Caret Line="196" Column="39" TopLine="176"/>
     458        <Filename Value="UDrawMethod.pas"/>
     459        <Caret Line="251" Column="1" TopLine="224"/>
    451460      </Position3>
    452461      <Position4>
    453         <Filename Value="UMainForm.pas"/>
    454         <Caret Line="103" Column="23" TopLine="77"/>
     462        <Filename Value="UDrawMethod.pas"/>
     463        <Caret Line="254" Column="1" TopLine="226"/>
    455464      </Position4>
    456465      <Position5>
    457         <Filename Value="UMainForm.pas"/>
    458         <Caret Line="92" Column="7" TopLine="77"/>
     466        <Filename Value="UDrawMethod.pas"/>
     467        <Caret Line="256" Column="1" TopLine="228"/>
    459468      </Position5>
    460469      <Position6>
    461470        <Filename Value="UDrawMethod.pas"/>
    462         <Caret Line="155" Column="7" TopLine="135"/>
     471        <Caret Line="257" Column="1" TopLine="229"/>
    463472      </Position6>
    464473      <Position7>
    465         <Filename Value="UMainForm.pas"/>
    466         <Caret Line="177" Column="41" TopLine="167"/>
     474        <Filename Value="UDrawMethod.pas"/>
     475        <Caret Line="105" Column="30" TopLine="98"/>
    467476      </Position7>
    468477      <Position8>
    469         <Filename Value="UMainForm.pas"/>
    470         <Caret Line="201" Column="25" TopLine="182"/>
     478        <Filename Value="UDrawMethod.pas"/>
     479        <Caret Line="260" Column="97" TopLine="233"/>
    471480      </Position8>
    472481      <Position9>
    473482        <Filename Value="UDrawMethod.pas"/>
    474         <Caret Line="161" Column="72" TopLine="135"/>
     483        <Caret Line="237" Column="1" TopLine="218"/>
    475484      </Position9>
    476485      <Position10>
    477486        <Filename Value="UDrawMethod.pas"/>
    478         <Caret Line="31" Column="23" TopLine="19"/>
     487        <Caret Line="224" Column="54" TopLine="207"/>
    479488      </Position10>
    480489      <Position11>
    481490        <Filename Value="UDrawMethod.pas"/>
    482         <Caret Line="140" Column="1" TopLine="131"/>
     491        <Caret Line="237" Column="1" TopLine="220"/>
    483492      </Position11>
    484493      <Position12>
    485494        <Filename Value="UDrawMethod.pas"/>
    486         <Caret Line="141" Column="3" TopLine="123"/>
     495        <Caret Line="240" Column="26" TopLine="223"/>
    487496      </Position12>
    488497      <Position13>
    489498        <Filename Value="UDrawMethod.pas"/>
    490         <Caret Line="179" Column="17" TopLine="153"/>
     499        <Caret Line="237" Column="117" TopLine="220"/>
    491500      </Position13>
    492501      <Position14>
    493         <Filename Value="UMainForm.pas"/>
    494         <Caret Line="204" Column="26" TopLine="174"/>
     502        <Filename Value="UDrawMethod.pas"/>
     503        <Caret Line="240" Column="1" TopLine="224"/>
    495504      </Position14>
    496505      <Position15>
    497506        <Filename Value="UDrawMethod.pas"/>
    498         <Caret Line="184" Column="44" TopLine="168"/>
     507        <Caret Line="281" Column="45" TopLine="263"/>
    499508      </Position15>
    500509      <Position16>
    501510        <Filename Value="UMainForm.pas"/>
    502         <Caret Line="200" Column="88" TopLine="177"/>
     511        <Caret Line="145" Column="49" TopLine="130"/>
    503512      </Position16>
    504513      <Position17>
    505514        <Filename Value="UDrawMethod.pas"/>
    506         <Caret Line="188" Column="5" TopLine="167"/>
     515        <Caret Line="182" Column="3" TopLine="173"/>
    507516      </Position17>
    508517      <Position18>
    509518        <Filename Value="UDrawMethod.pas"/>
    510         <Caret Line="165" Column="29" TopLine="153"/>
     519        <Caret Line="257" Column="42" TopLine="243"/>
    511520      </Position18>
    512521      <Position19>
    513         <Filename Value="../../../lazarus/lcl/include/customform.inc"/>
    514         <Caret Line="914" Column="40" TopLine="898"/>
     522        <Filename Value="UDrawMethod.pas"/>
     523        <Caret Line="336" Column="18" TopLine="311"/>
    515524      </Position19>
    516525      <Position20>
    517526        <Filename Value="UDrawMethod.pas"/>
    518         <Caret Line="164" Column="31" TopLine="156"/>
     527        <Caret Line="234" Column="38" TopLine="220"/>
    519528      </Position20>
    520529      <Position21>
    521         <Filename Value="UDrawMethod.pas"/>
    522         <Caret Line="197" Column="5" TopLine="176"/>
     530        <Filename Value="UMainForm.pas"/>
     531        <Caret Line="117" Column="26" TopLine="106"/>
    523532      </Position21>
    524533      <Position22>
    525534        <Filename Value="UMainForm.pas"/>
    526         <Caret Line="92" Column="8" TopLine="68"/>
     535        <Caret Line="180" Column="3" TopLine="178"/>
    527536      </Position22>
    528537      <Position23>
    529538        <Filename Value="UMainForm.pas"/>
    530         <Caret Line="96" Column="7" TopLine="68"/>
     539        <Caret Line="182" Column="9" TopLine="179"/>
    531540      </Position23>
    532541      <Position24>
    533         <Filename Value="UDrawMethod.pas"/>
    534         <Caret Line="168" Column="8" TopLine="139"/>
     542        <Filename Value="UMainForm.pas"/>
     543        <Caret Line="186" Column="92" TopLine="177"/>
    535544      </Position24>
    536545      <Position25>
    537         <Filename Value="../../../lazarus/lcl/include/customform.inc"/>
    538         <Caret Line="919" Column="30" TopLine="898"/>
     546        <Filename Value="UMainForm.pas"/>
     547        <Caret Line="183" Column="1" TopLine="177"/>
    539548      </Position25>
    540549      <Position26>
    541         <Filename Value="UDrawMethod.pas"/>
    542         <Caret Line="162" Column="18" TopLine="147"/>
     550        <Filename Value="UMainForm.pas"/>
     551        <Caret Line="184" Column="1" TopLine="177"/>
    543552      </Position26>
    544553      <Position27>
    545554        <Filename Value="UMainForm.pas"/>
    546         <Caret Line="96" Column="1" TopLine="78"/>
     555        <Caret Line="140" Column="29" TopLine="133"/>
    547556      </Position27>
    548557      <Position28>
    549         <Filename Value="UDrawMethod.pas"/>
    550         <Caret Line="184" Column="15" TopLine="164"/>
     558        <Filename Value="UMainForm.pas"/>
     559        <Caret Line="142" Column="29" TopLine="135"/>
    551560      </Position28>
    552561      <Position29>
    553         <Filename Value="UDrawMethod.pas"/>
    554         <Caret Line="194" Column="23" TopLine="177"/>
     562        <Filename Value="UMainForm.pas"/>
     563        <Caret Line="141" Column="29" TopLine="134"/>
    555564      </Position29>
     565      <Position30>
     566        <Filename Value="UMainForm.pas"/>
     567        <Caret Line="146" Column="20" TopLine="135"/>
     568      </Position30>
    556569    </JumpHistory>
    557570  </ProjectOptions>
  • GraphicTest/UDrawMethod.pas

    r211 r212  
    88  Classes, SysUtils, StdCtrls, ExtCtrls, UPlatform, UFastBitmap, Graphics,
    99  LCLType, IntfGraphics, fpImage, GraphType, BGRABitmap, BGRABitmapTypes,
    10   LclIntf, GL, OpenGLContext;
     10  LclIntf, GL, GLExt, OpenGLContext;
    1111
    1212type
     
    3030    OpenGLControl: TOpenGLControl;
    3131    TextureId: GLuint;
     32    procedure Init; virtual;
    3233    constructor Create; virtual;
    3334    destructor Destroy; override;
     
    102103    procedure SetBitmap(const AValue: TBitmap); override;
    103104    constructor Create; override;
     105    procedure Init; override;
    104106    destructor Destroy; override;
    105107    procedure DrawFrame(FastBitmap: TFastBitmap); override;
    106108  end;
    107109
     110  { TOpenGLPBOMethod }
     111
     112  TOpenGLPBOMethod = class(TDrawMethod)
     113    pboIds: array[0..1] of GLuint;
     114    Index, NextIndex: Integer;
     115    procedure SetBitmap(const AValue: TBitmap); override;
     116    procedure Init; override;
     117    constructor Create; override;
     118    destructor Destroy; override;
     119    procedure DrawFrame(FastBitmap: TFastBitmap); override;
     120  end;
    108121
    109122const
    110   DrawMethodClasses: array[0..7] of TDrawMethodClass = (
     123  DrawMethodClasses: array[0..8] of TDrawMethodClass = (
    111124    TCanvasPixels, TCanvasPixelsUpdateLock, TLazIntfImageColorsCopy,
    112125    TLazIntfImageColorsNoCopy, TBitmapRawImageData, TBitmapRawImageDataPaintBox,
    113     TBGRABitmapPaintBox, TOpenGLMethod);
     126    TBGRABitmapPaintBox, TOpenGLMethod, TOpenGLPBOMethod);
    114127
    115128implementation
     129
     130{ TOpenGLPBOMethod }
     131
     132procedure TOpenGLPBOMethod.SetBitmap(const AValue: TBitmap);
     133begin
     134  inherited SetBitmap(AValue);
     135end;
     136
     137//procedure glGenBuffersARB2 : procedure(n : GLsizei; buffers : PGLuint); extdecl;
     138
     139procedure TOpenGLPBOMethod.Init;
     140var
     141  DataSize: Integer;
     142  glExtensions: string;
     143begin
     144  OpenGLControl.MakeCurrent;
     145  DataSize := OpenGLControl.Width * OpenGLControl.Height * SizeOf(Integer);
     146//  glGenBuffersARB(Length(pboIds), PGLuint(pboIds));
     147  //if glext_LoadExtension('GL_ARB_pixel_buffer_object') then
     148  if Load_GL_ARB_vertex_buffer_object then begin
     149    glGenBuffersARB(2, @pboIds);
     150    glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboIds[0]);
     151    glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, DataSize, Pointer(0), GL_STREAM_READ_ARB);
     152    glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboIds[1]);
     153    glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, DataSize, Pointer(0), GL_STREAM_READ_ARB);
     154
     155  end else raise Exception.Create('GL_ARB_pixel_buffer_object not supported');
     156
     157  glEnable(GL_TEXTURE_2D);
     158  glBindTexture(GL_TEXTURE_2D, TextureId);
     159    //glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     160    //glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
     161    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     162    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     163    glTexImage2D(GL_TEXTURE_2D, 0, 4, OpenGLControl.Width, OpenGLControl.Height,
     164      0, GL_RGBA, GL_UNSIGNED_BYTE, OpenGLBitmap);
     165end;
     166
     167constructor TOpenGLPBOMethod.Create;
     168begin
     169  inherited Create;
     170  Caption := 'OpenGL PBO';
     171  PaintObject := poOpenGL;
     172//  SetLength(pboIds, 2);
     173  Index := 0;
     174  NextIndex := 1;
     175end;
     176
     177destructor TOpenGLPBOMethod.Destroy;
     178begin
     179  inherited Destroy;
     180end;
     181
     182procedure TOpenGLPBOMethod.DrawFrame(FastBitmap: TFastBitmap);
     183var
     184  X, Y: Integer;
     185  P: PInteger;
     186  R: PInteger;
     187  Ptr: ^GLubyte;
     188  TextureShift: TPoint;
     189  TextureShift2: TPoint;
     190const
     191  GL_CLAMP_TO_EDGE = $812F;
     192begin
     193  // "index" is used to read pixels from framebuffer to a PBO
     194  // "nextIndex" is used to update pixels in the other PBO
     195  Index := (Index + 1) mod 2;
     196  NextIndex := (Index + 1) mod 2;
     197
     198  glLoadIdentity;
     199
     200  glBindTexture(GL_TEXTURE_2D, TextureId);
     201    //glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     202    //glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
     203    //glTexImage2D(GL_TEXTURE_2D, 0, 4, OpenGLControl.Width, OpenGLControl.Height,
     204    //  0, GL_RGBA, GL_UNSIGNED_BYTE, OpenGLBitmap);
     205    //glTexImage2D(GL_TEXTURE_2D, 0, 4, 512, 256,
     206    //0, GL_RGBA, GL_UNSIGNED_BYTE, OpenGLBitmap);
     207
     208  // bind the texture and PBO
     209  //glBindTexture(GL_TEXTURE_2D, textureId);
     210  glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pboIds[index]);
     211
     212  // copy pixels from PBO to texture object
     213  // Use offset instead of ponter.
     214  glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, OpenGLControl.Width, OpenGLControl.Height,
     215    GL_BGRA, GL_UNSIGNED_BYTE, Pointer(0));
     216
     217
     218  // bind PBO to update texture source
     219  glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pboIds[nextIndex]);
     220
     221  // Note that glMapBufferARB() causes sync issue.
     222  // If GPU is working with this buffer, glMapBufferARB() will wait(stall)
     223  // until GPU to finish its job. To avoid waiting (idle), you can call
     224  // first glBufferDataARB() with NULL pointer before glMapBufferARB().
     225  // If you do that, the previous data in PBO will be discarded and
     226  // glMapBufferARB() returns a new allocated pointer immediately
     227  // even if GPU is still working with the previous data.
     228  glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, OpenGLControl.Width * OpenGLControl.Height * SizeOf(Integer), Pointer(0), GL_STREAM_DRAW_ARB);
     229
     230  // map the buffer object into client's memory
     231  ptr := glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY_ARB);
     232  if Assigned(ptr) then begin
     233    // update data directly on the mapped buffer
     234    P := PInteger(Ptr);
     235    with FastBitmap do
     236    for Y := 0 to Size.Y - 2 do begin
     237      R := P;
     238      for X := 0 to Size.X - 1 do begin
     239        R^ := NoSwapBRComponent(Pixels[X, Y]) or $ff000000;
     240        Inc(R);
     241      end;
     242      Inc(P, Size.X);
     243    end;
     244    glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB);
     245  end;
     246
     247  // it is good idea to release PBOs with ID 0 after use.
     248  // Once bound with 0, all pixel operations are back to normal ways.
     249  glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
     250
     251  glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
     252  //glRotatef(30.0, 0, 0, 1.0);
     253  glTranslatef(-OpenGLControl.Width / 2, -OpenGLControl.Height / 2, 0.0);
     254  glBindTexture(GL_TEXTURE_2D, TextureId);
     255
     256  TextureShift := Point(0, 0);
     257  TextureShift2 := Point(0, 0);
     258  glBegin(GL_QUADS);
     259    glColor3ub(255, 255, 255);
     260    glTexCoord2f(TextureShift.X, TextureShift.Y);
     261    glVertex3f(TextureShift2.X, TextureShift2.Y, 0);
     262    glTexCoord2f(TextureShift.X + OpenGLControl.Width div 2, TextureShift.Y);
     263    glVertex3f(TextureShift2.X + OpenGLControl.Width, TextureShift2.Y, 0);
     264    glTexCoord2f(TextureShift.X + OpenGLControl.Width div 2, TextureShift.Y + OpenGLControl.Height div 2);
     265    glVertex3f(TextureShift2.X + OpenGLControl.Width, TextureShift2.Y + OpenGLControl.Height, 0);
     266    glTexCoord2f(TextureShift.X, TextureShift.Y + OpenGLControl.Height div 2);
     267    glVertex3f(TextureShift2.X, TextureShift2.Y + OpenGLControl.Height, 0);
     268  glEnd();
     269
     270  OpenGLControl.SwapBuffers;
     271end;
    116272
    117273{ TOpenGLMethod }
     
    127283  Caption := 'OpenGL';
    128284  PaintObject := poOpenGL;
     285end;
     286
     287procedure TOpenGLMethod.Init;
     288begin
     289  inherited Init;
     290  //OpenGLControl.MakeCurrent;
    129291end;
    130292
     
    142304  GL_CLAMP_TO_EDGE = $812F;
    143305begin
    144 (*  glEnable(GL_TEXTURE_2D);          // enables 2d textures
    145     glClearColor(0.0,0.0,0.0,1.0);    // sets background color
    146     glClearDepth(1.0);
    147     glDepthFunc(GL_LEQUAL);           // the type of depth test to do
    148     glEnable(GL_DEPTH_TEST);          // enables depth testing
    149     glShadeModel(GL_SMOOTH);          // enables smooth color shading
    150     {blending}
    151     glColor4f(1.0,1.0,1.0,0.5);       // Full Brightness, 50% Alpha ( NEW )
    152     glBlendFunc(GL_SRC_ALPHA, GL_ONE);
    153     glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
    154 *)
    155 
     306  glLoadIdentity;
    156307  glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
    157308  //glLoadIdentity;             { clear the matrix }
    158309  //glTranslatef(0.0, 0.0, -3.0);  // -2.5); { viewing transformation }
    159 
    160   //glLoadIdentity;             { clear the matrix }
    161310
    162311  P := OpenGLBitmap;
     
    172321  end;
    173322
    174     glLoadIdentity;
    175323    //glRotatef(30.0, 0, 0, 1.0);
    176324    glTranslatef(-OpenGLControl.Width div 2, -OpenGLControl.Height div 2, 0.0);
     
    459607end;
    460608
     609procedure TDrawMethod.Init;
     610begin
     611
     612end;
     613
    461614constructor TDrawMethod.Create;
    462615begin
  • GraphicTest/UFastBitmap.pas

    r206 r212  
    3333  end;
    3434
     35  { TFastBitmap3 }
     36
     37  TFastBitmap3 = class
     38  private
     39    FPixelsData: PByte;
     40    FSize: TPoint;
     41    procedure SetSize(const AValue: TPoint);
     42  public
     43    constructor Create;
     44    destructor Destroy; override;
     45    procedure RandomImage;
     46    property Size: TPoint read FSize write SetSize;
     47    function GetPixelAddress(X, Y: Integer): PFastBitmapPixel; inline;
     48    function GetPixelSize: Integer; inline;
     49  end;
     50
    3551  TFastBitmap2 = class
    3652  private
     
    6480end;
    6581
     82{ TFastBitmap3 }
     83
     84procedure TFastBitmap3.SetSize(const AValue: TPoint);
     85begin
     86  if (FSize.X = AValue.X) and (FSize.Y = AValue.X) then Exit;
     87  FSize := AValue;
     88  FPixelsData := ReAllocMem(FPixelsData, FSize.X * FSize.Y * SizeOf(TFastBitmapPixel));
     89end;
     90
     91constructor TFastBitmap3.Create;
     92begin
     93
     94end;
     95
     96destructor TFastBitmap3.Destroy;
     97begin
     98  inherited Destroy;
     99end;
     100
     101procedure TFastBitmap3.RandomImage;
     102var
     103  I, X, Y: Integer;
     104  PRow: PFastBitmapPixel;
     105  PPixel: PFastBitmapPixel;
     106begin
     107  for I := 0 to 2 do begin
     108    PRow := GetPixelAddress(I * (Size.X div 3), 0);
     109    for Y := 0 to (Size.Y div 2) - 1 do begin
     110      PPixel := PRow;
     111      for X := 0 to (Size.X div 3) - 1 do begin
     112        PPixel^ := 255 shl (I * 8);
     113        Inc(PPixel);
     114      end;
     115      Inc(PRow, Size.X);
     116    end;
     117  end;
     118
     119  PRow := GetPixelAddress(0, Size.Y div 2);
     120  for Y := (Size.Y div 2) to Size.Y - 1 do begin
     121    PPixel := PRow;
     122    for X := 0 to Size.X - 1 do begin
     123      PPixel^ := Random(256) or (Random(256) shl 16) or (Random(256) shl 8);
     124      Inc(PPixel);
     125    end;
     126    Inc(PRow, Size.X);
     127  end;
     128end;
     129
     130function TFastBitmap3.GetPixelAddress(X, Y: Integer): PFastBitmapPixel;
     131begin
     132  Result := PFastBitmapPixel(FPixelsData) + Y * FSize.X + X;
     133end;
     134
     135function TFastBitmap3.GetPixelSize: Integer;
     136begin
     137  Result := SizeOf(TFastBitmapPixel);
     138end;
     139
    66140{ TFastBitmap2 }
    67141
  • GraphicTest/UMainForm.lfm

    r211 r212  
    11object MainForm: TMainForm
    22  Left = 214
    3   Height = 338
     3  Height = 393
    44  Top = 106
    55  Width = 680
    66  Caption = 'Graphic test'
    7   ClientHeight = 338
     7  ClientHeight = 393
    88  ClientWidth = 680
    99  OnClose = FormClose
     
    1313  object PageControl1: TPageControl
    1414    Left = 312
    15     Height = 318
     15    Height = 373
    1616    Top = 16
    1717    Width = 365
     
    2222    object TabSheet1: TTabSheet
    2323      Caption = 'TImage'
    24       ClientHeight = 291
     24      ClientHeight = 346
    2525      ClientWidth = 361
    2626      object Image1: TImage
     
    3434    object TabSheet2: TTabSheet
    3535      Caption = 'TPaintBox'
    36       ClientHeight = 291
     36      ClientHeight = 346
    3737      ClientWidth = 361
    3838      object PaintBox1: TPaintBox
     
    101101  object ListView1: TListView
    102102    Left = 8
    103     Height = 166
    104     Top = 168
     103    Height = 253
     104    Top = 136
    105105    Width = 296
    106106    Anchors = [akTop, akLeft, akBottom]
     
    122122  end
    123123  object ButtonBenchmark: TButton
    124     Left = 9
     124    Left = 229
    125125    Height = 25
    126     Top = 136
     126    Top = 101
    127127    Width = 75
    128128    Caption = 'Benchmark'
     
    147147    ParentColor = False
    148148  end
     149  object FloatSpinEdit1: TFloatSpinEdit
     150    Left = 175
     151    Height = 21
     152    Top = 103
     153    Width = 50
     154    Increment = 1
     155    MaxValue = 100
     156    MinValue = 0
     157    TabOrder = 6
     158    Value = 1
     159  end
    149160  object Timer1: TTimer
     161    Interval = 500
    150162    OnTimer = Timer1Timer
    151163    left = 209
  • GraphicTest/UMainForm.pas

    r211 r212  
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    99  ExtCtrls, StdCtrls, DateUtils, UPlatform, LCLType, IntfGraphics, fpImage,
    10   Math, GraphType, Contnrs, LclIntf, UFastBitmap, UDrawMethod, GL, OpenGLContext;
     10  Math, GraphType, Contnrs, LclIntf, Spin, UFastBitmap, UDrawMethod, GL,
     11  OpenGLContext;
    1112
    1213const
     
    2324    ButtonStop: TButton;
    2425    ComboBox1: TComboBox;
     26    FloatSpinEdit1: TFloatSpinEdit;
    2527    Image1: TImage;
    2628    Label1: TLabel;
     
    4749    TextureId: GLuint;
    4850    TextureData: Pointer;
     51    MethodIndex: Integer;
    4952    procedure OpenGLControl1Resize(Sender: TObject);
    5053    procedure InitGL;
     
    104107    NewDrawMethod.OpenGLBitmap := TextureData;
    105108    NewDrawMethod.OpenGLControl := OpenGLControl1;
     109    NewDrawMethod.Init;
    106110    DrawMethods.Add(NewDrawMethod);
    107111    ComboBox1.Items.Add(NewDrawMethod.Caption);
     
    112116procedure TMainForm.ButtonStartClick(Sender: TObject);
    113117begin
     118  MethodIndex := ComboBox1.ItemIndex;
    114119  ButtonStop.Enabled := True;
    115120  ButtonStart.Enabled := False;
    116121  Timer1.Enabled := True;
    117   if ComboBox1.ItemIndex >= 0 then
    118   with TDrawMethod(DrawMethods[ComboBox1.ItemIndex]) do begin
     122  if MethodIndex >= 0 then
     123  with TDrawMethod(DrawMethods[MethodIndex]) do begin
    119124    PageControl1.TabIndex := Integer(PaintObject);
    120125    Application.ProcessMessages;
     
    132137  NewItem: TListItem;
    133138  I: Integer;
    134 begin
     139  C: Integer;
     140  StartTime: TDateTime;
     141begin
     142  Timer1.Enabled := True;
    135143  with ListView1, Items do
    136144  try
    137     BeginUpdate;
     145    //BeginUpdate;
    138146    Clear;
    139147    for I := 0 to DrawMethods.Count - 1 do
    140148    with TDrawMethod(DrawMethods[I]) do begin
     149      MethodIndex := I;
    141150      PageControl1.TabIndex := Integer(PaintObject);
    142       Application.ProcessMessages;
    143       DrawFrameTiming(TFastBitmap(Scenes[0]));
    144       Application.ProcessMessages;
    145       DrawFrameTiming(TFastBitmap(Scenes[0]));
     151      StartTime := NowPrecise;
     152      repeat
     153        DrawFrameTiming(TFastBitmap(Scenes[SceneIndex]));
     154        SceneIndex := (SceneIndex + 1) mod Scenes.Count;
     155        Application.ProcessMessages;
     156      until (NowPrecise - StartTime) > OneSecond * FloatSpinEdit1.Value;
    146157      NewItem := Add;
    147158      NewItem.Caption := Caption;
     
    150161    end;
    151162  finally
    152     EndUpdate;
     163    //EndUpdate;
    153164  end;
    154165end;
     
    175186procedure TMainForm.Timer1Timer(Sender: TObject);
    176187begin
    177   if (ComboBox1.ItemIndex >= 0) then
    178   with TDrawMethod(DrawMethods[ComboBox1.ItemIndex]) do begin
     188  if (MethodIndex >= 0) then
     189  with TDrawMethod(DrawMethods[MethodIndex]) do begin
    179190    if (FrameDuration > 0) then
    180191      Label2.Caption := FloatToStr(RoundTo(1 / (FrameDuration / OneSecond), -3))
     
    194205  glLoadIdentity;
    195206  glOrtho(0, OpenGLControl1.Width, OpenGLControl1.Height, 0, 0, 1);
     207//  glOrtho(0, 1, 1, 0, 0, 1);
    196208  glMatrixMode(GL_MODELVIEW);
    197209  glLoadIdentity();
Note: See TracChangeset for help on using the changeset viewer.