Are you seriously trying to interface directly through the GLX protocol? That seems absurdly complicated. Do you have a reason for doing this?
Of course the command parameters and protocol parameters are different - GLX includes a wire protocol, it has to send client state such as pixel store to the server in addition to the parameters you actually pass to the underlying GL API command. To implement GL command -> GLX protocol, you really need to implement a state machine for client state at minimum.
Update:
Since the author of Node.js-x11 has expressed interest in not implementing pixel store state tracking, I have included a table with the default values for all of the parameters you will need to implement this yourself.
pname Type Initial Value Valid Range
-------------------------------------------------------------------
GL_UNPACK_SWAP_BYTES boolean false true or false
GL_UNPACK_LSB_FIRST boolean false true or false
GL_UNPACK_ROW_LENGTH integer 0 [0,oo)
GL_UNPACK_SKIP_ROWS integer 0 [0,oo)
GL_UNPACK_SKIP_PIXELS integer 0 [0,oo)
GL_UNPACK_ALIGNMENT integer 4 1, 2, 4, or 8
You can either change the API binding to include these as parameters (very messy), or always assume that they are default. But you cannot implement glTexImage2D (...)
over GLX without this state information.
There are not a whole lot of client-side states that you need to track to communicate with a GLX server for a basic application, but pixel store is definitely one of them if you want textures. Most other states are server-side, those include anything you can save/restore using glPushAttrib (...)
and glPopAttrib (...)
.