Hi!
Yes, you got the three steps correct!
[quote]Assuming that is correct, I need to look into setting up a primary and secondary surface, right? In which case, I probably need to find out how to load bitmaps... [quote]
In process next frame you are passed a pointer to the secondary surface (pBackbuffer), and you can draw everything to that surface. When the loop exits ProcessNextFrame() the contents of the backbuffer is copied to the display (primary surface).
You can load bitmaps quite easily using CreateSurface(). Try adding a member variable "CGapiSurface m_testsurface;" to the "MyApplication.h" header file (under "attributes"). Then call CreateSurface using the doc at:
http://www.gapidraw.com/doc/300/doc-surface-frame.htm
- Code:
HRESULT CreateSurface(DWORD dwFlags, const TCHAR* pImageFile);
HRESULT CreateSurface(DWORD dwFlags, BYTE* pImageFileMem, DWORD dwImageFileSize);
HRESULT CreateSurface(DWORD dwFlags, HINSTANCE hInstance, DWORD dwResourceID, const TCHAR* pResourceType = NULL);
HRESULT CreateSurface(CGapiSurface* pSrcSurface);
HRESULT CreateSurface(DWORD dwFlags, DWORD dwWidth, DWORD dwHeight);
For example, to load a bitmap from file, add the following in CreateSysMemSurfaces:
m_testsurface.CreateSurface(GDSURFACE_SYSTEMMEMORY, TEXT("\\mypicture.png"));
to load from a resource you have added to the project, add:
m_testsurface.CreateSurface(GDSURFACE_SYSTEMMEMORY, hInstance, IDR_MYRESOURCENAME, TEXT("RESOURCESECTION"));
If you add a "PNG" image to your project, you are asked to name the section where you want to add it. Rename RESOURCESECTION above with the name of the section.
So. To finally draw your bitmap, in ProcessNextFrame, add:
pBackbuffer->BltFast(0, 0, & m_testsurface, NULL, 0, NULL);
That's it, and a good starting point for a game...