Hi,
I am learning OpenGL in Delphi, experimenting with code others had written.
I found out a way to display information to the user, by writing the text to a bitmap and displaying the bitmap.
The existing code loaded the bitmap from a file, so I have been using the same technique (as below).
What I am wanting to know is how to assign the bitmap directly to the PTAUX_RGBImageRec texture (without needing to save it first).
var Bmp: TBitmap;
texture: PTAUX_RGBImageRec;
TextArry: ARRAY[0..9] OF GLuint;
// Update User
Bmp:= TBitmap.Create;
Bmp.Width:= 100;
Bmp.Height:= 30;
Bmp.Canvas.Brush.Style:= bsClear;
Bmp.Canvas.Font.Color:= clBlack;
Bmp.Canvas.Font.Name:= 'Roboto';
Bmp.Canvas.Font.Size:= 16;
Bmp.Canvas.TextOut(2, 2,'Info to the user');
Bmp.SaveToFile('imgXX.bmp');
Bmp.Free;
// Sign
texture:= auxDIBImageLoadA('imgXX.bmp');
glGenTextures(1, TextArry[9]);
glBindTexture(GL_TEXTURE_2D, TextArry[8]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 3, texture^.sizeX, texture^.sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, texture^.data);
(Note: I googled for info on this, but was unable to find the answer.)