Hello,
I am trying to write a porting layer for multiple clients to run in a server. Every client has its own opengl code, but the output will be on a server (so as the graphics card).
First of all, I am using mygl API’s rather than gl API’s. I save all of the mygls in shared buffers, and while clients are filling their buffers, server is flushing. Let me try to explain:
////////////////Client1://////////////////////
…
myGLuint texture[5];
myglGenTextures(5, texture);
…
myglBindTexture(MY_GL_TEXTURE_2D, texture[2]);
…
myglFlush();
//////////////////////////////////////////////
/////////////////////Porting Layer ///////
myglGenTextures(…, …)
{
// storing function name and params in a buffer
}
myglBindTexture(…, …);
{
// storing function name and params in a shared buffer
}
////////////////////////////////////////////////
///////////SERVER//////////////////////////
myParsingBuffer() // parsing the shared buffer
{
if (function_name is myglBindTexture with param1, param2)
{
glBindTexture(param1, param2);
}
…
// the same for all gl APIs and params.
}
/////////////////////////////////////////////
The problem is that, after calling glGenTextures(5, texture), I am calling glBindTextures but its texture parameter is always zero because I am setting it in server side. For example in normal conditions:
glGenTextures(5, texture); // texture[] is set to {1,2,3,4,5}
…
glBindTexture(GL_TEXTURE_2D, texture[2]); // texture[2] is 3 so real function call is glBindTexture(GL_TEXTURE_2D, 3)
But in my case:
myglGenTextures(5, texture); // texure is still {0,0,0,0,0} because real gl function is called and executed in server side
…
myglBindTexture(MY_GL_TEXTURE_2D, texture[2]); // texture[2] is 0 so real function call is myglBindTexture(GL_TEXTURE_2D, 0) which calls glBindTexture(GL_TEXTURE_2D, 0)
So do you have any idea about what to do, or another method for doing this?
Thank you!