Bonjour,
Bien qu'ayant regardé la FAQ Delphi sur les pointeurs, je n'arrive pas à faire ce que je veux. En gros j'ai crée un buffer qui contient des éléments et je veux les parcourir. Voici les portions de code avec une instruction fausse mais qui montre ce que je veux faire :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 type TPixel = array[0..2] of Byte; PTPixel = ^TPixel; TPixelData = array of array of TPixel; var myPixel : TPixel; PixelData : TPixelData; buffer, bufferIt : Pointer; GetMem(buffer, Img.Width * Img.Height * SizeOf(TPixel)); glReadPixels(0, 0, Img.Width - 1, Img.Height - 1, GL_RGB, GL_UNSIGNED_BYTE, buffer); bufferIt := buffer; for i := 0 to Img.Width - 1 do begin for j := 0 to Img.Height - 1 do begin pixelData[i][j] := (TPixel (bufferIt^)); bufferIt := bufferIt + 1; // Op non applicable à ce type d'opérande. end; end;









Répondre avec citation


Partager