VBGamer |
|||||||||||||||||||||||||||
RE: DirectX 7 surfaces&buffers Adam Hoult (1 reply, 1 views) (2000-May-30) Hi,
You should place the name in quotes (as far as I am aware), but you using the file parameter wrong, you should either leave it blank, or pass the executable name (as shown in the sample code i have posted below)
Here is how it should work (try this first)
Set BaseSprite = DD.CreateSurfaceFromResource(App.Path & "\MyEXE.exe", "BASE", BaseDesc)
or
Set BaseSprite = DD.CreateSurfaceFromResource("", "BASE", BaseDesc)
The latter will use the current resource file. This should also be the case for DirectSound.
Of course loading from a resource will only work from the Compiled Executable, not from within the ide, in this case can set a flag to let your program know if you are in the ide or compiled executable, then you can simply either load it from a bmp etc or if compiled, use the resource file. (There are other ways)
But anyway if you are still unsure take a look at the ClubMet example that comes with the DX7 SDK (in DMusic\Src\ClubNet). If you don't have that sample let me know. (It loads a surface from a resource file).
HTH
Adam
|