PocketMatrix forums

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

Getting started with the GX library/GAPI

G'day,

When I try compiling some source code that has the include gx.h, the compiler stops and complains about the following line ?:

GXDLL_API GXDisplayProperties GXGetDisplayProperties();

Is there something I should be removing from the compiler options?
Moose or Chuck · 14 Mar 2001, 06:28 UTC
I'm not sure... try redownloading the files from:
http://www.microsoft.com/mobile/downloads/developer/gapi.asp
and put them into the appropriate directories, make sure the LIB is in there too. I'm sure you knew all of that, but whatever.
Unfortunately there isn't much info out there. MSDN basically contains just the function reference. MS does have a single example that shows how to draw a blank screen using GAPI. Wow, thanks Microsoft.
I will be posting the source to Pocket Quake 0.051 today. It has pretty good, all purpose GAPI routines. The portions of interest are:
vid_ppc.c:
RGB565()
RGB555()
VID_SetPalette()
VID_GetScreenBuf()
VID_ReleaseScreenBuf()
VID_Update()

Dan East
Moose, did that (lib placing, etc)

Dan, d/l the src but no joy.

I'll try looking for some sample code in msdn.

Thanks.
Mark, if you are including gx.h in a C build (as opposed to C++), then you will get compilation errors. Microsoft did not write gx.h so it will compile under C. You have to modify gx.h by adding struct to the following 2 function prototypes so they read as follows:

//The following two lines modified by Dan East to make this header C compatible:
//Added "struct" to the following two prototypes:
GXDLL_API struct GXDisplayProperties GXGetDisplayProperties();
GXDLL_API struct GXKeyList GXGetDefaultKeys(int iOptions);

Dan East
Ian Ferguson · 27 Apr 2001, 10:44 UTC
Thanks Dan for posting the source. I will take a good look at your GAPI routines. I have already looked at Jakko B's Lemmings source so it's starting to become clearer. ( I'm an assembler programmer who was forced to use C & now C++ so using GAPI should be almost like the old days )

Ian