0
0

Hello,
I recently downloaded The FMODEx API. I was able to get it working in the command line environment, but when I went to use it in an OpenGL program I made. OpenGl could no longer load the texture files. This occured when I went to the project properties and added the working directory of the FMOD dll(Project->Properties->Debugging). I then traced it to the CreateFile function returning an invalid handle in one of the OpenGL files.

GLMain. cpp code:
[code:1szvnjp0]
glBindTexture(GL_TEXTURE_2D,nTexture[0]);
pBytes = gltReadBMPBits("SUN.BMP",&nWidth,&nHeight);
[/code:1szvnjp0]
Which then leads to this code in the OpenGL code file:
[code:1szvnjp0]
hFileHandle = CreateFile(szFileName,GENERIC_READ,FILE_SHARE_READ,
NULL,OPEN_EXISTING,FILE_FLAG_SEQUENTIAL_SCAN,NULL);
[/code:1szvnjp0]

When I take the FMODEx.dll out out of the working directory it goes back to working fine.

          Thanks in advance for any help or recommendations you will be able to provide
  • You must to post comments
0
0

I’m guessing your "sun.bmp" file is not in the working directory you have specified? Shouldn’t this be a simple matter of providing a relative path to that image?

  • You must to post comments
0
0

actually the bmp file is in the project directory itself, and it loads fine when I just use OpenGL by itself. but when I right click on the project in the solution explorer in VS 2005 and add the directory of the FMODEx.dll to the debugging working directory. it stops loading the textures

  • You must to post comments
0
0

By changing the working directory you are changing where you are looking for the image file. You should have the FMOD .dll file sitting next to the exe for your app. Any paths in code to bitmaps should be relative to your executable.

  • You must to post comments
0
0

ahh ok thanks for the info
I went back and put the fmod dll in the project directory and it fixed the problem.

       Thank you
  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.