I just ran into some strange problem. I am trying to load a model in OpenGL, and in the part where I load textures, I use the auxDIBImageLoadA(dibfile:PWideChar) function auxDIBImageLoadA(dibfile:PWideChar) . Here is my code calling it
procedure CreateTexture(var textureArray: array of UINT; strFileName: string; textureID: integer); // Vytvoลพenรญ textury var pBitmap: PTAUX_RGBImageRec; begin if strFileName = '' then exit; MessageBox(0,PWideChar(strFileName),nil,SW_SHOWNORMAL); pBitmap := auxDIBImageLoadA(PWideChar(strFileName)); if pBitmap = nil then exit; ...
MessageBox is for management purposes only. Here's what happens: I run the application, a window appears with "FACE.BMP" . Good. But then I get the error message "Failed to open DIB file F" . When I set stFileName to xFACE.BMP , I get "Failed to open DIB file x" . Therefore, for some reason, it seems that the function accepts only the first char.
Am I missing something? I use glaux.dll, which I downloaded 5 times from different sources, so it should be error free (I hope every OpenGL site linked to it).
source share