PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Resources

Hello!
In examples, all resources are attached to the program, but can i load resources from files?




Thanks,GRoZ
Sure can. Here's an example:

Code:

CGapiSurface m_surface;
int r = LoadString(hInstance, IDS_FILE_GFX_IMAGE, file, sizeof(file)/sizeof(TCHAR)-1); if(r == 0) return E_FAIL;
HRESULT hr = m_surface.CreateSurface(0, getFullPath(file)); if(hr != GD_OK) return hr;


Here, we declare m_surface, load the filespec string from the string table, then create the surface using the full path for the filespec.
Oh, thank you very much!