What is "OpenGLBitmap" in Fast direct pixel access wiki? lazarus / 70-OpenGL ---------------------------------------------------------------------- Milsa · 2014-02-15 15:48 Wiki: http://wiki.freepascal.org/Fast_direct_pixel_access#TBitmap.RawImage Part: OpenGL PBO Procedure: InitGL I do not know what is OpenGLBitmap identifier in this procedure. How can I inicialize this variable? ---------------------------------------------------------------------- Leledumbo · 2014-02-15 15:56 You could guess from how it's used: Code: [Select]glTexImage2D(GL_TEXTURE_2D, 0, 4, OpenGLControl1.Width, OpenGLControl1.Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, OpenGLBitmap);or from the previous section: Code: [Select]P: PInteger; ... P := OpenGLBitmap;So it's an array of bytes containing the bitmap values. ---------------------------------------------------------------------- Milsa · 2014-02-15 16:39 OpenGLBitmap is pointer. I know. But it is pointer to what data? This article is about fast graphic. FastBitmap is my source image, OpenGLControl is destination image. What image is OpenGLBitmap? It is pointer to OpenGLControl bitmap data? How to initialize this pointer? ---------------------------------------------------------------------- User137 · 2014-02-15 20:42 Code: [Select]var data: pointer; ... // You have 4 bytes per pixel if your data must be RGBA format, each channel 1 byte. data:=allocmem(Width*Height*4); // Finally Freemem(data);glTexImage2D() function transfers the data contents to video memory, so you don't need it in normal memory anymore. Or you might even have: Code: [Select]type   TRGBArecord = packed record     r,g,b,a: byte;   end; var data: array[0..255, 0..255] of TRGBArecord;You have a few options on how to approach this... ---------------------------------------------------------------------- Leledumbo · 2014-02-16 05:23 QuoteOpenGLBitmap is pointer. I know. But it is pointer to what data?read this, last parameter. ---------------------------------------------------------------------- Milsa · 2014-02-18 18:53 IMHO, copying from FastBitmap to OpenGLBitmap is loss of CPU time. I think that faster method is using FastBitmap directly instead of OpenGLBitmap pointer. It needs some code editing (changes in TFastBitmap for compatibility with OpenGL raw data). Or not? I do not still understand OpenGL. I am learning to work with it. ---------------------------------------------------------------------- User137 · 2014-02-18 19:01 It depends on format of your image data. If you use .JPG, then best option is a class that can directly convert the image to OpenGL data. For .AVI again you would have something else. ---------------------------------------------------------------------- Leledumbo · 2014-02-19 01:38 QuoteIMHO, copying from FastBitmap to OpenGLBitmap is loss of CPU time. I think that faster method is using FastBitmap directly instead of OpenGLBitmap pointer. It needs some code editing (changes in TFastBitmap for compatibility with OpenGL raw data). Or not?If it's required in order to pass the pixel data to OpenGL routines, then there's no other way. You can directly pass the pixels without it. OpenGL routines have no idea about TFastBitmap.Pixels structure.