-bool CSynapseClientModel::RequestAPI(APIDescriptor_t *pAPI)
-{
- if (!strcmp(pAPI->major_name, MODEL_MAJOR))
- {
- _QERPlugModelTable* pTable= static_cast<_QERPlugModelTable*>(pAPI->mpTable);
-
- if (!strcmp(pAPI->minor_name, "sprite"))
- {
- pTable->m_pfnLoadModel = &LoadSpriteModel;
- return true;
- }
- }
-
- Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo());
- return false;
+extern "C" CSynapseClient * SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ){
+ if ( strcmp( version, SYNAPSE_VERSION ) ) {
+ Syn_Printf( "ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version );
+ return NULL;
+ }
+ g_pSynapseServer = pServer;
+ g_pSynapseServer->IncRef();
+ Set_Syn_Printf( g_pSynapseServer->Get_Syn_Printf() );
+
+ add_model_apis( g_SynapseClient ); // see todo list above.
+
+ g_SynapseClient.AddAPI( PLUGIN_MAJOR, "sprite", sizeof( _QERPluginTable ) );
+ g_SynapseClient.AddAPI( RADIANT_MAJOR, NULL, sizeof( g_FuncTable ), SYN_REQUIRE, &g_FuncTable );
+ g_SynapseClient.AddAPI( QGL_MAJOR, NULL, sizeof( g_QglTable ), SYN_REQUIRE, &g_QglTable );
+ g_SynapseClient.AddAPI( SHADERS_MAJOR, "*", sizeof( g_ShadersTable ), SYN_REQUIRE, &g_ShadersTable );
+
+ return &g_SynapseClient;